FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > RPM Package Manager

 
 
LinkBack Thread Tools
 
Old 04-05-2008, 02:54 AM
"Dave Peterson"
 
Default pathnames, etc. as required capabilities

Hi,

I have a little C++ program I wrote that uses RPM library
calls to extract dependency info from RPM files, and then
does some analysis on the extracted info. As input, the
program takes the entire set of RPMs in the CentOS 5
distro. Looking at the output, I notice that there are a
number of capabilities required by packages in the distro
but not shown as being provided by any package in the
distro. Almost all of these are full pathnames (for
instance "/bin/sh" and "/bin/gzip"). The remaining few
are strings that look like they specify things provided
by the RPM library itself (such as
"rpmlib(CompressedFileNames)" and
"rpmlib(PartialHardlinkSets)").

Based on these observations, I am guessing that the
following conventions probably apply to strings extracted
from RPM headers that represent required capabilities:

1. Any capability string that looks like an absolute
pathname should be treated as one. In addition
to packages that explicitly list such a
capability as being provided, any package whose
set of included files contains a matching
absolute pathname should be treated as providing
that capability.

2. Any capability string that looks like
"rpmlib(...)" should be assumed to refer to
something provided by the RPM library itself.

Is this correct? If so, I have a couple of questions:

- The RPM package that provides the RPM library
itself (rpm-4.4.2-37.el5.i386.rpm for CentOS 5)
doesn't list capabilities such as
"rpmlib(CompressedFileNames)". Is there any way,
just by using RPM library calls to get info from
the RPM package, to determine whether it provides
things such as "rpmlib(CompressedFileNames)"? If
not, how do I use RPM library calls to ask the RPM
library on an installed system which capabilities
of this type it provides?

- Are there any kinds of strings other than absolute
pathnames and things like
"rpmlib(CompressedFileNames)" that an RPM header
may list as required but must be treated as special
cases?

Thanks in advance for any help you may be able to provide.

Dave

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-05-2008, 04:49 PM
devzero2000
 
Default pathnames, etc. as required capabilities

As far i know,

for the 2) questions the answer is yes. rpmlib(xxxxx) and /bin/sh are special requirement
to rpm library itself and for the bourne shell script to run the installation scripts (e.g. %pre %post and so), respectively . For example, rpmlib(VersionedDependencies) >= 3.0.3-1 in facts is a dependency from rpm itselfs: the package in questions hold dependecies or prerequisites that have versions associated with them: the spec file have probabily something like Requires : foo >= 1.1. In fact it is possible in rpm* to define Versioned Dependency from rpm >= 3.0.3. The rpm tags RPMTAG_REQUIRENAME and RPMTAG_REQUIREVERSIONS should be list this requisites. For the second point you ask

*it is possibile to have also the requisite "lsb" with version "1.3" or so, iirc - i have not see it anyway: it mean that the package conforms to the Linux Standard Base RPM format (which means no requirements or provides are defined other from lsb-xxx modules itself and that the payload are compressed with gzip at compression level 9, more or less - not exactly a good thing or useful IMHO). In fact in rpm 5 (rpm5.org, unlikely you use) in the rpm build (rpmbuild command)* it is possible to pass the popt option --lsb that means exactly --noautorequires --noautoprovides. From RPM 4.4.4 exist also other depency as libtool(....) depencies , but, again, it is unlikely you see ever* in CentoOS - but in PLD Linux, i have read, Yes for example


hth

On Sat, Apr 5, 2008 at 4:54 AM, Dave Peterson <dave_peterson@bigfix.com> wrote:

Hi,



I have a little C++ program I wrote that uses RPM library

calls to extract dependency info from RPM files, and then

does some analysis on the extracted info. *As input, the

program takes the entire set of RPMs in the CentOS 5

distro. *Looking at the output, I notice that there are a

number of capabilities required by packages in the distro

but not shown as being provided by any package in the

distro. *Almost all of these are full pathnames (for

instance "/bin/sh" and "/bin/gzip"). *The remaining few

are strings that look like they specify things provided

by the RPM library itself (such as

"rpmlib(CompressedFileNames)" and

"rpmlib(PartialHardlinkSets)").



Based on these observations, I am guessing that the

following conventions probably apply to strings extracted

from RPM headers that represent required capabilities:



* *1. *Any capability string that looks like an absolute

* * * *pathname should be treated as one. *In addition

* * * *to packages that explicitly list such a

* * * *capability as being provided, any package whose

* * * *set of included files contains a matching

* * * *absolute pathname should be treated as providing

* * * *that capability.



* *2. *Any capability string that looks like

* * * *"rpmlib(...)" should be assumed to refer to

* * * *something provided by the RPM library itself.



Is this correct? *If so, I have a couple of questions:



* *- The RPM package that provides the RPM library

* * *itself (rpm-4.4.2-37.el5.i386.rpm for CentOS 5)

* * *doesn't list capabilities such as

* * *"rpmlib(CompressedFileNames)". *Is there any way,

* * *just by using RPM library calls to get info from

* * *the RPM package, to determine whether it provides

* * *things such as "rpmlib(CompressedFileNames)"? *If

* * *not, how do I use RPM library calls to ask the RPM

* * *library on an installed system which capabilities

* * *of this type it provides?



* *- Are there any kinds of strings other than absolute

* * *pathnames and things like

* * *"rpmlib(CompressedFileNames)" that an RPM header

* * *may list as required but must be treated as special

* * *cases?



Thanks in advance for any help you may be able to provide.



Dave



_______________________________________________

Rpm-list mailing list

Rpm-list@redhat.com

https://www.redhat.com/mailman/listinfo/rpm-list



