tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Proposed fix for long-standing +CONTENTS bug

For many years people have run into a mysterious issue where upgrades
would fail with an error along the lines of:

  pkg_add: Can't open +CONTENTS of depending package p5-Net-SSLeay-1.85nb1
  pkg_add: 1 package addition failed

We have at least 3 bug reports open for it (joyent/pkgsrc#158,
joyent/pkgsrc#190, joyent/pkgsrc#256), and grepping across chat logs
shows many more instances of complaints.  It's possible to recover
from this situation, but it's an annoying task of going around fixing
up a bunch of +CONTENTS files manually.

I've tried to reproduce this for quite a long time with stress tests
to no avail, but finally today something clicked along with spotting
this error associated with it earlier in the upgrade process:

  pkg_add: Dependency of p5-Net-SSLeay-1.85nb1 fulfilled by perl-5.28.2, but not by perl-5.30.1

It turns out to be caused by dependencies of the form >=X<Y when a
forced upgrade (as used by pkgin, make replace, and no doubt others)
has taken us past Y.  The search for installed packages fails and so
the packages are not removed from +CONTENTS files.  This is why it
appears more often with perl than other packages, as that has enforced
versions, though it has been seen with others.

My proposed patch is to convert any lookups of specific versions to
just look for -[0-9]* for this code path.  We do not support multiple
packages to be installed with the same PKGBASE, so there should(?) be
no danger here of removing the wrong package:

I'm going to be testing this patch for a while (it has passed hundreds
of iterations of my stress test so far) and probably ship it out to my
users for wider testing, but would like it to be integrated at some
point for everyone.


Jonathan Perkin  -  Joyent, Inc.  -

Home | Main Index | Thread Index | Old Index