RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/ VENDOR rpm/lib/ fs.c

From: Jeff Johnson <n3npq@mac.com>
Date: Sat 11 Oct 2008 - 17:27:57 CEST
Message-id: <4F590475-0BFB-4C8A-A335-38CB06D3B19E@mac.com>
Nothing wrong with the patch (although I'm reminded of the /usr/lib42  
thread ;-)

But it would be nice to be able to support the probe dependency
	Requires: cpuinfo(foo) = bar
on systems without /proc.

ATM, "support" on non-linux menas generate a cpuinfo-like text file,
and point the probe dependency parser at that file. A better  
implementation
would use the values provided by the native kernel. Note that "foo"  
and "bar"
in the probe dependency are already quite opaque and arbitrary.

73 de Jeff

On Oct 11, 2008, at 10:51 AM, Ralf S. Engelschall wrote:

>   RPM Package Manager, CVS Repository
>   http://rpm5.org/cvs/
>    
> ______________________________________________________________________ 
> ______
>
>   Server: rpm5.org                         Name:   Ralf S. Engelschall
>   Root:   /v/rpm/cvs                       Email:  rse@rpm5.org
>   Module: rpm                              Date:   11-Oct-2008  
> 16:51:08
>   Branch: HEAD                             Handle: 2008101114510800
>
>   Modified files:
>     rpm                     VENDOR
>     rpm/lib                 fs.c
>
>   Log:
>     OpenPKG-specific change "always-skip-proc-filesystem":
>
>     Always skip the /proc filesystem OpenPKG never does anything  
> with the
>     virtual filesystem /proc which exists on some platforms.  
> Sometimes (e.g.
>     in a FreeBSD Jail) the problem even exists that RPM discovers  
> that /proc
>     might be available (because the FreeBSD host leaks this  
> information to
>     the Jail) but /proc cannot be actually accessed from within the  
> Jail. As
>     a result, RPM complains with "error: failed to stat /proc: No  
> such file
>     or directory" all the time.. As OpenPKG never fiddles around  
> with /proc
>     from within RPM, in this particular vendor environment /proc  
> safely can
>     be just ignored.
>
>   Summary:
>     Revision    Changes     Path
>     2.56        +16 -0      rpm/VENDOR
>     2.66        +11 -0      rpm/lib/fs.c
>    
> ______________________________________________________________________ 
> ______
>
>   patch -p0 <<'@@ .'
>   Index: rpm/VENDOR
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r2.55 -r2.56 VENDOR
>   --- rpm/VENDOR	17 Aug 2008 16:19:38 -0000	2.55
>   +++ rpm/VENDOR	11 Oct 2008 14:51:08 -0000	2.56
>   @@ -421,6 +421,22 @@
>                         are not broken.
>          
> ______________________________________________________________________ 
> __
>
>   +     Change:         always-skip-proc-filesystem
>   +     Purpose:        Always skip the /proc filesystem
>   +     Reason:         OpenPKG never does anything with the  
> virtual filesystem
>   +                     /proc which exists on some platforms.  
> Sometimes
>   +                     (e.g. in a FreeBSD Jail) the problem even  
> exists
>   +                     that RPM discovers that /proc might be  
> available
>   +                     (because the FreeBSD host leaks this  
> information
>   +                     to the Jail) but /proc cannot be actually  
> accessed
>   +                     from within the Jail. As a result, RPM  
> complains
>   +                     with "error: failed to stat /proc: No such  
> file
>   +                     or directory" all the time.. As OpenPKG never
>   +                     fiddles around with /proc from within RPM,  
> in this
>   +                     particular vendor environment /proc safely  
> can be
>   +                     just ignored.
>   +      
> ______________________________________________________________________ 
> __
>   +
>      o  Name:           RPM4DARWIN
>         Vendor:         RPM for Darwin (Mac OS X) <http:// 
> rpm4darwin.sourceforge.net/>
>         Representative: Anders F. Bjorklund  
> <afb@users.sourceforge.net> <afb@rpm5.org>
>   @@ .
>   patch -p0 <<'@@ .'
>   Index: rpm/lib/fs.c
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r2.65 -r2.66 fs.c
>   --- rpm/lib/fs.c	2 Aug 2008 00:38:04 -0000	2.65
>   +++ rpm/lib/fs.c	11 Oct 2008 14:51:08 -0000	2.66
>   @@ -111,6 +111,9 @@
>
>    	filesystems[i].mntPoint = fsnames[i] = fsn;
>    	
>   +#if defined(RPM_VENDOR_OPENPKG) /* always-skip-proc-filesystem */
>   +	if (!(strcmp(filesystems[i].mntPoint, "/proc") == 0)) {
>   +#endif
>    	if (stat(filesystems[i].mntPoint, &sb)) {
>    	    rpmlog(RPMLOG_ERR, _("failed to stat %s: %s\n"), fsnames[i],
>    			strerror(errno));
>   @@ -121,6 +124,9 @@
>    	
>    	filesystems[i].dev = sb.st_dev;
>    	filesystems[i].rdonly = rdonly;
>   +#if defined(RPM_VENDOR_OPENPKG) /* always-skip-proc-filesystem */
>   +        }
>   +#endif
>
>    	/* goto the next vmount structure: */
>    	vm = (struct vmount *)((char *)vm + vm->vmt_length);
>   @@ -214,6 +220,11 @@
>    	    mntdir = mounts[nextMount++].f_mntonname;
>    #	endif
>
>   +#if defined(RPM_VENDOR_OPENPKG) /* always-skip-proc-filesystem */
>   +	if (strcmp(mntdir, "/proc") == 0)
>   +		continue;
>   +#endif
>   +
>    	if (stat(mntdir, &sb)) {
>    	    switch(errno) {
>    	    default:
>   @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-cvs@rpm5.org
Received on Sat Oct 11 17:28:09 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.