diff --git a/pisi/util.py b/pisi/util.py index 9f6ef2ff..9d704575 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -316,11 +316,6 @@ def get_file_hashes(top, excludePrefix=None, removePrefix=None): raise e return None - # also handle single files - if os.path.isfile(top): - yield (top, sha1_sum(top)) - return - def has_excluded_prefix(filename): if excludePrefix and removePrefix: tempfnam = remove_prefix(removePrefix, filename) @@ -329,6 +324,16 @@ def get_file_hashes(top, excludePrefix=None, removePrefix=None): return 1 return 0 + # handle single file + if os.path.isfile(top): + yield (top, sha1_sum(top)) + return + + # handle single symlink declaration here. + if os.path.islink(top): + yield (top, sha1_sum(os.readlink(top), True)) + return + for root, dirs, files in os.walk(top, topdown=False): #bug 339 if os.path.islink(root) and not has_excluded_prefix(root):