Bug 3161 - unpack md5 fixes for non-tar-rpm-zip-files/patchfiles
: unpack md5 fixes for non-tar-rpm-zip-files/patchfiles
Status: CLOSED FIXED
Product: Sorcery
Classification: Unclassified
Component: subroutines
: pre-1.10
: Other other
: P5 blocker
Assigned To: Dufflebunk
http://smgl.positivism.org/bin/misc/l...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-18 06:59 UTC by Seth Woolley
Modified: 2003-10-19 23:17 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Seth Woolley 2003-04-18 06:59:05 UTC
With these fixes one can now "clean" a patchfile in PRE_BUILD by simply faking
an unpack() on it.  All non-tarball, zip, rpm files don't get expandedor
anything, they get dropped to /dev/null (but the fixes make it so that it at
least checks the md5 correctly, as currently it passes a good return value on
anything non-tar-zip-rpm -- bad behaviore imho).  One could probably make it
"pipe" its uncompressed output with some creative fifos, but I'll settle for
this.  It could also be made to save the output instead of to /dev/null, to a
location in the root of the build directory with the name of the
$SOURCE.unpacked or stripped of .bz2 or .gz at the end.  The /dev/null behavior
is fine with me, however.

as in:
==>
default_pre_build &&
unpack $SOURCE2 ${MD5[1]} &&
[bzcat|zcat|cat] $SOURCE_CACHE/$SOURCE2 | patch -p1
<== (I tested it with compressed and uncompressed patches.)

We have about 90 instances where I can add this to PRE_BUILDS and make the
grimoire 100% secure.

Another reason I chose unpack to run it through is so that my auditing routines
don't need any modification (orthogonality).
Comment 1 M.L. 2003-04-20 10:11:00 UTC
I use this:
uncompress $SOURCE_CACHE/$SOURCE `guess_compressor $SOURCE_CACHE/$SOURCE`
${MD5[0]} > ./$NAME || [
-e ./$NAME ]
Comment 2 Dufflebunk 2003-04-23 18:23:16 UTC
merged
Comment 3 Seth Woolley 2003-04-24 14:07:46 UTC
M_L: How would that work since if the md5 were wrong, the md5 error message
would get saved to $NAME with the uncompressed file?
Comment 4 games 2003-10-19 23:17:42 UTC
if any of these still have issues outstanding then they can be reopened, but
most  have just been overlooked/forgotten
("these" refers to the 611 fixed but not closed bugs I just found in our database)