validate-indices - ensure files mentioned in Packages & Sources exist
files-not-symlinks - check files in the database aren't symlinks
validate-builddeps - validate build-dependencies of .dsc files in the archive
+ add-missing-source-checksums - add missing checksums for source packages
"""
sys.exit(exit_code)
################################################################################
+def add_missing_source_checksums():
+ """ Add missing source checksums to source_metadata """
+ session = DBConn().session()
+ for checksum in ['Files', 'Checksums-Sha1', 'Checksums-Sha256']:
+ rows = session.execute('SELECT source_metadata_add_missing_checksum(:type)', {'type': checksum}).scalar()
+ if rows > 0:
+ print "Added {0} missing entries for {1}".format(rows, checksum)
+ session.commit()
+
+################################################################################
+
def main ():
global db_files, waste, excluded
check_files_not_symlinks()
elif mode == "validate-builddeps":
check_build_depends()
+ elif mode == "add-missing-source-checksums":
+ add_missing_source_checksums()
else:
utils.warn("unknown mode '%s'" % (mode))
usage(1)