- try:
- file_handle = utils.open_file(path + name, "r")
- except utils.cant_open.exc:
- print "ALERT: Couldn't open " + path + name
- else:
- md5 = apt_pkg.md5sum(file_handle)
- file_handle.close()
-
- size = os.stat(path + name)[stat.ST_SIZE]
-
- out.write(" %s %8d %s\n" % (md5, size, name))
+ for name in files:
+ try:
+ file_handle = utils.open_file(path + name, "r")
+ except utils.cant_open_exc:
+ print "ALERT: Couldn't open " + path + name
+ else:
+ md5 = apt_pkg.md5sum(file_handle)
+ file_handle.close()
+
+ size = os.stat(path + name)[stat.ST_SIZE]
+ out.write(" %s %8d %s\n" % (md5, size, name))
+
+def print_sha1_files (tree, files):
+ path = Cnf["Dir::RootDir"] + tree + "/"
+ for name in files:
+ try:
+ file_handle = utils.open_file(path + name, "r")
+ except utils.cant_open_exc:
+ print "ALERT: Couldn't open " + path + name
+ else:
+ sha1 = apt_pkg.sha1sum(file_handle)
+ file_handle.close()
+
+ size = os.stat(path + name)[stat.ST_SIZE]
+ out.write(" %s %8d %s\n" % (sha1, size, name))