[yum-cvs] yum-utils yum-builddep.py,1.1,1.2

Paul Nasrat pnasrat at login.linux.duke.edu
Thu Jun 9 00:48:28 UTC 2005


Update of /home/groups/yum/cvs/yum-utils
In directory login:/tmp/cvs-serv11598

Modified Files:
	yum-builddep.py 
Log Message:
Error not traceback on non-root

Index: yum-builddep.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-utils/yum-builddep.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- yum-builddep.py	30 May 2005 15:47:56 -0000	1.1
+++ yum-builddep.py	9 Jun 2005 00:48:26 -0000	1.2
@@ -14,7 +14,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-import sys
+import sys, os
 
 sys.path.insert(0, '/usr/share/yum-cli')
 import cli
@@ -26,8 +26,14 @@
 def main(args):
     base = cli.YumBaseCli()
     base.doConfigSetup()
+    base.conf.setConfigOption('uid', os.geteuid())
+        
     base.log = Logger(threshold=base.conf.getConfigOption('debuglevel'), file_object =sys.stdout)
 
+    if base.conf.getConfigOption('uid') != 0:
+        base.errorlog(0, "You must be root to install packages")
+        sys.exit(1)
+
     archlist = rpmUtils.arch.getArchList() + ['src']
     base.doRepoSetup(dosack=0)
     base.doTsSetup()




More information about the Yum-cvs-commits mailing list