From 2561a7085213ffa3ca9ea63fbf9b5a305ac7d834 Mon Sep 17 00:00:00 2001 From: "yang.zhang" Date: Tue, 24 May 2016 14:11:25 +0800 Subject: [PATCH] Add tar extract patches to solve bad message generated by git(2.7.4) mailinfo Change-Id: Iaca480434f5f59d9b3cc66e477a9ea9c5c08c276 --- gbp/scripts/pq_rpm.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py index e19218a..32ffade 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 -- 2.7.4