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

Silvan Calarco silvan.calarco at mambasoft.it
Wed Jan 28 18:47:21 PST 2009


Il martedì 27 gennaio 2009 21:40:17 Panu Matilainen ha scritto:
> 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.

Thanks for the patch, it looks good and I've tried it but it doesn't solve the 
problem. The result is the same as before, example:

$ sudo apt-get install acpid                     
  acpid: Depends: service but it is not installable                   

As I pointed out in the previous mail, it seems to me that executable 
requirements are saved in apt cache just as 'name' instead of 
'executable(name)', then on install they are identified as virtual 
requirements and thus not considered in the above code.

In the example below the cache contains 'chkconfig', 'sed', 'service' that are 
reported as executable() requirements by rpm, but when I try to install the 
package apt just complains for 'service' requirement missing. My explaination 
for this is that accidentally sed and chkconfig are also name of packages in 
the repositories, service is not.

$ sudo apt-cache showpkg acpid
[...]
Dependencies:
1.0.6-4mamba - /bin/bash (0 (null)) /bin/sh (0 (null)) /bin/sh (0 (null)) 
chkconfig (0 (null)) config(acpid) (5 1.0.6-4mamba) chkconfig (0 (null)) 
chkconfig (0 (null)) sed (0 (null)) service (0 (null)) libc.so.6 (0 (null)) 
libc.so.6(GLIBC_2.0) (0 (null)) libc.so.6(GLIBC_2.1) (0 (null)) 
libc.so.6(GLIBC_2.3) (0 (null)) libc.so.6(GLIBC_2.3.4) (0 (null))

I hope this makes sense but I don't know how to fix this, the apt cache code 
looks a bit complicated to understand and patch for me...

Silvan

>
>  	- Panu -
> _______________________________________________
> Apt-Rpm mailing list
> Apt-Rpm at lists.laiskiainen.org
> http://lists.laiskiainen.org/listinfo.cgi/apt-rpm-laiskiainen.org

-- 
mambaSoft di Calarco Silvan
Web: http://www.mambasoft.it
 
mambaSoft Store @ http://shop.mambasoft.it
openmamba GNU/Linux development @ http://www.openmamba.org



More information about the Apt-Rpm mailing list