teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.8.0-psdriver-more-fixes.patch

Panu Matilainen 6b08a4
--- rpm-4.8.0/scripts/postscriptdriver.prov	2010-02-05 15:40:34.451050057 +0000
Panu Matilainen 6b08a4
+++ rpm-4.8.0/scripts/postscriptdriver.prov~	2010-02-05 15:44:10.141926520 +0000
Panu Matilainen 6b08a4
@@ -196,9 +196,15 @@ class DrvDriver(PPDDriver):
Panu Matilainen 6b08a4
                  self.drv ]
Panu Matilainen 6b08a4
 
Panu Matilainen 6b08a4
         signal.alarm (60)
Panu Matilainen 6b08a4
-        p = subprocess.Popen (argv,
Panu Matilainen 6b08a4
-                              stdout=subprocess.PIPE,
Panu Matilainen 6b08a4
-                              stderr=subprocess.PIPE)
Panu Matilainen 6b08a4
+        try:
Panu Matilainen 6b08a4
+            p = subprocess.Popen (argv,
Panu Matilainen 6b08a4
+                                  stdout=subprocess.PIPE,
Panu Matilainen 6b08a4
+                                  stderr=subprocess.PIPE)
Panu Matilainen 6b08a4
+        except OSError:
Panu Matilainen 6b08a4
+            # ppdc not available.
Panu Matilainen 6b08a4
+            os.rmdir (outputdir)
Panu Matilainen 6b08a4
+            return Driver.list (self)
Panu Matilainen 6b08a4
+
Panu Matilainen 6b08a4
         try:
Panu Matilainen 6b08a4
             (stdout, stderr) = p.communicate ()
Panu Matilainen 6b08a4
             signal.alarm (0)
Panu Matilainen 6b08a4
@@ -230,7 +236,7 @@ class TagBuilder:
Panu Matilainen 6b08a4
                     self.ids += DynamicDriver (path).list ()
Panu Matilainen 6b08a4
                 except TimedOut:
Panu Matilainen 6b08a4
                     pass
Panu Matilainen 6b08a4
-                except OSError, e:
Panu Matilainen 6b08a4
+                except OSError, (e, s):
Panu Matilainen 6b08a4
                     if e == errno.EACCES or e == errno.ENOENT:
Panu Matilainen 6b08a4
                         # Not executable
Panu Matilainen 6b08a4
                         pass