From 447ad0c6d0deaec4e9abadf5421d2192845a3587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Tue, 30 Aug 2005 20:03:24 +0000 Subject: [PATCH] handle single files in get_file_hashes(). --- pisi/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pisi/util.py b/pisi/util.py index 2ce12ec7..be54cc3f 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -236,6 +236,10 @@ def get_file_hashes(top, exclude_prefix=None, removePrefix=None): used to remove prefix from filePath while matching excludes, if given.""" + # also handle single files + if os.path.isfile(top): + return top, sha1_file(top) + def has_excluded_prefix(filename): if exclude_prefix and removePrefix: tempfnam = remove_prefix(removePrefix, filename)