diff options
author | Giovanni Mascellani <mascellani@poisson.phc.unipi.it> | 2011-07-31 11:55:58 +0200 |
---|---|---|
committer | Sean Finney <seanius@htpc-l.(none)> | 2011-09-17 13:28:46 +0200 |
commit | 80ee0baf5dc3b4014e6b65be53bfc78dfdb7671b (patch) | |
tree | 3ecff6ac53efc9bcb146d59fab8dc7caf2e43725 | |
parent | 2728f17f36f466682d3cc27ab8021fec3f827aa9 (diff) | |
download | patch-tracker-80ee0baf5dc3b4014e6b65be53bfc78dfdb7671b.tar.gz |
Save memory by not loading the filtered patch.
-rw-r--r-- | patchtracker/DiffGzHandler.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/patchtracker/DiffGzHandler.py b/patchtracker/DiffGzHandler.py index 769ce18..75b6037 100644 --- a/patchtracker/DiffGzHandler.py +++ b/patchtracker/DiffGzHandler.py @@ -39,20 +39,17 @@ class DiffGzHandler: def series(self, ghost=False): patches = None - embedded = self.filterdiff(include='debian/patches*') # XXX *cough* cache *cough* - if embedded.lines(): - td = tempfile.mkdtemp() - i,o,e=os.popen3("patch -d %s -p3"%(td)) - o.close() - i.write(str(embedded)) - i.close() - err = e.read() - if len(err): - raise Exception("unable to extract series patches:\n"+err) - patches = PatchSeries(td, ghost=ghost) - os.system("rm -rf %s"%(td)) + td = tempfile.mkdtemp() + i,o,e=os.popen3("filterdiff -z -p 1 -i 'debian/patches*' %s | patch -d %s -p3" % (self.diff, td)) + o.close() + i.close() + err = e.read() + if len(err): + raise Exception("unable to extract series patches:\n"+err) + patches = PatchSeries(td, ghost=ghost) + os.system("rm -rf %s"%(td)) return patches |