[yum-cvs] yum cli.py,1.162,1.163 shell.py,1.5,1.6

Seth Vidal skvidal at login.linux.duke.edu
Mon Mar 7 07:01:31 UTC 2005


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

Modified Files:
	cli.py shell.py 
Log Message:

permit multiple shell transactions in one run.


Index: cli.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/cli.py,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -r1.162 -r1.163
--- cli.py	6 Mar 2005 09:51:36 -0000	1.162
+++ cli.py	7 Mar 2005 07:01:28 -0000	1.163
@@ -722,10 +722,15 @@
         del self.ts
         
         self.initActionTs()
+        # save our dsCallback out
+        dscb = self.dsCallback
         self.dsCallback = None # dumb, dumb dumb dumb!
         self.populateTs(keepold=0) # sigh
         tserrors = self.ts.test(testcb, conf=tsConf)
         del testcb
+        # put it back
+        self.dsCallback = dscb
+        
         self.log(2, 'Finished Transaction Test')
         if len(tserrors) > 0:
             errstring = 'Transaction Check Error: '

Index: shell.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/shell.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- shell.py	6 Mar 2005 17:39:43 -0000	1.5
+++ shell.py	7 Mar 2005 07:01:28 -0000	1.6
@@ -81,7 +81,7 @@
             pass
             
         elif cmd == 'list':
-            print self.base.listTransaction()
+            self.base.log(2,self.base.listTransaction())
         
         elif cmd == 'reset':
             self.base.closeRpmDB()
@@ -101,13 +101,25 @@
         print line
         
     def do_depsolve(self, line):
-        self.base.buildTransaction()
+        (code, msgs) = self.base.buildTransaction()
+        if code == 1:
+            for msg in msgs:
+                self.base.errorlog(0, 'Error: %s' % msg)
         
     def do_run(self, line):
         if len(self.base.tsInfo) > 0:
-            self.result = 2
-            self.resultmsgs = ['Running commands']
-            return True
-        else:
-            self.resultmsgs = ['Nothing to do']
-        
+            try:
+                self.base.doTransaction()
+            except Errors.YumBaseError, e:
+                self.base.errorlog(0, '%s' % e)
+            except KeyboardInterrupt, e:
+                self.base.errorlog(0, '\n\nExiting on user cancel')
+            except IOError, e:
+                if e.errno == 32:
+                    self.base.errorlog(0, '\n\nExiting on Broken Pipe')
+            else:
+                self.base.log(2, 'Finished Transaction')
+                self.base.closeRpmDB()
+                self.base.doTsSetup()
+                self.base.doRpmDBSetup()
+




More information about the Yum-cvs-commits mailing list