os.link(origfile + origext, oldfile + origext)
os.unlink(newfile)
- f = open(outdir + "/Index", "w")
- upd.dump(f)
- f.close()
+ with open(outdir + "/Index.new", "w") as f:
+ upd.dump(f)
+ os.rename(outdir + "/Index.new", outdir + "/Index")
def main():
packages = "Sources"
maxsuite = maxsources
else:
- longarch = "binary-%s"% (architecture)
+ longarch = "binary-%s" % (architecture)
packages = "Packages"
maxsuite = maxpackages
- # Process Contents
- file = "%s/%s/Contents-%s" % (tree, component, architecture)
- storename = "%s/%s_%s_contents_%s" % (Options["TempDir"], suite, component, architecture)
- genchanges(Options, file + ".diff", storename, file, maxcontents)
+
+ # Process Contents
+ file = "%s/%s/Contents-%s" % (tree, component, architecture)
+ storename = "%s/%s_%s_contents_%s" % (Options["TempDir"], suite, component, architecture)
+ genchanges(Options, file + ".diff", storename, file, maxcontents)
file = "%s/%s/%s/%s" % (tree, component, longarch, packages)
storename = "%s/%s_%s_%s" % (Options["TempDir"], suite, component, architecture)