- Don't use popen2 in the foomatic PPD update script.

This commit is contained in:
Tim Waugh 2009-01-10 13:01:24 +00:00
parent 4e06115449
commit 54d76448f2
2 changed files with 11 additions and 9 deletions

View File

@ -25,7 +25,7 @@
import sys import sys
import glob import glob
import os import os
import popen2 import subprocess
import tempfile import tempfile
import cups import cups
@ -38,15 +38,14 @@ gutenprint_version = sys.argv[1]
dry_run = True dry_run = True
def generate_ppd (ppdfile, printer, driver): def generate_ppd (ppdfile, printer, driver):
(r, w) = popen2.popen2 (["foomatic-ppdfile", p = subprocess.Popen (["foomatic-ppdfile", "-p", printer, "-d", driver],
"-p", printer, stdin=file ("/dev/null"),
"-d", driver]) stdout=subprocess.PIPE,
w.close () stderr=subprocess.PIPE)
ppd = r.readlines () (ppd, stderr) = p.communicate ()
r.close ()
fname = ppdfile + ".tmp" fname = ppdfile + ".tmp"
try: try:
file(fname, "w").writelines (ppd) file(fname, "w").write (ppd)
except IOError, e: except IOError, e:
print e print e
raise raise

View File

@ -4,7 +4,7 @@
Name: gutenprint Name: gutenprint
Summary: Printer Drivers Package. Summary: Printer Drivers Package.
Version: 5.2.3 Version: 5.2.3
Release: 2%{?dist} Release: 3%{?dist}
Group: System Environment/Base Group: System Environment/Base
URL: http://gimp-print.sourceforge.net/ URL: http://gimp-print.sourceforge.net/
Source0: http://dl.sf.net/gimp-print/gutenprint-%{version}.tar.bz2 Source0: http://dl.sf.net/gimp-print/gutenprint-%{version}.tar.bz2
@ -254,6 +254,9 @@ fi
/bin/rm -f /var/cache/foomatic/* /bin/rm -f /var/cache/foomatic/*
%changelog %changelog
* Sat Jan 10 2009 Tim Waugh <twaugh@redhat.com> 5.2.3-3
- Don't use popen2 in the foomatic PPD update script.
* Thu Jan 8 2009 Tim Waugh <twaugh@redhat.com> 5.2.3-2 * Thu Jan 8 2009 Tim Waugh <twaugh@redhat.com> 5.2.3-2
- Only run the foomatic PPD update script on update, and make sure the - Only run the foomatic PPD update script on update, and make sure the
script can deal with major version upgrades (bug #478328). script can deal with major version upgrades (bug #478328).