mock mock.py,1.49,1.50

John Clark Williams (jcwillia) fedora-extras-commits at redhat.com
Wed May 17 15:12:38 UTC 2006


Author: jcwillia

Update of /cvs/fedora/mock
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28439

Modified Files:
	mock.py 
Log Message:
Michael E. Brown's patch for getting PS1 down to chroot shell


Index: mock.py
===================================================================
RCS file: /cvs/fedora/mock/mock.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- mock.py	16 May 2006 04:15:48 -0000	1.49
+++ mock.py	17 May 2006 15:12:36 -0000	1.50
@@ -758,12 +758,12 @@
         else:
             print 'Finished cleaning root'
 
-def do_run_cmd(config_opts, cmd, raw_chroot=0):
+def do_run_cmd(config_opts, cmd, env='', raw_chroot=0):
         my = Root(config_opts)
         my.debug("executing: %s" % cmd)
         my._mount()
         if raw_chroot: 
-            cmd = '%s %s %s' % (config_opts['chroot'], my.rootdir, cmd)
+            cmd = '%s %s %s %s' % (env, config_opts['chroot'], my.rootdir, cmd)
             os.system(cmd)
         else:
             my.do_chroot(cmd, True)
@@ -885,8 +885,7 @@
     elif args[0] == 'shell':
         # debugging tool for interactive poking around in the chroot
         config_opts['clean'] = config_opts['quiet'] = False
-        os.environ['PS1'] = "mock-chroot> "
-        do_run_cmd(config_opts, "/bin/bash", raw_chroot=1)
+        do_run_cmd(config_opts, "/bin/bash", env='PS1="mock-chroot> "', raw_chroot=1)
 
     else:
         if args[0] == 'rebuild':




More information about the fedora-extras-commits mailing list