diff options
author | yang.zhang <y0169.zhang@samsung.com> | 2016-05-24 14:11:25 +0800 |
---|---|---|
committer | yang.zhang <y0169.zhang@samsung.com> | 2016-05-24 14:11:42 +0800 |
commit | 2561a7085213ffa3ca9ea63fbf9b5a305ac7d834 (patch) | |
tree | 4b114a678c11c7ef9cd6352bd5415528ed30d71b /gbp/scripts | |
parent | 5b9b6f2d40a7659e581b38385fd4979282ed1a63 (diff) | |
download | git-buildpackage-2561a7085213ffa3ca9ea63fbf9b5a305ac7d834.tar.gz git-buildpackage-2561a7085213ffa3ca9ea63fbf9b5a305ac7d834.tar.bz2 git-buildpackage-2561a7085213ffa3ca9ea63fbf9b5a305ac7d834.zip |
Add tar extract patches to solve bad message generated by git(2.7.4) mailinfo
Change-Id: Iaca480434f5f59d9b3cc66e477a9ea9c5c08c276
Diffstat (limited to 'gbp/scripts')
-rwxr-xr-x | gbp/scripts/pq_rpm.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py index e19218a9..32ffadee 100755 --- a/gbp/scripts/pq_rpm.py +++ b/gbp/scripts/pq_rpm.py @@ -26,6 +26,7 @@ import sys import re import gzip import bz2 +import tarfile import subprocess import gbp.tmpfile as tempfile from gbp.config import GbpOptionParserRpm @@ -300,6 +301,9 @@ def safe_patches(queue, tmpdir_base): gbp.log.debug("Uncompressing '%s'" % os.path.basename(patch.path)) src = uncompressors[comp](patch.path, 'r') dst_name = os.path.join(tmpdir, os.path.basename(base)) + if _archive_fmt: + tar_name = dst_name + dst_name += '.tar' elif comp: raise GbpError("Unsupported patch compression '%s', giving up" % comp) @@ -311,6 +315,11 @@ def safe_patches(queue, tmpdir_base): dst.writelines(src) src.close() dst.close() + if _archive_fmt: + t = tarfile.open(dst_name, 'r:') + t.extractall(path = tmpdir) + t.close() + dst_name = tar_name safequeue.append(patch) safequeue[-1].path = dst_name |