summaryrefslogtreecommitdiff
path: root/reprepro
diff options
context:
space:
mode:
Diffstat (limited to 'reprepro')
-rwxr-xr-xreprepro/conf/diffsonly.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/reprepro/conf/diffsonly.py b/reprepro/conf/diffsonly.py
index e40e1aa..286d367 100755
--- a/reprepro/conf/diffsonly.py
+++ b/reprepro/conf/diffsonly.py
@@ -5,6 +5,8 @@ from gzip import GzipFile
from fnmatch import fnmatch
import sys
+import patchtracker.Conf as Conf
+
if __name__ == '__main__':
try:
(prog,src,dst) = sys.argv
@@ -13,7 +15,19 @@ if __name__ == '__main__':
sys.exit(1)
inf = sys.argv[1]
- slist = deb822.Sources.iter_paragraphs(GzipFile(inf))
+ fh = None
+ slist = []
+ if fnmatch(inf, "*.gz"):
+ fh = GzipFile(inf)
+ else:
+ fh = file(inf)
+
+ # temp workaround for #538376
+ if Conf.use_apt_pkg is not None:
+ slist = deb822.Sources.iter_paragraphs(fh, use_apt_pkg=Conf.use_apt_pkg)
+ else:
+ slist = deb822.Sources.iter_paragraphs(fh)
+
outf = file(sys.argv[2], "w")
print "filtering %s for .diff.gz/.dsc files..."%(inf)
for ent in slist: