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

apt, dpkg: feature request: versioned provides

Hi, apt and dpkg-developers.  I'd like to present a problem for your

My situation is this: for various reasons I occasionally need to roll
my own versions of packages also present in the mainline Debian tree.
I'd like the apt-source for these packages to be able to coexists with
the standard apt-sources, so I usually name these packages
<vendorname>-<packagename>.  Since these are variations on
<packagename>, it usually makes sense to provide <packagename> from
these as well.  So far so good.

Certain mainline packages, however (like libldap2) are being depended
on with version requirements, and these kinds of dependencies, as you
probably know, cannot be satisfied by differently named packages
providing the original package.  In these cases I've been forced to
name our vendor-modified packages the same as the original package and
juggle the version number to minimize the number of accidential
upgrades from mainline-package to vendor-package and vice versa.

What I'd like to do is to say that the package linpro-libldap2
provides (the functionality of) version 2.0.11 of libldap2.  As it
turns out, the patch needed to give me this is fairly small, at least
for relatively trivial use of apt-get and dpkg.  I ended up with this:

--- apt-0.5.3.orig/apt-pkg/deb/deblistparser.cc
+++ apt-0.5.3/apt-pkg/deb/deblistparser.cc
@@ -491,7 +491,7 @@
       Start = ParseDepends(Start,Stop,Package,Version,Op);
       if (Start == 0)
 	 return _error->Error("Problem parsing Provides line");
-      if (Op != pkgCache::Dep::NoOp)
+      if (Op != pkgCache::Dep::NoOp && Op != pkgCache::Dep::Equals)
 	 return _error->Error("Malformed provides line");
       if (NewProvides(Ver,Package,Version) == false)
--- dpkg-1.9.16.orig/main/packages.c
+++ dpkg-1.9.16/main/packages.c
@@ -359,7 +359,7 @@
       thisf= deppossi_ok_found(possi->ed,pkg,removing,0,
       if (thisf > found) found= thisf;
-      if (found != 3 && possi->verrel == dvr_none) {
+      if (found != 3) {
         if (possi->ed->installed.valid) {
           for (provider= possi->ed->installed.depended;
                found != 3 && provider;

This makes apt accept "Provides: libldap2 (= 2.0.11-1)" as a valid
provides line, and makes dpkg try to satisfy otherwise unmet
dependencies using virtual packages even if a version requirement is
given for the dependency.

Is this something you'd be willing to consider for future apt and


Reply to: