Re: FILERDEVS contains FILEMODES

2008-01-25 Thread Jeff Johnson


On Jan 25, 2008, at 9:20 PM, Jeff Johnson wrote:



I shall re-add (conditioned on --lsb)
Requires: rpmlib(PayloadFilesHavePrefix)
so that lsbpkgchk as distributed by LSB spews less.



With this rather modest patch (to be included in rpm-5.0.1),
the lsbpkgchk spew is much reduced (attached):

Index: build/files.c
===
RCS file: /v/rpm/cvs/rpm/build/files.c,v
retrieving revision 1.312
diff -u -b -B -w -p -r1.312 files.c
--- build/files.c   18 Jan 2008 23:04:05 -  1.312
+++ build/files.c   26 Jan 2008 03:14:12 -
@@ -1609,6 +1609,11 @@ if (!(_rpmbuildFlags & 4))
 xx = headerPut(h, he, 0);
 he->append = 0;

+if (_rpmbuildFlags & 4) {
+(void) rpmlibNeedsFeature(h, "PayloadFilesHavePrefix", "4.0-1");
+(void) rpmlibNeedsFeature(h, "CompressedFileNames", "3.0.4-1");
+}
+
 compressFilelist(h);

   { int scareMem = 0;

On to diagnose the header+payload md5 check, and perhaps
implement the header-only sha1 test.

73 de Jeff



lsbpkgchk.spew
Description: Binary data


FILERDEVS contains FILEMODES

2008-01-25 Thread Jeff Johnson

OK, here's the flaw.

rpmchk/archive.c does this call:

(gdb)
253 fileindex=findfileindex(filename);

which returns

(gdb) p fileindex
$3 = -1

(Note: there is no check that the array index is, indeed, out-of- 
bounds.)


Now findfileindex() is confused because its being passed "./opt/lsb/ 
bin/bison"

but the wrong branch of

if(hasPayloadFilesHavePrefix) {
fmt=".%s";
} else {
fmt="%s";
}

is being taken.

Hmmm, I begin to suspect what is going on ... yes, tracking
dependencies are being used to set the boolean (from dependencies.c):

if (strcmp(name, "rpmlib(PayloadFilesHavePrefix)") == 0)
hasPayloadFilesHavePrefix = 1;
if (strcmp(name, "rpmlib(CompressedFileNames)") == 0)
hasCompressedFileNames = 1;


So much for packages having _ONLY_

Requires: lsb = 3.1

other Requires:  need to be present in rpm headers for lsbpkgchk to  
function

correctly. Icky unspecified ad hoc hackery, just like rpm code.

I shall re-add (conditioned on --lsb)
Requires: rpmlib(PayloadFilesHavePrefix)
so that lsbpkgchk as distributed by LSB spews less.

FWIW, the reason for removing the tracking dependency
is that It Really Doesn't Matter. There's a simpler test on
file paths from cpio headers that has been known to "just work" for  
rpm since
the year 2000. Here is what rpm itself has been doing when presented  
with

paths that might (or might not) start with "./":

/* Match rpm-4.0 payloads with ./ prefixes. */
if (afn[0] == '.' && afn[1] == '/') afn += 2;

i.e. skip leading "./" if present.

And the rationale for making the change to add "./"
prefix to cpio paths between rpm-3.0.x and the last
major release of rpm was to permit including / as
something other than the highly non-standard ""
null string in cpio payloads.

73 de Jeff
__
RPM Package Managerhttp://rpm5.org
LSB Communication Listrpm-lsb@rpm5.org