summaryrefslogtreecommitdiff
path: root/gen-patch-info.py
diff options
context:
space:
mode:
Diffstat (limited to 'gen-patch-info.py')
-rwxr-xr-xgen-patch-info.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/gen-patch-info.py b/gen-patch-info.py
index 5d7d899..ef1621e 100755
--- a/gen-patch-info.py
+++ b/gen-patch-info.py
@@ -4,19 +4,23 @@
import os
import sys
import getopt
+import gzip
import errno
+import simplejson
import patchtracker.Conf as Conf
from patchtracker.SourceArchive import Archive, SourcePackage
from patchtracker.DB import PatchTrackerDB
+from patchtracker.PtsIndex import PtsIndexFile
if __name__ == '__main__':
db = PatchTrackerDB()
os.system("cheetah compile templates/skeleton")
- opts,args = getopt.getopt(sys.argv[1:], "as:p:")
+ opts,args = getopt.getopt(sys.argv[1:], "ais:p:")
suites = None
packages = None
update_archive = False
+ gen_pts_index = False
for o,v in opts:
if o == "-s":
suites = v.split(',')
@@ -24,6 +28,8 @@ if __name__ == '__main__':
packages = v.split(',')
elif o == "-a":
update_archive = True
+ elif o == "-i":
+ gen_pts_index = True
if update_archive:
os.system("env PYTHONPATH=%s reprepro -b %s --confdir reprepro/conf update"%
@@ -50,6 +56,12 @@ if __name__ == '__main__':
db.relateSourcePackage(name=p.name, version=p.version, suite=s,
component=c)
+ if gen_pts_index:
+ pts_idx = PtsIndexFile(a)
+ pts_fh = gzip.GzipFile(Conf.pts_index_file, mode="wb")
+ simplejson.dump(pts_idx, pts_fh)
+ pts_fh.close()
+
db.prune()
db.unmark()
db.finalize()