_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-06-2008, 11:49 PM
"Jeff Johnson"
 
Default pathnames, etc. as required capabilities

On Fri, Apr 4, 2008 at 10:54 PM, Dave Peterson <dave_peterson@bigfix.com> wrote:

Hi,



I have a little C++ program I wrote that uses RPM library

calls to extract dependency info from RPM files, and then

does some analysis on the extracted info. *As input, the

program takes the entire set of RPMs in the CentOS 5

distro. *Looking at the output, I notice that there are a

number of capabilities required by packages in the distro

but not shown as being provided by any package in the

distro. *Almost all of these are full pathnames (for

instance "/bin/sh" and "/bin/gzip"). *The remaining few

are strings that look like they specify things provided

by the RPM library itself (such as

"rpmlib(CompressedFileNames)" and

"rpmlib(PartialHardlinkSets)").

OK.*


Based on these observations, I am guessing that the

following conventions probably apply to strings extracted

from RPM headers that represent required capabilities:



* *1. *Any capability string that looks like an absolute

* * * *pathname should be treated as one. *In addition

* * * *to packages that explicitly list such a

* * * *capability as being provided, any package whose

* * * *set of included files contains a matching

* * * *absolute pathname should be treated as providing

* * * *that capability.

Yes. Any capability that starts with a '/' is a file dependency.*



* *2. *Any capability string that looks like

* * * *"rpmlib(...)" should be assumed to refer to

* * * *something provided by the RPM library itself.

Yes. Any capability enclosed by rpmlib(...) is provided by the rpm implementation.*



Is this correct? *If so, I have a couple of questions:



* *- The RPM package that provides the RPM library

* * *itself (rpm-4.4.2-37.el5.i386.rpm for CentOS 5)

* * *doesn't list capabilities such as

* * *"rpmlib(CompressedFileNames)". *Is there any way,

* * *just by using RPM library calls to get info from

* * *the RPM package, to determine whether it provides

* * *things such as "rpmlib(CompressedFileNames)"? *If

* * *not, how do I use RPM library calls to ask the RPM

* * *library on an installed system which capabilities

* * *of this type it provides?

Yes. Leme check ...
In rpm-4.4.2 the API to retrieve rpmlib(...) dependencies is:
/** ingroup rpmtrans
** Return copy of rpmlib internal provides.** @retval provNames * *address of array of rpmlib internal provide names** @retval provFlags * *address of array of rpmlib internal provide flags
** @retval provVersions address of array of rpmlib internal provide versions** @return * * * * * * *no. of entries**//*@unused@*/int rpmGetRpmlibProvides(/*@null@*/ /*@out@*/ const char *** provNames,
** * * * * * * * * * * */*@null@*/ /*@out@*/ int ** provFlags,** * * * * * * * * * * */*@null@*/ /*@out@*/ const char *** provVersions)** * * */*@modifies *provNames, *provFlags, *provVersions @*/;

There's a different API in more recent rpm that returns a populateddependency set instead of raw arrays.
But if you're writing an application that uses rpm libraries, you can also just
ignore all rpmlib(...) dependencies. The dependencies are meant for rpmlib,not for applications.*



* *- Are there any kinds of strings other than absolute

* * *pathnames and things like

* * *"rpmlib(CompressedFileNames)" that an RPM header

* * *may list as required but must be treated as special

* * *cases?

The general** *Requires: foo(bar)is an attempt at namespaces for dependencies. So the general answer isthat there are an infinite number of foo(bar) constructs, each of which
should be handled (in some ideal sense) by handing off to a namespacehandler.
In practice, "foo(bar)" is just a string that can be matched against other strings,
noone really groks namespace for dependencies (although its kinda obvious thatall dependencies that start with '/' are file dependencies, just another name space).
Running
** *rpm -qa --qf '[%{requirename|
]' | grep '(' | sort -uwill give you a pretty clear idea of what namespace dependency strings are currently inuse on your distro.

hth
73 de Jeff
_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-07-2008, 12:05 AM
"Jeff Johnson"
 
Default pathnames, etc. as required capabilities

On Sun, Apr 6, 2008 at 7:49 PM, Jeff Johnson <n3npq.jbj@gmail.com> wrote:






* *- The RPM package that provides the RPM library

* * *itself (rpm-4.4.2-37.el5.i386.rpm for CentOS 5)

* * *doesn't list capabilities such as

* * *"rpmlib(CompressedFileNames)". *Is there any way,

* * *just by using RPM library calls to get info from

* * *the RPM package, to determine whether it provides

* * *things such as "rpmlib(CompressedFileNames)"? *If

* * *not, how do I use RPM library calls to ask the RPM

* * *library on an installed system which capabilities

* * *of this type it provides?

Sorry, I did not answer you question precisely.
The rpmlib(...) dependencies are part of the rpm implementation, not the rpm package.

You can find out what capabilities are provided by the implementation using --showrc,which will also display the "features" that are being tracked with rpmlib(...) dependencies.

73 de Jeff*
_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 04-07-2008, 07:53 PM
"Dave Peterson"
 
Default pathnames, etc. as required capabilities

> Sorry, I did not answer you question
precisely.
>
> The rpmlib(...) dependencies are part of
the rpm
>
implementation,*not the rpm
package.
>

> You can find out what capabilities are
provided by
> the implementation using --showrc, which will
also
> display the "features" that are being
tracked with
> rpmlib(...)
dependencies.
>

> 73 de Jeff
*
Ok, thanks for the info.* I'm curious, is it
possible
that a package may fail to install because it
depends
on some feature of the RPM library represented*by
a
rpmlib(...) capability?
*
_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 

Thread Tools




All times are GMT. The time now is 03:26 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org