summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-02-27 15:53:52 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-04-03 10:11:41 +0300
commitc05e8590e5b563a5040ccb888ffafcb30913e78e (patch)
treedde599c7aa628496b3c2ee1514301d1bdc2b7d6a
parent099ae20ab4ff0b6499dd282c134345bb90c6efbc (diff)
downloadgit-buildpackage-c05e8590e5b563a5040ccb888ffafcb30913e78e.tar.gz
git-buildpackage-c05e8590e5b563a5040ccb888ffafcb30913e78e.tar.bz2
git-buildpackage-c05e8590e5b563a5040ccb888ffafcb30913e78e.zip
import-srpm: import all packaging files from src.rpm
Don't try to be too clever when importing an (true) src.rpm - just import all files from there without trying to guess file list from spec. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xgbp/scripts/import_srpm.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/gbp/scripts/import_srpm.py b/gbp/scripts/import_srpm.py
index 3b04ce79..9eaf6e46 100755
--- a/gbp/scripts/import_srpm.py
+++ b/gbp/scripts/import_srpm.py
@@ -261,8 +261,10 @@ def main(argv):
srpm = download_source(srpm, dirs)
# Real srpm, we need to unpack, first
+ true_srcrpm = False
if not os.path.isdir(srpm) and not srpm.endswith(".spec"):
src = parse_srpm(srpm)
+ true_srcrpm = True
dirs['pkgextract'] = tempfile.mkdtemp(dir=dirs['tmp_base'],
prefix='pkgextract_')
gbp.log.info("Extracting src rpm to '%s'" % dirs['pkgextract'])
@@ -318,13 +320,20 @@ def main(argv):
if err.errno != errno.EEXIST:
raise
- # Need to copy files to the packaging directory given by caller
- files = [os.path.basename(patch.path) \
- for patch in spec.patchseries(unapplied=True, ignored=True)]
- for num, filename in spec.sources().iteritems():
- if not spec.orig_src or num != spec.orig_src['num']:
+ if true_srcrpm:
+ # For true src.rpm we just take everything
+ files = os.listdir(dirs['src'])
+ else:
+ # Need to copy files to the packaging directory given by caller
+ files = [os.path.basename(patch.path) \
+ for patch in spec.patchseries(unapplied=True, ignored=True)]
+ for filename in spec.sources().values():
files.append(filename)
- files.append(os.path.join(spec.specdir, spec.specfile))
+ files.append(os.path.join(spec.specdir, spec.specfile))
+ # Don't copy orig source archive, though
+ if spec.orig_src and spec.orig_src['filename'] in files:
+ files.remove(spec.orig_src['filename'])
+
for fname in files:
fpath = os.path.join(dirs['src'], fname)
if os.path.exists(fpath):