summaryrefslogtreecommitdiff
path: root/patchtracker
diff options
context:
space:
mode:
Diffstat (limited to 'patchtracker')
-rwxr-xr-xpatchtracker/Conf.py6
-rwxr-xr-xpatchtracker/SourceArchive.py19
2 files changed, 18 insertions, 7 deletions
diff --git a/patchtracker/Conf.py b/patchtracker/Conf.py
index e89a129..28820b5 100755
--- a/patchtracker/Conf.py
+++ b/patchtracker/Conf.py
@@ -38,6 +38,12 @@ archive_lists_compressed = False
indication flag for the scripts that interact with it.
"""
+suites = None
+""" Override the suites that should be tracked in the application. Should
+ be a chronologically ordered list and should correspond to the
+ seperately managed reprepro configuration.
+"""
+
try:
from localconfig import *
except ImportError:
diff --git a/patchtracker/SourceArchive.py b/patchtracker/SourceArchive.py
index ce3459a..303bcdd 100755
--- a/patchtracker/SourceArchive.py
+++ b/patchtracker/SourceArchive.py
@@ -4,6 +4,7 @@ from fnmatch import fnmatch
from gzip import GzipFile
from debian_bundle import deb822
import difflib
+from patchtracker import Conf
import models
@@ -30,6 +31,8 @@ class Archive:
def parsesuites(self, filter=None):
slist = os.listdir(self.distsdir)
+ if Conf.suites:
+ slist = set(Conf.suites).intersection(set(slist))
if filter:
slist = set(filter).intersection(set(slist))
for s in sorted(slist):
@@ -151,9 +154,11 @@ class ReleaseList:
def __init__(self, project):
self.project = project
- # XXX this is hard coded for now...
self.relorder = {}
- self.relorder["debian"] = ["etch", "lenny", "squeeze", "sid", "experimental"]
+ if Conf.suites:
+ self.relorder["debian"] = Conf.suites
+ else:
+ self.relorder["debian"] = ["lenny", "squeeze", "wheezy", "sid", "experimental"]
def __iter__(self):
for r in self.relorder[self.project]:
@@ -164,17 +169,17 @@ if __name__ == "__main__":
import Conf
import sys
import copy
- a = Archive(sys.argv[1], suitefilter=["etch"])
+ a = Archive(sys.argv[1], suitefilter=["lenny"])
b = copy.deepcopy(a)
b.addsuite("lenny")
- b.addcomponent("etch", "something")
+ b.addcomponent("lenny", "something")
class x:
def __init__(self,name):
self.name=name
- b.addsourcepackage("etch","main",x("foo"))
+ b.addsourcepackage("lenny","main",x("foo"))
print "suite diff"
print "\n".join( ArchiveDiffer().diffsuites(a,b) )
print "component diff"
- print "\n".join( ArchiveDiffer().diffcomponents(a,b,"etch") )
+ print "\n".join( ArchiveDiffer().diffcomponents(a,b,"lenny") )
print "package diff"
- print "\n".join( ArchiveDiffer().diffsourcepackages(a,b,"etch","main") )
+ print "\n".join( ArchiveDiffer().diffsourcepackages(a,b,"lenny","main") )