[Apt-Rpm] apt 0.5.15lorg3.94a problem with executable(..) requirements

Panu Matilainen pmatilai at laiskiainen.org
Tue Jan 27 12:40:17 PST 2009


On Mon, 26 Jan 2009, Silvan Calarco wrote:

> Hi,
> I'm trying to upgrade my system from apt 0.5.15lorg3.2 to 0.5.15lorg3.94a.
> I've managed to build it both with rpm 4.4.9 and 5.1.6, but I'm stuck at the
> same problem against both rpm versions: executable requirements are reported
> as execuable(...) by both rpm local db and pkglist created by genbasedir, but
> are not stored as such in apt cache.
> The result is that when a package requires, let's say, executable(sed), apt
> complains because 'sed' is not a valid file. I wouldn't expect apt to solve
> runtime deps (this is disabled in configuration), but I would expect apt to
> drop or save the requirement in the cache as executable(sed).
>
> Example:
>
> $ rpm -q setup --requires
> /bin/sh
> /usr/sbin/useradd
> config(setup) = 1.1.16-2mamba
> executable(cp)
> executable(getent)
> executable(sed)

Yup, the executable() stuff was never really tested (nor used by anybody 
back then at least). Also the idea of runtime dependency probes
rubs *very* badly with apt's design :)

> This is what I would expect instead:
> 1.1.16-2mamba - /bin/sh (0 (null)) /usr/sbin/useradd (0 (null)) config(setup)
> (5 1.1.16-2mamba) executable(cp) (0 (null)) executable(getent) (0 (null))
> executable(sed) (0 (null))
>
> Or just (this is the result with 0.5.15lorg3.2):
> 1.1.16-2mamba - /bin/sh (0 (null)) /usr/sbin/useradd (0 (null)) config(setup)
> (5 1.1.16-2mamba)
>
> I've been a long time around apt and rpm code to find where this information
> is managed, with no success. Thanks for any help!

As a quick hack, this might get you something that kinda works (untested 
though):

diff --git a/apt-pkg/rpm/rpmhandler.cc b/apt-pkg/rpm/rpmhandler.cc
index 3d4342d..a7add31 100644
--- a/apt-pkg/rpm/rpmhandler.cc
+++ b/apt-pkg/rpm/rpmhandler.cc
@@ -224,9 +224,7 @@ bool RPMHandler::InternalDep(const char *name, const 
char *v
          strncmp(name, "readable(", strlen("readable(")) == 0 ||
          strncmp(name, "writable(", strlen("writable("))== 0 ))
     {
-      int res = rpmioAccess(name, NULL, X_OK);
-      if (res == 0)
-        return true;
+      return true;
     }

     /* TODO



The idea is that apt is made essentially unaware of these runtime 
dependencies as it can't reasonably deal with them anyway, the code that's 
in there now is wrong anyhow for executable() and friends.

 	- Panu -



More information about the Apt-Rpm mailing list