Subject: can't insert MD5 IGNORE in files/md5, wrong?
To: None <,>
From: John Refling <>
List: tech-pkg
Date: 05/03/2000 16:54:02
I'm working on a package where SOME of the files need to have
the checksum ignored.  I have added IGNOREFILES= <list> to the
Makefile.  When I "make makesum" the ones NOT in the IGNOREFILES
list are checksummed and inserted in the files/md5, (as normal)
and that's it.  The ones IN the list are ignored.

I think that the desired result is to have the ones IN the
IGNOREFILES list inserted in the files/md5 with a "= IGNORE"
for the checksum.

This result is achieved if the following change/correction is
make to

version version 1.432 (May 3, 2000), excerpt:

# Checksumming utilities

.if !target(makesum)
makesum: fetch
        ${_PKG_SILENT}${_PKG_DEBUG}if [ -f ${MD5_FILE} ]; then ${RM} -f ${MD5_FILE}; fi
        @${ECHO} -n "$$" > ${MD5_FILE};                                 \
                ${ECHO} -n "NetBSD" >> ${MD5_FILE};                     \
                ${ECHO} "$$" >> ${MD5_FILE};                            \
                ${ECHO} "" >> ${MD5_FILE}
        ${_PKG_SILENT}(${_PKG_DEBUG}cd ${DISTDIR};                      \
        for sumfile in "" ${_CKSUMFILES}; do                            \
                if [ "X$$sumfile" = X"" ]; then continue; fi;           \
                ${MD5} $$sumfile >> ${MD5_FILE};                        \
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        for ignore in "" ${_IGNOREFILES}; do                            \
                if [ "X$$sumfile" = X"" ]; then continue; fi;           \
                ${ECHO} "MD5 ($$ignore) = IGNORE" >> ${MD5_FILE};       \
        done               ^
.endif                     |
                           +---  "X$$sumfile"  changed to "X$$ignore"
                                  2 lines up.

I'm second guessing at what is supposed to be going on here, but do we
really want to be checking a variable left over from the previous
loop ("for sumfile....").


By the way, do we have some way of checksumming the CONTENTS of
a file?

This becomes an issue when we fetch files from a ftp server which
dynamically tars the data... the dates of the files on the server
may change from time to time due to the server's administrative
functions, even if contents doesn't.  Our current system will fail
in those cases.

I'm manually trying something like in pre-extract:

tar -O -zxf ${DISTDIR}/${DIST_SUBDIR}/${DISTFILE} | ${MD5}

to checksum only the contents of the file (I hope).  Can we build
this in (eg, CKSUMCONTENTS= ...).

John Refling <>