[yum-cvs] yum cli.py,1.231,1.232

Menno Smits mjs at linux.duke.edu
Sun Sep 3 21:11:07 UTC 2006


Update of /home/groups/yum/cvs/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv2539

Modified Files:
	cli.py 
Log Message:
Fixes so that CTRL-C finally works properly:
    - rpmdb transactions are only kept open when strictly necessary so that
      SIGINT handler is left alone by rpm during downloads etc
    - added a simple interrupt_callback for package downloads. A single CTRL-C
      will push the download to the next mirror. Two quick CTRL-C's will
      terminate Yum. This needs cleaning up to not upset Yum API clients.


Index: cli.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/cli.py,v
retrieving revision 1.231
retrieving revision 1.232
diff -u -r1.231 -r1.232
--- cli.py	1 Sep 2006 19:00:07 -0000	1.231
+++ cli.py	3 Sep 2006 21:11:05 -0000	1.232
@@ -602,6 +602,11 @@
                 if po:
                     downloadpkgs.append(po)
 
+        # Close the connection to the rpmdb so that rpm doesn't hold the SIGINT
+        # handler during the downloads. self.ts is reinitialised later in this
+        # function anyway (initActionTs). 
+        self.ts.close()
+
         # Report the total download size to the user, so he/she can base
         # the answer on this info
         if stuff_to_download:
@@ -636,8 +641,6 @@
         
         testcb = callback.RPMInstallCallback(output=0)
         testcb.tsInfo = self.tsInfo
-        # clean out the ts b/c we have to give it new paths to the rpms 
-        del self.ts
         
         self.initActionTs()
         # save our dsCallback out
@@ -991,7 +994,7 @@
         
         for pkg in filelist:
             try:
-                po = YumLocalPackage(ts=self.read_ts, filename=pkg)
+                po = YumLocalPackage(ts=self.rpmdb.readOnlyTS(), filename=pkg)
             except yum.Errors.MiscError, e:
                 self.logger.critical('Cannot open file: %s. Skipping.', pkg)
                 continue




More information about the Yum-cvs-commits mailing list