X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fgenerate_releases.py;h=9de4614da4d97530678125ae0580a16c86529572;hb=c7cd84ed41a5b670db475483b5ed3016931c223d;hp=0bd7a69f60ec17e6a6e5826d22534b1e7a3afa0c;hpb=a732a4aa7fbf08e3f199e4aba736660135b7834e;p=dak.git diff --git a/dak/generate_releases.py b/dak/generate_releases.py index 0bd7a69f..9de4614d 100755 --- a/dak/generate_releases.py +++ b/dak/generate_releases.py @@ -59,6 +59,24 @@ def add_tiffani (files, path, indexstem): #print "ALERT: there was a tiffani file %s" % (filepath) files.append(index) +def gen_i18n_index (files, tree, sec): + path = Cnf["Dir::Root"] + tree + "/" + i18n_path = "%s/i18n" % (sec) + if os.path.exists("%s/%s" % (path, i18n_path)): + index = "%s/Index" % (i18n_path) + out = open("%s/%s" % (path, index), "w") + out.write("SHA1:\n") + for x in os.listdir("%s/%s" % (path, i18n_path)): + if x.startswith('Translation-'): + f = open("%s/%s/%s" % (path, i18n_path, x), "r") + size = os.fstat(f.fileno())[6] + f.seek(0) + sha1sum = apt_pkg.sha1sum(f) + f.close() + out.write(" %s %7d %s\n" % (sha1sum, size, x)) + out.close() + files.append(index) + def compressnames (tree,type,file): compress = AptCnf.get("%s::%s::Compress" % (tree,type), AptCnf.get("Default::%s::Compress" % (type), ". gzip")) result = [] @@ -179,22 +197,26 @@ def main (): for suitename in suites: print "Processing: " + suitename - SuiteBlock = Cnf.SubTree("Suite::" + suite) - suiteobj = get_suite(suitename) + SuiteBlock = Cnf.SubTree("Suite::" + suitename) + suiteobj = get_suite(suitename.lower()) + if not suiteobj: + print "ALERT: Cannot find suite %s!" % (suitename.lower()) + continue - suite = suite.suite_name.lower() + # Use the canonical name + suite = suiteobj.suite_name.lower() - if suite.untouchable and not Options["Force-Touch"]: + if suiteobj.untouchable and not Options["Force-Touch"]: print "Skipping: " + suite + " (untouchable)" continue - origin = suite.origin - label = suite.label or suite.origin - codename = suite.codename or "" + origin = suiteobj.origin + label = suiteobj.label or suiteobj.origin + codename = suiteobj.codename or "" version = "" - if suite.version and suite.version != '-': - version = suite.version - description = suite.description or "" + if suiteobj.version and suiteobj.version != '-': + version = suiteobj.version + description = suiteobj.description or "" architectures = get_suite_architectures(suite, skipall=True, skipsrc=True) @@ -258,7 +280,10 @@ def main (): else: for x in os.listdir("%s/%s" % (Cnf["Dir::Root"], tree)): if x.startswith('Contents-'): - files.append(x) + if x.endswith('.diff'): + files.append("%s/Index" % (x)) + else: + files.append(x) for sec in AptCnf["tree::%s::Sections" % (tree)].split(): for arch in AptCnf["tree::%s::Architectures" % (tree)].split(): @@ -287,6 +312,7 @@ def main (): relpath = Cnf["Dir::Root"]+tree+"/"+rel write_release_file(relpath, suite, sec, origin, label, arch, version, suite_suffix, notautomatic) files.append(rel) + gen_i18n_index(files, tree, sec) if AptCnf.has_key("tree::%s/main" % (tree)): for dis in ["main", "contrib", "non-free"]: