- Only run the foomatic PPD update script on update, and make sure the

script can deal with major version upgrades (bug #478328).
This commit is contained in:
Tim Waugh 2009-01-08 16:18:46 +00:00
parent 20107afb30
commit 4e06115449
2 changed files with 18 additions and 5 deletions

View File

@ -5,8 +5,8 @@
## A utility for updating foomatic-generated PPDs so that they work with ## A utility for updating foomatic-generated PPDs so that they work with
## a newly-installed gutenprint package. ## a newly-installed gutenprint package.
## Copyright (C) 2007 Red Hat, Inc. ## Copyright (C) 2007, 2009 Red Hat, Inc.
## Copyright (C) 2007 Tim Waugh <twaugh@redhat.com ## Copyright (C) 2007, 2009 Tim Waugh <twaugh@redhat.com
## This program is free software; you can redistribute it and/or modify ## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
@ -93,8 +93,15 @@ def update_ppdfile (ppdfile):
return return
# Needs updating. # Needs updating.
firstdot = gutenprint_version.find ('.')
seconddot = firstdot + 1 + gutenprint_version[1 + firstdot:].find ('.')
major = gutenprint_version[:seconddot]
driver = IDs[1]
dot = driver.find ('.')
driver = driver[:dot] + "." + major
try: try:
genppd = generate_ppd (ppdfile, IDs[0], IDs[1]) genppd = generate_ppd (ppdfile, IDs[0], driver)
except: except:
return return

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: 1%{?dist} Release: 2%{?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
@ -246,12 +246,18 @@ exit 0
%post foomatic %post foomatic
/bin/rm -f /var/cache/foomatic/* /bin/rm -f /var/cache/foomatic/*
%{_sbindir}/gutenprint-foomaticppdupdate %{version} || : if [ $1 -eq 2 ]; then
%{_sbindir}/gutenprint-foomaticppdupdate %{version} || :
fi
%postun foomatic %postun foomatic
/bin/rm -f /var/cache/foomatic/* /bin/rm -f /var/cache/foomatic/*
%changelog %changelog
* 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
script can deal with major version upgrades (bug #478328).
* Tue Dec 23 2008 Tim Waugh <twaugh@redhat.com> 5.2.3-1 * Tue Dec 23 2008 Tim Waugh <twaugh@redhat.com> 5.2.3-1
- 5.2.3. - 5.2.3.