[yum-git] yum/packages.py
James Antill
james at linux.duke.edu
Wed Feb 27 00:28:13 UTC 2008
yum/packages.py | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
New commits:
commit 345af3936455b78f82c61c4a3e1ec216169181f6
Author: James Antill <james at and.org>
Date: Tue Feb 26 19:16:13 2008 -0500
Give different info. for permission denied (missing)
diff --git a/yum/packages.py b/yum/packages.py
index f22ed57..848bb58 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -31,6 +31,7 @@ from rpmUtils import RpmUtilsError
import rpmUtils.arch
import rpmUtils.miscutils
import Errors
+import errno
import urlparse
urlparse.uses_fragment.append("media")
@@ -1018,14 +1019,27 @@ class YumInstalledPackage(YumHeaderPackage):
problems.append(thisproblem)
else:
+ try:
+ os.stat(fn)
+ perms_ok = True # Shouldn't happen
+ except OSError, e:
+ perms_ok = True
+ if e.errno == errno.EACCES:
+ perms_ok = False
+
thisproblem = misc.GenericHolder()
- thisproblem.type = 'missing' # maybe replace with a constants type
- thisproblem.message = 'file is missing'
+
+ if perms_ok:
+ thisproblem.type = 'missing'
+ thisproblem.message = 'file is missing'
+ else:
+ thisproblem.type = 'permissions-missing'
+ thisproblem.message = 'file is missing (Permission denied)'
thisproblem.disk_value = None
thisproblem.database_value = None
thisproblem.file_types = ftypes
problems.append(thisproblem)
-
+
if problems:
results[fn] = problems
More information about the Yum-cvs-commits
mailing list