Skip to content
Permalink
Browse files

module_scan: fix an issue occurs when sizes of two files are identical

  • Loading branch information...
LionNatsu committed Jul 7, 2019
1 parent a995c04 commit bcbb7d1470915114ee38d75ab878b7aa23fa8ad8
Showing with 4 additions and 5 deletions.
  1. +4 −5 python/module_scan.py
@@ -122,11 +122,10 @@ def scan_dir(db, base_dir: str, branch: str, component: str):
fullpath = PosixPath(base_dir).joinpath(filename)
if fullpath.is_file():
stat = fullpath.stat()
if size == stat.st_size:
sfullpath = str(fullpath)
if (mtime == int(stat.st_mtime) or
internal_pkgscan.sha256_file(sfullpath) == sha256):
ignore_files.add(sfullpath)
sfullpath = str(fullpath)
if size == stat.st_size and (mtime == int(stat.st_mtime) or
internal_pkgscan.sha256_file(sfullpath) == sha256):
ignore_files.add(sfullpath)
else:
dup_pkgs.add(filename)
del_list.append((filename, package, version, repopath))

0 comments on commit bcbb7d1

Please sign in to comment.
You can’t perform that action at this time.