Re: problem comparing capability version strings
devzero2000 <[email protected]> Thu, 10 Apr 2008 12:40:22 +0200
| Newsgroups | gmane.linux.redhat.rpm.general |
|---|---|
| Message-ID | <[email protected]> |
This situation you describe is normal. A package -dev generally requires only the NV capability of the primary package: it generally doesn't depends of the particolar Package Release eg. the rpm package lifecycle versus principal program lifecycle . In this case Name=Gconf2 and Version is 2.14.0 (release is 0.el5). So the package A required dependency (on Version) is OK. hth On Thu, Apr 10, 2008 at 4:11 AM, Dave Peterson <[email protected]> wrote: > Hi, > > I have a question about capability version string comparisons. > Using RPM library calls, I examine the following Centos 5 > packages: > > package A: GConf2-devel-2.14.0-9.el5.i386.rpm > package B: GConf2-2.14.0-9.el5.i386.rpm > > I see that one capability required by A is the following: > > capability name: GConf2 > capability version: 2.14.0 > flags: RPMSENSE_EQUAL > > I also see that one capability provided by B is the following: > > capability name: GConf2 > capability version: 2.14.0-9.el5 > flags: RPMSENSE_EQUAL > > To see if the GConf2 capability provided by B satisfies A's > requirement, I call rpmvercmp() as follows: > > int result = rpmvercmp("2.14.0", "2.14.0-9.el5"); > > The return value is -1, indicating that "2.14.0-9.el5" is newer > than "2.14.0". Since the "flags" value for A is RPMSENSE_EQUAL, > and rpmvercmp() says that the version strings are not equal, I > conclude that the GConf2 capability provided by B does not > satisfy the GConf2 dependency required by A. Looking at the > packages installed on my own machine, I observe the following: > > $ rpm -qa | grep GConf2 > GConf2-2.14.0-9.el5 > GConf2-devel-2.14.0-9.el5 > $ > $ rpm -q --provides GConf2-2.14.0-9.el5 | grep '^GConf2' > GConf2 = 2.14.0-9.el5 > $ > $ rpm -q --requires GConf2-devel-2.14.0-9.el5 | grep '^GConf2' > GConf2 = 2.14.0 > $ > $ rpm -q --whatprovides GConf2 > GConf2-2.14.0-9.el5 > $ > $ rpm -V GConf2-devel-2.14.0-9.el5 > $ > > It looks like B is the only installed package that provides the > GConf2 capability, and the RPM command doesn't complain that A is > missing any dependencies. > > What is going on here? I suspect that the capability versions > "2.14.0" and "2.14.0-9.el5" should be considered equal due to > some usage convention(s) that I am unaware of. Is this correct? > What is the proper way to compare two capability version strings > in order to determine whether a package dependency is satisfied? > Is there one way that is guaranteed to work across all distros, > or does it vary from one distro to another? > > Thanks, > Dave > > _______________________________________________ > Rpm-list mailing list > [email protected] > https://www.redhat.com/mailman/listinfo/rpm-list > _______________________________________________ Rpm-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/rpm-list