summaryrefslogtreecommitdiffstats
path: root/test/pacman/util.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-05-16 18:08:32 +0200
committerDan McGee <dan@archlinux.org>2011-05-16 18:31:26 +0200
commit3000b6b473422dca3670c922c24d0e15e963281a (patch)
tree2310d5b9574d2f6906bbddb446179edbfbb54e68 /test/pacman/util.py
parentac6f6b317ae4bb7adf5ea08fbad6a75f024ff75a (diff)
downloadpacman-3000b6b473422dca3670c922c24d0e15e963281a.tar.gz
pacman-3000b6b473422dca3670c922c24d0e15e963281a.tar.xz
pactest: treat symlinks with more respect
Don't call os.stat() when we should be using os.lstat(); this allows us to actually test dead symlinks that don't have a corresponding file. Add a new LINK_EXIST rule that complements FILE_EXIST for a similar purpose. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test/pacman/util.py')
-rwxr-xr-xtest/pacman/util.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/pacman/util.py b/test/pacman/util.py
index b771a345..47fde310 100755
--- a/test/pacman/util.py
+++ b/test/pacman/util.py
@@ -149,7 +149,6 @@ def getmd5sum(filename):
"""
"""
if not os.path.isfile(filename):
- print "file %s does not exist!" % filename
return ""
fd = open(filename, "rb")
checksum = hashlib.md5()
@@ -177,9 +176,8 @@ def getmtime(filename):
"""
"""
if not os.path.exists(filename):
- print "path %s does not exist!" % filename
- return 0, 0, 0
- st = os.stat(filename)
+ return None, None, None
+ st = os.lstat(filename)
return st[stat.ST_ATIME], st[stat.ST_MTIME], st[stat.ST_CTIME]
#