268
268
return image.endswith(".metalink")
271
def checksum_directory(config, directory, old_directories=None, map_expr=None):
271
def checksum_directory(config, directory, old_directories=None, sign=True,
272
273
if old_directories is None:
273
274
old_directories = [directory]
275
276
# We don't want to read the existing checksum files directly, as they
276
277
# may contain stale checksums; so we don't use the context manager form
278
checksum_files = ChecksumFileSet(config, directory)
279
checksum_files = ChecksumFileSet(config, directory, sign=sign)
279
280
checksum_files.merge_all(old_directories, map_expr=map_expr)
280
281
checksum_files.write()
283
def metalink_checksum_directory(config, directory, old_directories=None):
284
def metalink_checksum_directory(config, directory, old_directories=None,
284
286
if old_directories is None:
285
287
old_directories = [directory]
287
289
# We don't want to read the existing checksum files directly, as they
288
290
# may contain stale checksums; so we don't use the context manager form
290
checksum_files = MetalinkChecksumFileSet(config, directory)
292
checksum_files = MetalinkChecksumFileSet(config, directory, sign=sign)
291
293
checksum_files.merge_all(old_directories)
292
294
checksum_files.write()