# let's have this on both
reassign 279232 perl,doc-base
thanks

On Wed, May 04, 2005 at 09:25:06PM +1000, Brendan O'Dea wrote:
> On Fri, Apr 08, 2005 at 08:36:05AM +0200, Henning Glawe wrote:
> >it could be "fixed" by introducing a versioned pre-dependency of 
> >perl-modules on perl-base while letting perl-base conflict with too old
> >perl-modules, which forces apt to update both packages together; this
> >combination may be highly unstable (conflicts+pre-depends is a loop-like
> >construct), but results in the right behaviour.
> 
> Given an alternate option I'd really rather not do this.  It seems
> fragile at best, disasterous at worst.

I would be terrified of accepting a change like this into sarge. It
seems to me that it would have very complex and probably undesirable
effects on upgrades, causing large swathes of packages to be
deconfigured.

> Given the recent freeze announcement, I'd suggest that regardless of
> what other fixes are made, a good first step would be to get a fixed
> doc-base (i.e. one that works with the current stable perl-base only)
> package into stable-proposed-updates *now*.
> 
> If nothing else, this reduces the size of the problem if there's a point
> release prior to sarge.

I agree. Also, having a doc-base in sarge that's fixed in the way you
describe means that we shouldn't have this particular incarnation of the
problem again, and it would mean that at least we could tell people in
the release notes to upgrade doc-base first. I think that would be
acceptable as far as sarge is concerned.

On Fri, 29 Apr 2005 at 11:11:38PM +0200, Frank Lichtenheld wrote:
> On Fri, Apr 29, 2005 at 02:03:23PM -0500, Bill Allombert wrote:
> > install-docs should be shipped not executable in  doc-base .deb and
> > doc-base postinst should a+x it. (and prerm should a-x it).
> 
> This wouldn't help. doc-base doesn't need to be touched at all for the
> bug to appear. Perl gets itself in a non-working state...

You've said this a couple of times, but I don't think that's true at
all. Everything here seems to be working exactly the way it's been told
to work, and certainly perl appears to be doing nothing wrong.

/usr/bin/perl is working just fine (it's essential, and works even when
unconfigured the way it's supposed to). All modules in perl-base work
fine too. However, File::Basename is in perl-modules, which is not
essential, and therefore in order to ensure that it is usable you *must*
declare a dependency on it (or just on perl, as would be more usual).
This is all perfectly normal and in accordance with policy.

The problem is that the packages that call install-docs do so
opportunistically (only if it's available), and so they do not declare a
dependency on perl or doc-base. Thus, there is *no way* for them to make
sure that install-docs is actually usable; it may be unpacked but not
configured. Once the doc-base package enters the configured state, dpkg
will have made sure that perl is configured too (as per the definition
of Depends) and so install-docs will work fine. Bill's suggestion would
therefore fix this bug, although I haven't quite decided whether it's
more complicated than just making doc-base work with only essential
packages. I could go either way.

The following patch to doc-base avoids the use of File::Basename, so it
should work with only perl-base. I've tested the substituted functions
independently, but I have not yet tested the resulting package. Caveat
emptor. Bill's suggestion should definitely be tried out too, since it
would probably involve less code.

diff -Nru /tmp/At5JVh70EG/doc-base-0.7.18/debian/changelog 
/tmp/KqzthCt2IB/doc-base-0.7.18.1/debian/changelog
--- /tmp/At5JVh70EG/doc-base-0.7.18/debian/changelog    2003-03-30 
18:14:12.000000000 +0100
+++ /tmp/KqzthCt2IB/doc-base-0.7.18.1/debian/changelog  2005-05-07 
14:49:49.000000000 +0100
@@ -1,3 +1,11 @@
+doc-base (0.7.18.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Avoid File::Basename, in order to work even when perl is unconfigured
+    (closes: #278495).
+
+ -- Colin Watson <[EMAIL PROTECTED]>  Sat,  7 May 2005 14:49:47 +0100
+
 doc-base (0.7.18) unstable; urgency=low
 
   * postinst: don't die if /usr/lib/menu doesn't exist; closes: #186707
diff -Nru /tmp/At5JVh70EG/doc-base-0.7.18/install-docs 
/tmp/KqzthCt2IB/doc-base-0.7.18.1/install-docs
--- /tmp/At5JVh70EG/doc-base-0.7.18/install-docs        2003-03-15 
22:08:38.000000000 +0000
+++ /tmp/KqzthCt2IB/doc-base-0.7.18.1/install-docs      2005-05-07 
14:49:45.000000000 +0100
@@ -16,7 +16,28 @@
 
 # ---end-of-configuration-part---
 
-use File::Basename;
+# This would normally be just 'use File::Basename;'. However, install-docs
+# often gets called opportunistically by packages if it's present, and
+# there's no way for those packages to make sure that perl is configured
+# when doing so, so it's possible that standard modules will not be usable.
+
+sub basename {
+  (my $basename = $_[0]) =~ s#.*/##s;
+  return $basename;
+}
+
+sub dirname {
+  my ($dirname, $basename) = ($_[0] =~ m#^(.*/)?(.*)#s);
+  $dirname = './' if not defined $dirname or $dirname eq '';
+  $dirname =~ s#(.)/*\z#$1#s;
+  unless (length $basename) {
+    ($dirname) = ($dirname =~ m#^(.*/)?#s);
+    $dirname = './' if not defined $dirname or $dirname eq '';
+    $dirname =~ s#(.)/*\z#$1#s;
+  }
+  return $dirname;
+}
+
 # set umask explicitly
 umask 022;
 

Long-term, it would be nice if there were a way for a package to have a
simple way to test whether another package is configured, to supersede
all these 'test -x' calls; perhaps a trivial wrapper around dpkg-query
provided by dpkg in order that everyone does it the same way.

Cheers,

-- 
Colin Watson                                       [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to