diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-02-13 12:41:39 +0200 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-11-14 14:47:20 +0200 |
commit | 0e8118863ca07fef874eed946455aefdc7737b17 (patch) | |
tree | 7ede903c4ea774bd77fae6ffae866ffcad49b160 | |
parent | 57d8ddc329e57d4e5d91ae77f87f307db35cfa98 (diff) | |
download | git-buildpackage-0e8118863ca07fef874eed946455aefdc7737b17.tar.gz git-buildpackage-0e8118863ca07fef874eed946455aefdc7737b17.tar.bz2 git-buildpackage-0e8118863ca07fef874eed946455aefdc7737b17.zip |
import-orig-rpm: implement automatic downloading
Automatically try to download the archive if the archive filename points
to a remote location.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-x | gbp/scripts/import_orig_rpm.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gbp/scripts/import_orig_rpm.py b/gbp/scripts/import_orig_rpm.py index a8f874c6..f3ca4acd 100755 --- a/gbp/scripts/import_orig_rpm.py +++ b/gbp/scripts/import_orig_rpm.py @@ -23,6 +23,7 @@ import os import sys import gbp.tmpfile as tempfile import gbp.command_wrappers as gbpc +import re import string from gbp.pkg import parse_archive_filename from gbp.rpm import (RpmUpstreamSource, SpecFile, NoSpecError, guess_spec, @@ -35,6 +36,7 @@ import gbp.log from gbp.scripts.common.import_orig import (cleanup_tmp_tree, ask_package_name, ask_package_version, prepare_sources) +from gbp.scripts.import_srpm import download_file def upstream_import_commit_msg(options, version): @@ -99,7 +101,10 @@ def find_source(options, args): elif len(args) == 0: raise GbpError, "No archive to import specified. Try --help." else: - return RpmUpstreamSource(args[0]) + path = args[0] + if re.match(r'[a-z]{1,5}://', path): + path = download_file('..', path) + return RpmUpstreamSource(path) def pristine_tarball_name(source, pkg_name, pkg_version, pristine_name): |