Package: po-debconf
Version: 1.0.15
Tags: patch
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu ubuntu-patch intrepid

Hi!

If libmail-box-perl (which is currently a Recommends) is not installed:

$ /usr/bin/podebconf-report-po
Can't locate Mail/Box/Manager.pm in @INC (@INC contains: /etc/perl 
/usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 
/usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 
/usr/local/lib/site_perl .) at /usr/bin/podebconf-report-po line 1144.
BEGIN failed--compilation aborted at /usr/bin/podebconf-report-po line 1144.

The code is already trying to print out a better error message in this
case, it's just using "use" where it should use "import". Attached
patch fixes this:

$ /tmp/podebconf-report-po  --postpone=/tmp/xx
[...]
The --postpone and --mutt options require the perl Mail::Box package. Please 
install the Debian libmail-box-perl package if you want to use these options. 
No mail written or sent. at /tmp/podebconf-report-po line 1160, <> line 1.

The patch also drops libmail-box-perl to Suggests:, since it isn't
necessary for most things you do with po-debconf, and it pulls in a
plethora of perl modules. With the fixed failure mode from above, the
Suggests: definition matches this best, IMHO.

Thank you for considering,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
diff -Nru po-debconf-1.0.15/debian/changelog 
po-debconf-1.0.15ubuntu1/debian/changelog
--- po-debconf-1.0.15/debian/changelog  2008-06-13 01:42:44.000000000 +0200
+++ po-debconf-1.0.15ubuntu1/debian/changelog   2008-10-22 13:54:48.000000000 
+0200
@@ -1,3 +1,15 @@
+po-debconf (1.0.15ubuntu1) intrepid; urgency=low
+
+  * podebconf-report-po: Fix opportunistic import of Mail::Box::Manager, to
+    avoid crashing with an import error if libmail-box-perl is not installed.
+    Now it actually shows the "Please install libmail-box-perl" message, as
+    the code intends to. Thanks to Colin Watson for suggesting this fix!
+  * Drop libmail-box-perl to Suggests:. It is not needed for most users of
+    po-debconf, drags in lots of more packages, and with above fix the failure
+    mode of podebconf-report-po is adequate.
+
+ -- Martin Pitt <[EMAIL PROTECTED]>  Wed, 22 Oct 2008 13:52:04 +0200
+
 po-debconf (1.0.15) unstable; urgency=low
 
   [ podebconf-display-po ]
diff -Nru po-debconf-1.0.15/debian/control 
po-debconf-1.0.15ubuntu1/debian/control
--- po-debconf-1.0.15/debian/control    2008-06-13 01:41:23.000000000 +0200
+++ po-debconf-1.0.15ubuntu1/debian/control     2008-10-22 13:54:57.000000000 
+0200
@@ -9,7 +10,8 @@
 Package: po-debconf
 Architecture: all
 Depends: perl, gettext (>= 0.16), intltool-debian (>= 0.34.2+20060512)
-Recommends: libmail-sendmail-perl, libcompress-zlib-perl, libmail-box-perl
+Recommends: libmail-sendmail-perl, libcompress-zlib-perl
+Suggests: libmail-box-perl
 Description: manage translated Debconf templates files with gettext
  This package is an alternative to debconf-utils and provide tools
  to manage translated Debconf templates files with common gettext
diff -Nru po-debconf-1.0.15/podebconf-report-po 
po-debconf-1.0.15ubuntu1/podebconf-report-po
--- po-debconf-1.0.15/podebconf-report-po       2008-05-20 23:38:06.000000000 
+0200
+++ po-debconf-1.0.15ubuntu1/podebconf-report-po        2008-10-22 
13:50:46.000000000 +0200
@@ -1141,7 +1141,7 @@
 sub Postpone {
        my $mail = shift;
        if (eval { require Mail::Box::Manager }) {
-               use Mail::Box::Manager;
+               import Mail::Box::Manager;
                my $mgr = new Mail::Box::Manager;
 
                my $folder = $mgr->open(folder => $MBOX, access => 'a');

Attachment: signature.asc
Description: Digital signature

Reply via email to