diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-02-27 15:53:52 +0200 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-03-08 14:04:00 +0200 |
commit | 5214722dfff07d5fb3444f70dfaf443a3c8729ac (patch) | |
tree | 00570a9ce17c6ea991bb9a71b5f66b0ab3db8cd5 | |
parent | 1bfff84f088ab1e361f4cb3b7beb160a53d8d959 (diff) | |
download | git-buildpackage-5214722dfff07d5fb3444f70dfaf443a3c8729ac.tar.gz git-buildpackage-5214722dfff07d5fb3444f70dfaf443a3c8729ac.tar.bz2 git-buildpackage-5214722dfff07d5fb3444f70dfaf443a3c8729ac.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-x | gbp/scripts/import_srpm.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gbp/scripts/import_srpm.py b/gbp/scripts/import_srpm.py index 0b53632b..8d51e873 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): |