SRU: hand-picked packaging fixes for Lucid, Maverick, and Natty

Bug #805947 reported by Martin-Éric Racine on 2011-07-05
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cups-pdf (Ubuntu)
High
Unassigned
Lucid
High
Unassigned
Maverick
Low
Unassigned
Natty
High
Unassigned

Bug Description

Here's an SRU proposal to merge selected packaging fixes (maintainer scripts, etc.) that were brought to CUPS-PDF after Lucid and Maverick were released. The debdiffs for both are attached.

Martin-Éric Racine (q-funk) wrote :
Martin-Éric Racine (q-funk) wrote :
tags: added: patch
Martin-Éric Racine (q-funk) wrote :

Pushed into Lucid-proposed and Maverick-proposed.

Martin-Éric Racine (q-funk) wrote :

...which were apparently rejected, for some reason.

Martin-Éric Racine (q-funk) wrote :

cups-pdf_2.5.0-17squeeze1~maverick1.dsc and cups-pdf_2.5.0-17squeeze1~lucid1.dsc respectively.

Martin-Éric Racine (q-funk) wrote :

cups-pdf (2.5.0-17squeeze1) stable-security; urgency=low

  * Hand-picked fixes from 2.5.1 packaging:
    + Remove the superfluous -E option to the queue creation loop in [postinst].
      This was unnecessary to access localhost plus it sometimes makes automated
      installs fail. (Closes: #614713,#539156).
    + Implemented a CUPS queue purging loop in [postrm] to remove all traces of
      CUPS-PDF in the CUPS configuration after a package purge. (LP: #573667)
    + Enforced -h localhost usage in [prerm] for [postinst/postrm] consistency.
    + Bumped Standards-Version to 3.9.2 (no change required).
  * Reverted LFS support from 2.5.0-17 in [debian/rules] since it never made it
    to any stable distro. It remains in 2.5.1 releases for those who need it.

Accepted cups-pdf into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in cups-pdf (Ubuntu Lucid):
status: New → Fix Committed
tags: added: verification-needed
tags: added: verification-done
removed: verification-needed

This was simply a tracker bug; there's no need for verification here.

Changed in cups-pdf (Ubuntu Maverick):
status: New → Fix Committed
tags: removed: verification-done
tags: added: verification-needed

Accepted cups-pdf into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-done
removed: verification-needed

Fewer packaging fixes are required to bring Natty up to par. diff attached.

Hello Martin-Éric, or anyone else affected,

Accepted cups-pdf into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in cups-pdf (Ubuntu Natty):
status: New → Fix Committed
tags: removed: verification-done
tags: added: verification-needed
Changed in cups-pdf (Ubuntu):
status: New → Fix Released

I have tested on Natty now and for me the PDF queue does NOT get generated. The problem is that CUPS gets restarted and immediately afterwards it is tried to create a queue using the commands "lpstat" and "lpadmin". The daemon needs a little time until it listens to requests and so these "lpstat" and "lpadmin" commands error out as CUPS is not yet listening. Using "2> /dev/null" and " || :" these errors stay invisible.

In all maintainer scripts, for creating the queue and updating the PPD after installation and for removing the queue on purge a wait loop needs to be added right before the code sections which use "lpstat" and "lpadmin".

In addition, the newly created queue is disabled and not accepting jobs. Either "-E" needs to be added to "lpadmin" (it was not the culprit for the queue not being created) or "cupsenable" and "cupsaccept" have to be used with the new queue.

An example for such a wait loop is attached as a patch for the post-install script in Natty.

The problem is present in all Ubuntu versions. Reopening ...

Changed in cups-pdf (Ubuntu Lucid):
status: Fix Committed → Triaged
Changed in cups-pdf (Ubuntu Maverick):
status: Fix Committed → Triaged
Changed in cups-pdf (Ubuntu Natty):
status: Fix Committed → Triaged
Changed in cups-pdf (Ubuntu):
status: Fix Released → Triaged
milestone: none → ubuntu-11.10-beta-2
Changed in cups-pdf (Ubuntu):
importance: Undecided → High
Changed in cups-pdf (Ubuntu Lucid):
importance: Undecided → High
Changed in cups-pdf (Ubuntu Maverick):
importance: Undecided → Low
Changed in cups-pdf (Ubuntu Natty):
importance: Undecided → High
tags: added: verification-failed
removed: verification-needed
Martin-Éric Racine (q-funk) wrote :

Adding a wait loop might be a nice extra safeguard, so I could consider adding it, because safeguards are always a good idea.

Adding cupsenable or cupsaccepted seems like a much better idea, though, IMHO.

However, the problem with queue creation has been confirmed to be caused by the unnecessary -E that used to be present in one lpadmin stanza in postinst. All other occurences of lpadmin that did not use -E always worked as intended.

Martin-Éric Racine (q-funk) wrote :

I'm curious, at which step in postinst would you insert cuspaccept or cupsenable?

summary: - SRU: hand-picked packaging fixes for Lucid and Maverick
+ SRU: hand-picked packaging fixes for Lucid, Maverick, and Natty

First, probably the -E in the lpadmin command line was misplaced. It seems that when it is used before -p <printer> that it forces encryption, which makes lpadmin fail on some configurations. Used after -p <printer>, it enables the queue and makes it accepting jobs (see also the man page of lpadmin).

Second, cuspaccept and cupsenable are commands treating a particular queue, which has to exist and also has to get specified. So you have to add the following two lines AFTER the lpadmin command which creates the queue:

echo | cupsenable -h localhost $queue || :
echo | cupsaccept -h localhost $queue || :

Third, the wait loop is essentially important, as I do not get a queue without it and I get a queue reliably with the loop.

Martin-Éric Racine (q-funk) wrote :

Thanks for the advice on where to insert cupsenable and cupsaccept steps.

As for encryption, I still don't see why we need to force its usage, especially given how we'll be manipulating localhost at all steps.

Encryption is not needed at all, so do not use -E at any place and use cupsenable and cupsaccept. This assures best compatibility with all possible CUPS configurations.

Martin-Éric Racine (q-funk) wrote :

Here's the debdiff for Natty.

Looks OK for me.

Disabling and rejecting the queue before removing it is not actually needed but it also does not break anything.

Martin-Éric Racine (q-funk) wrote :

Uploaded and waiting for approval.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups-pdf - 2.5.1-5

---------------
cups-pdf (2.5.1-5) unstable; urgency=low

  * Modified the force-reload loop in [postinst|prerm|postrm] to end with ||:
    rather than with ||true for consistency with other maintainer commands.
  * Added a wait loop in [postinst|prerm|postrm] to ensure that CUPS reloaded.
  * Added 'cupsenable' and 'cupsaccept' steps in [postinst] to ensure that
    the PDF queue is up and running before we can manipulate it. (LP: #805947)
  * Added 'cupsdisable' and 'cupsreject' steps in [prerm|postrm] to match.
  * Refreshed all patches using the .quiltrc from Chapter 3.1 of the NM Guide.
 -- Martin-Eric Racine <email address hidden> Tue, 13 Sep 2011 16:15:49 +0300

Changed in cups-pdf (Ubuntu):
status: Triaged → Fix Released
Martin-Éric Racine (q-funk) wrote :

Still waiting on the approval of 2.5.1-3~natty3 for natty-proposed.

I have reviewed the debdiff for the version uploaded to natty-proposed and all seems to be correct there. Please approve this package.

Chris Halse Rogers (raof) wrote :

There are now two cups-pdf uploads in the Natty unapproved queue; ~natty2 and ~natty3.

~natty3 appears to contain the changes from ~natty2, but the changes file doesn't contain both revisions.

I've rejected both from the unapproved queue. Could you please upload a package versioned ~natty2 with the ~natty2 and ~natty3 changelogs folded into a single entry?

Alternatively you could re-upload the existing ~natty3 package but with the changes file containing both ~natty2 and ~natty3 changelog entries. However, since ~natty2 has never been released into an archive I'd prefer it to be versioned just ~natty2.

Changed in cups-pdf (Ubuntu Natty):
status: Triaged → Incomplete

Hello Martin-Éric, or anyone else affected,

Accepted cups-pdf into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in cups-pdf (Ubuntu Natty):
status: Incomplete → Fix Committed
tags: removed: verification-failed
tags: added: verification-needed
Martin-Éric Racine (q-funk) wrote :

Here's a debdiff against what's in Lucid-proposed and Maverick-proposed of what I would propose for Lucid and Maverick, based on the feedback that produced the consolidated diff for Natty.

I'd obviously append a changelog entries called 2.5.0-17squeeze2~lucid1 and 2.5.0-17squeeze2~maverick1 for the upload.

Feedback on whether a consolidated diff would be preferred and in what shape is welcome.

For me the PDF printer of cups-pdf works in Natty. It gets correctly set up with A4 as default when installing and correctly removed when uninstalling the package, the PPD is also correct (so it updated when I got the package with my updates). Everything perfect.

tags: added: verification-done
removed: verification-needed

The queue creation and removal in your debdiff for Lucid and Maverick is OK. No I do not remember when exactly I introduced the automatic PPD updating (look into the debian/changelog of packages like hplip or foomatic-db). In distributions which have this functionality, cups-pdf should offer it, too. Simply use the same code in postinst as you are using in Natty.

Martin-Éric Racine (q-funk) wrote :

PPD updating was introduced in CUPS 1.5.0-3 as a standard feature.

I've added the manual code to Natty to cover for updates from previous releases, which had a different PPD.

Releases older than that don't need any PPD updating since the've had the same one forever.

Then it is OK, upload it this way.

Martin-Éric Racine (q-funk) wrote :

Uploaded as 2.5.0-17ubuntu1~lucid1 and 2.5.0-17ubuntu1~maverick1 respectively.

Martin-Éric Racine (q-funk) wrote :

The Natty package seems to perform as expected on my Ubuntu/stable host.

Awaiting the -proposed approval to test the Lucid package. Since the -proposed package for Maverick is exactly the same, one can assume that whoever tests either one would get equivalent results, so if my tests on Lucid are conclusive, they would also be conclusive on Maverick.

Martin-Éric Racine (q-funk) wrote :

As confirmed in bug #836278, natty-proposed is verified.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups-pdf - 2.5.1-3~natty2

---------------
cups-pdf (2.5.1-3~natty2) natty-proposed; urgency=medium

  * Added a step in [postinst] to ensure that CUPS has successfully reloaded.
  * Added 'cupsenable' and 'cupsaccept' steps in [postinst] to ensure that
    the PDF queue is up and running before we can manipulate it. (LP: #805947)
  * Borrowed PPD upgrading code from "pxljr" to recover from upgrades
    from 2.5.0 releases (LP: #836278). Thanks to Till Kamppeter.
    NOTE: not needed for releases before or after Natty.
 -- Martin-Eric Racine <email address hidden> Thu, 22 Sep 2011 06:35:04 +0300

Changed in cups-pdf (Ubuntu Natty):
status: Fix Committed → Fix Released
Martin-Éric Racine (q-funk) wrote :

SRU team:

We still need 2.5.0-17ubuntu1~lucid1 and 2.5.0-17ubuntu1~maverick1 to be build for lucid-proposed and maverick-proposed, respectively, so that they can be tested.

Martin Pitt (pitti) wrote :

Hello Martin-Éric, or anyone else affected,

Accepted cups-pdf into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in cups-pdf (Ubuntu Lucid):
status: Triaged → Fix Committed
tags: removed: verification-done
tags: added: verification-needed
Changed in cups-pdf (Ubuntu Maverick):
status: Triaged → Fix Committed
Martin Pitt (pitti) wrote :

Hello Martin-Éric, or anyone else affected,

Accepted cups-pdf into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Martin-Éric Racine (q-funk) wrote :

According to bug #573667 verification is done on Lucid.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups-pdf - 2.5.0-17ubuntu1~lucid1

---------------
cups-pdf (2.5.0-17ubuntu1~lucid1) lucid-proposed; urgency=low

  * Maintenance release to the 2.5.0 branch for Ubuntu Lucid and Maverick.
    Backports many maintainer script features to foolproof the installation
    and removal processes, per feedback from Martin Pitt and Till Kamppeter.
  * Hand-picked fixes from 2.5.1-5 and 2.5.1-7 packaging:
    + Modified the force-reload loop in [postinst|prerm|postrm] to end with ||:
      rather than with ||true for consistency with other maintainer commands.
    + Added a wait loop in [postinst|prerm|postrm] to ensure that CUPS reloaded.
    + Added 'cupsenable' and 'cupsaccept' steps in [postinst] to ensure that
      the PDF queue is up and running before we can manipulate it. (LP: #805947)
    + Added 'cupsdisable' and 'cupsreject' steps in [prerm|postrm] to match.
  * Hand-picked fixes from 2.5.1-3 packaging:
    + Remove the superfluous -E option to the queue creation loop in [postinst].
      This was unnecessary to access localhost plus it sometimes makes automated
      installs fail. (Closes: #614713,#539156).
    + Implemented a CUPS queue purging loop in [postrm] to remove all traces of
      CUPS-PDF in the CUPS configuration after a package purge. (LP: #573667)
    + Enforced -h localhost usage in [prerm] for [postinst/postrm] consistency.
    + Bumped Standards-Version to 3.9.2 (no change required).
  * Reverted LFS support from 2.5.0-17 in [debian/rules] since it never made it
    to any stable distro. It remains in the 2.5.1 branch for those who need it.
 -- Martin-Eric Racine <email address hidden> Sun, 25 Sep 2011 13:58:30 +0300

Changed in cups-pdf (Ubuntu Lucid):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups-pdf - 2.5.0-17ubuntu1~maverick1

---------------
cups-pdf (2.5.0-17ubuntu1~maverick1) maverick-proposed; urgency=low

  * Maintenance release to the 2.5.0 branch for Ubuntu Lucid and Maverick.
    Backports many maintainer script features to foolproof the installation
    and removal processes, per feedback from Martin Pitt and Till Kamppeter.
  * Hand-picked fixes from 2.5.1-5 and 2.5.1-7 packaging:
    + Modified the force-reload loop in [postinst|prerm|postrm] to end with ||:
      rather than with ||true for consistency with other maintainer commands.
    + Added a wait loop in [postinst|prerm|postrm] to ensure that CUPS reloaded.
    + Added 'cupsenable' and 'cupsaccept' steps in [postinst] to ensure that
      the PDF queue is up and running before we can manipulate it. (LP: #805947)
    + Added 'cupsdisable' and 'cupsreject' steps in [prerm|postrm] to match.
  * Hand-picked fixes from 2.5.1-3 packaging:
    + Remove the superfluous -E option to the queue creation loop in [postinst].
      This was unnecessary to access localhost plus it sometimes makes automated
      installs fail. (Closes: #614713,#539156).
    + Implemented a CUPS queue purging loop in [postrm] to remove all traces of
      CUPS-PDF in the CUPS configuration after a package purge. (LP: #573667)
    + Enforced -h localhost usage in [prerm] for [postinst/postrm] consistency.
    + Bumped Standards-Version to 3.9.2 (no change required).
  * Reverted LFS support from 2.5.0-17 in [debian/rules] since it never made it
    to any stable distro. It remains in the 2.5.1 branch for those who need it.
 -- Martin-Eric Racine <email address hidden> Sun, 25 Sep 2011 13:58:30 +0300

Changed in cups-pdf (Ubuntu Maverick):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers