~ubuntu-branches/ubuntu/precise/cups/precise

« back to all changes in this revision

Viewing changes to debian/cups.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2011-10-21 06:26:41 UTC
  • Revision ID: james.westby@ubuntu.com-20111021062641-oj14931xjy8cbp20
Tags: 1.5.0-10
* debian/cups.postinst: Allow PPD updater trigger files in
  /usr/share/cups/ppd-updaters/ also be named <driver>.ppd-updater
  and not only simply <driver>. This makes it easier to provide these
  files in the printer driver packages.
* debian/patches/usb-backend-reset-printer-before-printing.patch: When
  using the "usb" CUPS backend, reset the printer before each job as
  otherwise on some printers subsequent jobs will come out as garbage
  (LP: #872483).

Show diffs side-by-side

added added

removed removed

Lines of Context:
261
261
                # of PPDs when the corresponding package was not changed.
262
262
                logfile=/var/cache/cups/ppd-updates
263
263
                touch $logfile
264
 
                for driver in `ls /usr/share/cups/ppd-updaters`; do
265
 
                        modtime=`ls -l --time-style=+%s /usr/share/cups/ppd-updaters/$driver | perl -p -e 's/^\s*\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s*$/$1\n/'`
 
264
                for driverfile in `ls /usr/share/cups/ppd-updaters`; do
 
265
                        driver=`echo $driverfile | perl -p -e 's/\.ppd-updater$//'`
 
266
                        modtime=`ls -l --time-style=+%s /usr/share/cups/ppd-updaters/$driverfile | perl -p -e 's/^\s*\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s*$/$1\n/'`
266
267
                        oldmodtime=`cat $logfile | grep " $driver$" | cut -d ' ' -f 1`
267
268
                        if [ "$modtime" != "$oldmodtime" ]; then
268
269
                                echo "Updating PPD files for $driver ..."
269
 
                                . /usr/share/cups/ppd-updaters/${driver}
 
270
                                . /usr/share/cups/ppd-updaters/${driverfile}
270
271
                                ppd_updater "${DRIVER_REGEXP}" "${GENNICKNAME_REGEXP}"
271
272
                                cat $logfile | grep -v " $driver$" > $logfile.new || touch $logfile.new
272
273
                                echo "$modtime $driver" >> $logfile.new