forked from Mirror/pmbootstrap
pmb/helpers/repo.py: Diff ofthe package repo works properly now.
Previously, it would always report all files as new files, although some of them may not have changed. I've added testcases for the repo functions.
This commit is contained in:
parent
7543ae540b
commit
c0f90ee65a
2 changed files with 97 additions and 2 deletions
|
@ -53,8 +53,16 @@ def diff(args, files_a, files_b=None):
|
|||
ret = []
|
||||
for arch in files_b.keys():
|
||||
for file, timestamp in files_b[arch].items():
|
||||
if (arch not in files_a or file not in files_a[arch] or
|
||||
timestamp is not files_a[arch][file]):
|
||||
add = False
|
||||
if arch not in files_a:
|
||||
add = True
|
||||
elif file not in files_a[arch]:
|
||||
add = True
|
||||
elif timestamp != files_a[arch][file]:
|
||||
add = True
|
||||
if add:
|
||||
ret.append(arch + "/" + file)
|
||||
|
||||
|
||||
|
||||
return sorted(ret)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue