summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-02-13 12:41:39 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-02-13 12:54:49 +0200
commit7634a2ce568f036ece809c456310925bda7f9517 (patch)
tree4b245a84bd7fd7d0e08ea405316bf7ed34cddb72
parentf8d3fc8a1f5fb7bb669abcbd0013e66ac877b983 (diff)
downloadgit-buildpackage-7634a2ce568f036ece809c456310925bda7f9517.tar.gz
git-buildpackage-7634a2ce568f036ece809c456310925bda7f9517.tar.bz2
git-buildpackage-7634a2ce568f036ece809c456310925bda7f9517.zip
import-orig-rpm: implement automatic downloading
Automatically try to download the archive if the archive filename points to a remote location. Change-Id: I387cab9f7ec53d268010367517f22f02055e01b7 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xgbp/scripts/import_orig_rpm.py7
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..8a6df9e4 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):