Your message dated Mon, 29 Jun 2009 10:47:05 +0000
with message-id <[email protected]>
and subject line Bug#509518: fixed in cups-pdf 2.5.0-4
has caused the Debian Bug report #509518,
regarding cups-pdf: please merge Ubuntu changes to automatically add the PDF 
queue
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
509518: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509518
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cups-pdf
Version: 2.4.8-4
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu intrepid ubuntu-patch

We applied these changes in Ubuntu and thought you might consider doing the 
same:
Sometime due to restart/configuration race condition the PDF-printer (queue) is 
not created
We have modified the postinstall so that it no longer restarts cups and 
installs a pdf queue and printer.
Patches are attached.

*** /tmp/tmpowFKGE
In Ubuntu, we've applied the attached patch to achieve the following:

  * Merge from debian unstable (LP: #310290), remaining changes:
    - debian/postinst, debian/prerm: Let PDF print queue being created
      automatically when installing the package and being removed
      automatically when uninstalling the package.
    - debian/postinst: Updated PPD file name to the new one used by the
      upstream package (LP: #241701). Updated the name of the CUPS startup
      script to "cups".

We thought you might be interested in doing the same. 


-- System Information:
Debian Release: lenny/sid
  APT prefers intrepid-updates
  APT policy: (500, 'intrepid-updates'), (500, 'intrepid-security'), (500, 
'intrepid-backports'), (500, 'intrepid')
Architecture: i386 (i686)

Kernel: Linux 2.6.27-9-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u cups-pdf-2.4.8/debian/changelog cups-pdf-2.4.8/debian/changelog
diff -u cups-pdf-2.4.8/debian/postinst cups-pdf-2.4.8/debian/postinst
--- cups-pdf-2.4.8/debian/postinst
+++ cups-pdf-2.4.8/debian/postinst
@@ -14,9 +14,81 @@
                chown nobody:nogroup /var/spool/cups-pdf/ANONYMOUS
                chmod 1777 /var/spool/cups-pdf/ANONYMOUS
                chmod 0700 /usr/lib/cups/backend/cups-pdf
+               # This package needs the CUPS daemon running to actually work
                if [ -f /etc/init.d/cups ]
                then
-                       invoke-rc.d cups force-reload || invoke-rc.d cups start 
|| /bin/true
+                       lpstat -r > /dev/null 2>&1 || invoke-rc.d cups start || 
/bin/true
+               fi
+               if lpstat -r > /dev/null 2>&1
+               then
+                       # Create a PDF CUPS queue if we have none yet (only
+                       # if CUPS daemon is running)
+                       if [ -z "`LC_ALL=C lpstat -v 2>/dev/null | grep 
'cups-pdf:/'`" ]
+                       then
+                               # Find a name for the PDF queue
+                               queue=PDF
+                               number=0
+                               while LC_ALL=C lpstat -v 2>/dev/null | cut -d 
':' -f 1 | cut -d ' ' -f 3 | grep -q ^$queue\$
+                               do
+                                       number=$(($number + 1))
+                                       queue="PDF$number"
+                               done
+                               # Find system's default paper size
+                               size="`LC_ALL=C paperconf 2>/dev/null`" || 
size=a4
+                               # Create the queue
+                               lpadmin -h localhost -p $queue -E -v cups-pdf:/ 
-m lsb/usr/cups-pdf/CUPS-PDF.ppd -o printer-is-shared=no -o PageSize=$size 
2>/dev/null || :
+                               # Set the PDF printer as default when there is 
not
+                               # already a default printer
+                               #if [ -z "`LC_ALL=C lpstat -d 2>/dev/null | 
grep 'system default destination:'`" ]
+                               #then
+                               #       lpadmin -d $queue 2>/dev/null || :
+                               #fi
+                       fi
+               else
+                       # Create a PDF CUPS queue if we have none yet (for the
+                       # case that CUPS is not running or even not installed)
+                       if [ -z "`grep 'DeviceURI cups-pdf:/' 
/etc/cups/printers.conf 2> /dev/null`" ]
+                       then
+                               # Find a name for the PDF queue
+                               queue=PDF
+                               number=0
+                               while grep -q "Printer $queue>" 
/etc/cups/printers.conf
+                               do
+                                       number=$(($number + 1))
+                                       queue="PDF$number"
+                               done
+                               # Find system's default paper size
+                               size="`LC_ALL=C paperconf 2>/dev/null`" || 
size=a4
+                               # Create the queue
+                               time=`date +%s`
+                               mkdir -p /etc/cups/ppd
+                               cat << EOF >> /etc/cups/printers.conf
+<Printer $queue>
+Info Print into PDF file
+DeviceURI cups-pdf:/
+State Idle
+StateTime $time
+Accepting Yes
+Shared No
+JobSheets none none
+QuotaPeriod 0
+PageLimit 0
+KLimit 0
+OpPolicy default
+ErrorPolicy retry-job
+</Printer>
+EOF
+                               cp /usr/share/ppd/cups-pdf/CUPS-PDF.ppd 
/etc/cups/ppd/$queue.ppd
+                               ucsize=`echo $size | perl -p -e 
's/^(\S)(\S*)/uc($1) . $2/e'`
+                               perl -p -i -e 
's/^(\*DefaultPageSize:\s*)\S+/$1'$ucsize'/' /etc/cups/ppd/$queue.ppd
+                               perl -p -i -e 
's/^(\*DefaultPageRegion:\s*)\S+/$1'$ucsize'/' /etc/cups/ppd/$queue.ppd
+                               perl -p -i -e 
's/^(\*DefaultImageableArea:\s*)\S+/$1'$ucsize'/' /etc/cups/ppd/$queue.ppd
+                               perl -p -i -e 
's/^(\*DefaultPaperDimension:\s*)\S+/$1'$ucsize'/' /etc/cups/ppd/$queue.ppd
+                               if [ -f /etc/init.d/cups ]
+                               then
+                                   lpstat -r > /dev/null 2>&1 || invoke-rc.d 
cups start || /bin/true
+                               fi
+                       fi
                fi
        ;;
 
diff -u cups-pdf-2.4.8/debian/postrm cups-pdf-2.4.8/debian/postrm
--- cups-pdf-2.4.8/debian/postrm
+++ cups-pdf-2.4.8/debian/postrm
@@ -13,10 +13,6 @@
                then
                        rm -rf /var/spool/cups-pdf
                fi
-               if [ -f /etc/init.d/cups ]
-               then
-                       invoke-rc.d cups force-reload || invoke-rc.d cups start 
|| /bin/true
-               fi
        ;;
 
        abort-upgrade|upgrade|failed-upgrade|remove|disappear)
only in patch2:
unchanged:
--- cups-pdf-2.4.8.orig/debian/prerm
+++ cups-pdf-2.4.8/debian/prerm
@@ -0,0 +1,29 @@
+#! /bin/sh
+# prerm script for cups-pdf
+
+set -e
+
+case "$1" in
+       remove)
+               # Remove all PDF queues (only if CUPS daemon is running)
+               if `lpstat -r > /dev/null 2>&1`
+               then
+                       for queue in `LC_ALL=C lpstat -v 2>/dev/null | grep 
'cups-pdf:/' | cut -d ':' -f 1 | cut -d ' ' -f 3`
+                       do
+                               lpadmin -x $queue 2>/dev/null || :
+                       done
+               fi
+               ;;
+       upgrade|deconfigure)
+               ;;
+       failed-upgrade)
+               ;;
+       *)
+               echo "prerm called with unknown argument \`$1'" >&2
+               exit 1
+               ;;
+esac
+
+#DEBHELPER#
+
+exit 0

--- End Message ---
--- Begin Message ---
Source: cups-pdf
Source-Version: 2.5.0-4

We believe that the bug you reported is fixed in the latest version of
cups-pdf, which is due to be installed in the Debian FTP archive:

cups-pdf_2.5.0-4.diff.gz
  to pool/main/c/cups-pdf/cups-pdf_2.5.0-4.diff.gz
cups-pdf_2.5.0-4.dsc
  to pool/main/c/cups-pdf/cups-pdf_2.5.0-4.dsc
cups-pdf_2.5.0-4_amd64.deb
  to pool/main/c/cups-pdf/cups-pdf_2.5.0-4_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin-Éric Racine <[email protected]> (supplier of updated cups-pdf package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Format: 1.8
Date: Sun, 28 Jun 2009 13:35:39 +0300
Source: cups-pdf
Binary: cups-pdf
Architecture: source amd64
Version: 2.5.0-4
Distribution: unstable
Urgency: low
Maintainer: Debian CUPS Maintainers <[email protected]>
Changed-By: Martin-Éric Racine <[email protected]>
Description: 
 cups-pdf   - PDF printer for CUPS
Closes: 509518 510882
Changes: 
 cups-pdf (2.5.0-4) unstable; urgency=low
 .
   * Merged changes from Ubuntu (Closes: #509518, #510882):
     + Apport hooks.
     + Pass PDF files without modification (LP: #385709).
     + Automatic PDF queue addition (postinst) and removal (prerm).
     NOT merged: upgrading of existing PDF queues; Depends: perl.
   * Bumped Standards-Version to 3.8.2 (no change required).
Checksums-Sha1: 
 12b98fa0c33def7ca20ffcce602284673cd8c3aa 1087 cups-pdf_2.5.0-4.dsc
 bc8d94eb706c1b9b9bcadc07c9818473a81b7562 11141 cups-pdf_2.5.0-4.diff.gz
 628bdf0e4d44589e72cdae599e827f862c67d6d1 44824 cups-pdf_2.5.0-4_amd64.deb
Checksums-Sha256: 
 cac1ed8ce8e6d3fa925bc575f0d07fe5d497870eb9a6d3051352d21757fff078 1087 
cups-pdf_2.5.0-4.dsc
 7389a31f8d256215784a23d72ea72e5a5c779fad1d97269c8951fda5604f85e6 11141 
cups-pdf_2.5.0-4.diff.gz
 ab0a78620887e4df50b105faa88ab6963a5268d2d43bd2cf0aa61eace3d67d45 44824 
cups-pdf_2.5.0-4_amd64.deb
Files: 
 9741e60e541881f65d90ed51bf39543d 1087 graphics optional cups-pdf_2.5.0-4.dsc
 1437b4d0a5aba58805e6883de1cfc82d 11141 graphics optional 
cups-pdf_2.5.0-4.diff.gz
 8b45c16a599291914ef61fa464db1fe3 44824 graphics optional 
cups-pdf_2.5.0-4_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEAREDAAYFAkpIl4sACgkQQKW+7XLQPLHwvQCePOfeWxo9TQSza2FzFmzViPeb
xrUAoOQYUDoNRa1N227DbctGoDyHFhxJ
=0/Q+
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to