If lchown is unavailable for some unexpected reason, make all lchown calls print...
authorZac Medico <zmedico@gentoo.org>
Wed, 7 Jun 2006 12:39:52 +0000 (12:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 7 Jun 2006 12:39:52 +0000 (12:39 -0000)
svn path=/main/trunk/; revision=3466

pym/portage_data.py

index 760ab3ea28841e1e2dac5e5dd4434e492fc8f2c6..bd556b5190bf73ec529d625d875f59650493566d 100644 (file)
@@ -31,11 +31,14 @@ if not lchown:
                # Included in python-2.3
                lchown = os.lchown
        else:
-               import missingos
-               lchown = missingos.lchown
+               try:
+                       import missingos
+                       lchown = missingos.lchown
+               except ImportError:
+                       def lchown(*pos_args, **key_args):
+                               writemsg(red("!!!") + " It seems that os.lchown does not" + \
+                                       " exist.  Please rebuild python.\n", noiselevel=-1)
 
-
-       
 os.environ["USERLAND"]=userland
 
 # Portage has 3 security levels that depend on the uid and gid of the main