From: Zac Medico Date: Wed, 7 Jun 2006 12:39:52 +0000 (-0000) Subject: If lchown is unavailable for some unexpected reason, make all lchown calls print... X-Git-Tag: v2.1~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=58b56a401ebd833ce4418dffdf8167251355e843;p=portage.git If lchown is unavailable for some unexpected reason, make all lchown calls print a warning message (bug #135398). svn path=/main/trunk/; revision=3466 --- diff --git a/pym/portage_data.py b/pym/portage_data.py index 760ab3ea2..bd556b519 100644 --- a/pym/portage_data.py +++ b/pym/portage_data.py @@ -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