From d93e81cd32654d55c36499db6cacad5fecebd96d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 29 Jan 2007 01:30:26 +0000 Subject: Catch EACCESS when running env-update, orignal patch by (bug #106061) (trunk r5802:5803 and r5813:5814) svn path=/main/branches/2.1.2/; revision=5829 --- bin/env-update | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bin/env-update') diff --git a/bin/env-update b/bin/env-update index b245b3990..69daaca87 100755 --- a/bin/env-update +++ b/bin/env-update @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -import os,sys +import os, sys, errno def usage(status): print "Usage: env-update [--no-ldconfig]" @@ -28,4 +28,11 @@ try: except ImportError: sys.path.insert(0, "/usr/lib/portage/pym") import portage -portage.env_update(makelinks) +try: + portage.env_update(makelinks) +except IOError, e: + if e.errno == errno.EACCES: + print "env-update: Need superuser access" + sys.exit(1) + else: + raise -- cgit v1.2.3-1-g7c22