else:
hash = hashop(file_handle)
file_handle.close()
- out.write(" %s %8d %s\n" % (hash, size, name))
+ out.write(" %s %8d %s\n" % (hash, size, name))
def print_md5_files (tree, files):
print_md5sha_files (tree, files, apt_pkg.md5sum)
def print_sha1_files (tree, files):
print_md5sha_files (tree, files, apt_pkg.sha1sum)
+def print_sha256_files (tree, files):
+ print_md5sha_files (tree, files, apt_pkg.sha256sum)
+
################################################################################
def main ():
AptCnf = apt_pkg.newConfiguration()
apt_pkg.ReadConfigFileISC(AptCnf,daklib.utils.which_apt_conf_file())
+ #apt_pkg.ReadConfigFileISC(AptCnf,"/org/ftp.debian.org/dak/config/debian/apt.conf.stable")
+ #apt_pkg.ReadConfigFileISC(AptCnf,"/org/ftp.debian.org/dak/config/debian/apt.conf.oldstable")
if not suites:
suites = Cnf.SubTree("Suite").List()
relpath = Cnf["Dir::Root"]+tree+"/"+rel
try:
+ if os.access(relpath, os.F_OK):
+ if os.stat(relpath).st_nlink > 1:
+ os.unlink(relpath)
release = open(relpath, "w")
#release = open(longsuite.replace("/","_") + "_" + arch + "_" + sec + "_Release", "w")
except IOError:
files.append(rel)
if AptCnf.has_key("tree::%s/main" % (tree)):
- sec = AptCnf["tree::%s/main::Sections" % (tree)].split()[0]
- if sec != "debian-installer":
- print "ALERT: weird non debian-installer section in %s" % (tree)
-
- for arch in AptCnf["tree::%s/main::Architectures" % (tree)].split():
- if arch != "source": # always true
- for file in compressnames("tree::%s/main" % (tree), "Packages", "main/%s/binary-%s/Packages" % (sec, arch)):
- files.append(file)
+ for dis in ["main", "contrib", "non-free"]:
+ if not AptCnf.has_key("tree::%s/%s" % (tree, dis)): continue
+ sec = AptCnf["tree::%s/%s::Sections" % (tree,dis)].split()[0]
+ if sec != "debian-installer":
+ print "ALERT: weird non debian-installer section in %s" % (tree)
+
+ for arch in AptCnf["tree::%s/%s::Architectures" % (tree,dis)].split():
+ if arch != "source": # always true
+ for file in compressnames("tree::%s/%s" % (tree,dis),
+ "Packages",
+ "%s/%s/binary-%s/Packages" % (dis, sec, arch)):
+ files.append(file)
elif AptCnf.has_key("tree::%s::FakeDI" % (tree)):
usetree = AptCnf["tree::%s::FakeDI" % (tree)]
sec = AptCnf["tree::%s/main::Sections" % (usetree)].split()[0]
print_md5_files(tree, files)
out.write("SHA1:\n")
print_sha1_files(tree, files)
+ out.write("SHA256:\n")
+ print_sha256_files(tree, files)
out.close()
if Cnf.has_key("Dinstall::SigningKeyring"):