Subject: Re: moving md5 and patch-sum from files/ to pkg/
To: Jeremy C. Reed <reed@reedmedia.net>
From: Alistair Crooks <agc@pkgsrc.org>
List: tech-pkg
Date: 03/15/2001 21:54:16
Jeremy,

Thanks for the suggestion.

On Thu, Mar 15, 2001 at 01:13:57PM -0800, Jeremy C. Reed wrote:
> It seems like I read some discussion about this before.
> 
> Why don't we put the md5 and patch-sum files into a package source pkg/
> directory instead of the files/ directory?
> 
> Then the files directory won't exist (unless really needed).

This has come up before - the files could certainly be moved from many
subdirectories to one subdirectory, whcih would probably be a win. 
It's arguable whether that should be files, pkg/, or something new
like oldsocks/ or knob/.

There are other ways of gaining fewer inodes, again which have come up
before, the most popular of which would seem to be merging the md5 and
patch-sum files into a being called checksum, or sum.

> I have a simple patch below (which also adds one comment).
> And I did a couple tests and it seems to work, such as:
>  make makesum
>  make patchsum
>  make

The trouble I have with this is it means that we have to go through
nearly 1900 packages, moving all the files from files/ to pkg/ - this
could take a significant amount of time.  During that time, pkgsrc
would be unusable.  I'd prefer it if this wasn't the case - new files
or newly-created files could go into the new directory, the old ones
staying where they are until they are moved. That's how we did the
COMMENT changes, and that's how we're doing the move to SHA1 sums
via digest. I think the days are gone when I could just calculate
all the patch-sum files in one afternoon and add them, or to add RCS
Ids to all patch-sum and md5 files in the space of 3 hours.  It's also
less of a pain to people who actually use pkgsrc, since they don't
have to grab the sources at one specific time, and then wait for the
dust to settle.

Regards,
Alistair

> --- pkgsrc/mk/bsd.pkg.mk.orig	Thu Mar 15 12:53:38 2001
> +++ pkgsrc/mk/bsd.pkg.mk	Thu Mar 15 13:10:15 2001
> @@ -270,8 +270,8 @@
>  # Miscellaneous overridable commands:
>  SHCOMMENT?=		${ECHO_MSG} >/dev/null '***'
>  
> -DIGEST_FILE?=		${FILESDIR}/md5
> -PATCH_SUM_FILE?=	${FILESDIR}/patch-sum
> +DIGEST_FILE?=		${PKGDIR}/md5
> +PATCH_SUM_FILE?=	${PKGDIR}/patch-sum
>  
>  .if exists(/usr/bin/m4)
>  M4?=			/usr/bin/m4
> @@ -1512,6 +1512,7 @@
>  			if [ "X$$fail" != "X" ]; then			\
>  				${ECHO_MSG} "Patching failed due to modified patch file(s): $$fail"; \
>  				exit 1;					\
> +			else ${ECHO_MSG} "===> Checksum OK for patches";	\
>  			fi;						\
>  		fi;							\
>  	fi
> @@ -2445,7 +2446,7 @@
>  
>  .if !target(makesum)
>  makesum: fetch uptodate-digest
> -	${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${FILESDIR}
> +	${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${PKGDIR}
>  	${_PKG_SILENT}${_PKG_DEBUG}if [ -f ${DIGEST_FILE} ]; then ${RM} -f ${DIGEST_FILE}; fi
>  	@${ECHO} -n "$$" > ${DIGEST_FILE};				\
>  		${ECHO} -n "NetBSD" >> ${DIGEST_FILE}; 			\
> @@ -2466,7 +2467,7 @@
>  .if !target(makepatchsum)
>  makepatchsum mps: uptodate-digest
>  	${_PKG_SILENT}${_PKG_DEBUG}					\
> -	(${MKDIR} ${FILESDIR};						\
> +	(${MKDIR} ${PKGDIR};						\
>  	${ECHO_MSG} "${_PKGSRC_IN}> Making patch checksums";		\
>  	if [ -f "${PATCH_SUM_FILE}" ]; then				\
>  		${AWK} -- '{print ; exit}' < ${PATCH_SUM_FILE} > ${PATCH_SUM_FILE}.new; \
> 
> 
>    Jeremy C. Reed
>    http://www.reedmedia.net/
> 
>