aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo/binrepo.py
diff options
context:
space:
mode:
Diffstat (limited to 'MgaRepo/binrepo.py')
-rw-r--r--MgaRepo/binrepo.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/MgaRepo/binrepo.py b/MgaRepo/binrepo.py
index 89679b0..874a091 100644
--- a/MgaRepo/binrepo.py
+++ b/MgaRepo/binrepo.py
@@ -170,3 +170,20 @@ def update_sources(topdir, added=[], removed=[]):
f.write("%s %s\n" % (entries[name], name))
f.close()
+def check_sources(topdir):
+ """Verify hashes against binrepo files
+
+ Returns a list of files that differ. Files have do not exist locally are
+ ignored.
+ """
+ changed = []
+ path = sources_path(topdir)
+ if os.path.isfile(path):
+ entries = parse_sources(path)
+ for filename in entries:
+ filepath = os.path.join(topdir, 'SOURCES', filename)
+ if os.path.exists(filepath):
+ name = os.path.basename(filepath)
+ if entries[name] != file_hash(filepath):
+ changed.append(name)
+ return changed