Date: Tue, 26 Nov 1996 04:52:34 -0800 (PST) From: asami@freebsd.org (Satoshi Asami) To: msmith@atrad.adelaide.edu.au Cc: ports@freebsd.org Subject: Re: INDEX browser Message-ID: <199611261252.EAA20502@silvia.HIP.Berkeley.EDU> In-Reply-To: <199611261020.CAA16619@silvia.HIP.Berkeley.EDU> (asami@freebsd.org)
next in thread | previous in thread | raw e-mail | index | archive | help
* Actually, I was thinking about adding the directory to md5, as in * * MD5 (mutt/mutt-0.52-export.tar.gz) = 9d68f0713be6c73f0db0ae8c59a604a1 Well, here's a patch I came up with. I'm sleepy now so use it with caution. ;) Some of the DISTDIR -> _DISTDIR stuff is taken from a mail I got from Max a while ago. It also includes Bill Fenner's suggestion to improve messages printed out for ignored ports. In particular, if anyone knows how to get things like .if ${BROKEN} == yes to work when ${BROKEN} might have something like `;' in there, I would appreciate it. Satoshi Note you need to hand-edit your md5 file to add ${DIST_SUBDIR}/ in front for this to work. (Or just "make makesum", that should work too.) ------- Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v retrieving revision 1.231 diff -u -r1.231 bsd.port.mk --- bsd.port.mk 1996/11/14 11:45:42 1.231 +++ bsd.port.mk 1996/11/26 12:48:01 @@ -28,7 +28,7 @@ # FreeBSD: /usr/ports # NetBSD: /usr/opt # DISTDIR - Where to get gzip'd, tarballed copies of original sources -# (default: ${PORTSDIR}/distfiles/${DIST_SUBDIR}). +# (default: ${PORTSDIR}/distfiles). # PREFIX - Where to install things in general (default: /usr/local). # MASTER_SITES - Primary location(s) for distribution files if not found # locally (default: @@ -65,7 +65,7 @@ # PATCH_SITES (see above). They will automatically be # uncompressed before patching if the names end with # ".gz" or ".Z". -# DIST_SUBDIR - Suffix to ${DISTDIR} (see above). If set, all ${DISTFILES} +# DIST_SUBDIR - Suffix to ${DISTDIR}. If set, all ${DISTFILES} # and ${PATCHFILES} will be put in this subdirectory of # ${DISTDIR}. Also they will be fetched in this subdirectory # from FreeBSD mirror sites. @@ -92,7 +92,7 @@ # # NO_BUILD - Use a dummy (do-nothing) build target. # NO_CONFIGURE - Use a dummy (do-nothing) configure target. -# NO_CDROM - Use dummy (do-nothing) targets if FOR_CDROM is set. +# NO_CDROM - Port may not go on CDROM. Set this string to reason. # NO_DESCRIBE - Use a dummy (do-nothing) describe target. # NO_EXTRACT - Use a dummy (do-nothing) extract target. # NO_INSTALL - Use a dummy (do-nothing) install target. @@ -102,7 +102,7 @@ # NO_WRKDIR - There's no work directory at all; port does this someplace # else. # NO_DEPENDS - Don't verify build of dependencies. -# BROKEN - Port is broken. +# BROKEN - Port is broken. Set this string to the reason why. # RESTRICTED - Port is restricted. Set this string to the reason why. # USE_GMAKE - Says that the port uses gmake. # USE_IMAKE - Says that the port uses imake. @@ -257,7 +257,8 @@ .endif LOCALBASE?= /usr/local X11BASE?= /usr/X11R6 -DISTDIR?= ${PORTSDIR}/distfiles/${DIST_SUBDIR} +DISTDIR?= ${PORTSDIR}/distfiles +_DISTDIR?= ${DISTDIR}/${DIST_SUBDIR} PACKAGES?= ${PORTSDIR}/packages TEMPLATES?= ${PORTSDIR}/templates .if !defined(NO_WRKDIR) @@ -488,6 +489,14 @@ DISTFILES?= ${DISTNAME}${EXTRACT_SUFX} PKGNAME?= ${DISTNAME} +# List of all files, with ${DIST_SUBDIR} in front. Used for checksum. +.if defined(DIST_SUBDIR) +ALLFILES= ${DISTFILES:S/^/${DIST_SUBDIR}\//} \ + ${PATCHFILES:S/^/${DIST_SUBDIR}\//} +.else +ALLFILES= ${DISTFILES} ${PATCHFILES} +.endif + # This is what is actually going to be extracted, and is overridable # by user. EXTRACT_ONLY?= ${DISTFILES} @@ -557,28 +566,48 @@ # Don't build a port if it's broken. ################################################################ -.if (defined(IS_INTERACTIVE) && defined(BATCH)) || \ - (!defined(IS_INTERACTIVE) && defined(INTERACTIVE)) || \ - (defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF)) || \ - (defined(NO_CDROM) && defined(FOR_CDROM)) || \ - (defined(RESTRICTED) && defined(NO_RESTRICTED)) || \ - defined(BROKEN) -IGNORE= yes +.if (defined(IS_INTERACTIVE) && defined(BATCH)) +IGNORE= "is an interactive port" +.elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE)) +IGNORE= "is not an interactive port" +.elif (defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF)) +IGNORE= "requires Motif" +.elif (defined(NO_CDROM) && defined(FOR_CDROM)) +.if ${NO_CDROM} == yes +IGNORE= "may not be placed on a CDROM" +.else +IGNORE= "may not be placed on a CDROM: ${NO_CDROM}" +.endif +.elif (defined(RESTRICTED) && defined(NO_RESTRICTED)) +IGNORE= "is restricted: ${RESTRICTED}" +.elif defined(BROKEN) +.if ${BROKEN} == yes +IGNORE= "is marked as broken" +.else +IGNORE= "is marked as broken: ${BROKEN}" +.endif .endif .if defined(IGNORE) +.if defined(IGNORE_SILENT) +IGNORECMD= ${DO_NADA} +.else +IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} ${IGNORE}." +.endif all: - @${DO_NADA} + @${IGNORECMD} build: - @${DO_NADA} + @${IGNORECMD} install: - @${DO_NADA} + @${IGNORECMD} fetch: - @${DO_NADA} + @${IGNORECMD} +checksum: + @${IGNORECMD} configure: - @${DO_NADA} + @${IGNORECMD} package: - @${DO_NADA} + @${IGNORECMD} .endif .if defined(ALL_HOOK) @@ -677,12 +706,12 @@ .if !target(do-fetch) do-fetch: - @if [ ! -d ${DISTDIR} ]; then ${MKDIR} ${DISTDIR}; fi - @(cd ${DISTDIR}; \ + @if [ ! -d ${_DISTDIR} ]; then ${MKDIR} ${_DISTDIR}; fi + @(cd ${_DISTDIR}; \ for file in ${DISTFILES}; do \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ if [ -h $$file -o -h `${BASENAME} $$file` ]; then \ - ${ECHO_MSG} ">> ${DISTDIR}/$$file is a broken symlink."; \ + ${ECHO_MSG} ">> ${_DISTDIR}/$$file is a broken symlink."; \ ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \ ${ECHO_MSG} ">> Please correct this problem and try again."; \ exit 1; \ @@ -695,17 +724,16 @@ fi \ done; \ ${ECHO_MSG} ">> Couldn't fetch it - please try to retrieve this";\ - ${ECHO_MSG} ">> port manually into ${DISTDIR} and try again."; \ + ${ECHO_MSG} ">> port manually into ${_DISTDIR} and try again."; \ exit 1; \ fi \ done) .if defined(PATCHFILES) - @if [ ! -d ${DISTDIR} ]; then ${MKDIR} ${DISTDIR}; fi - @(cd ${DISTDIR}; \ + @(cd ${_DISTDIR}; \ for file in ${PATCHFILES}; do \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ if [ -h $$file -o -h `${BASENAME} $$file` ]; then \ - ${ECHO_MSG} ">> ${DISTDIR}/$$file is a broken symlink."; \ + ${ECHO_MSG} ">> ${_DISTDIR}/$$file is a broken symlink."; \ ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \ ${ECHO_MSG} ">> Please correct this problem and try again."; \ exit 1; \ @@ -718,7 +746,7 @@ fi \ done; \ ${ECHO_MSG} ">> Couldn't fetch it - please try to retrieve this";\ - ${ECHO_MSG} ">> port manually into ${DISTDIR} and try again."; \ + ${ECHO_MSG} ">> port manually into ${_DISTDIR} and try again."; \ exit 1; \ fi \ done) @@ -734,7 +762,7 @@ @${MKDIR} ${WRKDIR} .endif @for file in ${EXTRACT_ONLY}; do \ - if !(cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\ + if !(cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\ then \ exit 1; \ fi \ @@ -747,7 +775,7 @@ do-patch: .if defined(PATCHFILES) @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}" - @(cd ${DISTDIR}; \ + @(cd ${_DISTDIR}; \ for i in ${PATCHFILES}; do \ if [ ${PATCH_DEBUG_TMP} = yes ]; then \ ${ECHO_MSG} "===> Applying distribution patch $$i" ; \ @@ -938,7 +966,7 @@ /bin/sh ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \ fi .if make(real-install) && defined(_MANPAGES) && !defined(NOMANCOMPRESS) - @${ECHO_MSG} "===> Compressing the manual pages for ${PKGNAME}" + @${ECHO_MSG} "===> Compressing manual pages for ${PKGNAME}" .for manpage in ${_MANPAGES} @${GZIP_CMD} ${MANPREFIX}/${manpage} .endfor @@ -1088,10 +1116,10 @@ .if !target(distclean) distclean: pre-distclean clean @${ECHO_MSG} "===> Dist cleaning for ${PKGNAME}" - @(cd ${DISTDIR}; \ + @(cd ${_DISTDIR}; \ ${RM} -f ${DISTFILES} ${PATCHFILES}) .if defined(DIST_SUBDIR) - @${RMDIR} ${DISTDIR} + @${RMDIR} ${_DISTDIR} .endif .endif @@ -1099,8 +1127,8 @@ .if !target(fetch-list) fetch-list: - @if [ ! -d ${DISTDIR} ]; then ${MKDIR} ${DISTDIR}; fi - @(cd ${DISTDIR}; \ + @if [ ! -d ${_DISTDIR} ]; then ${MKDIR} ${_DISTDIR}; fi + @(cd ${_DISTDIR}; \ for file in ${DISTFILES}; do \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ for site in ${MASTER_SITES}; do \ @@ -1111,7 +1139,7 @@ fi \ done) .if defined(PATCHFILES) - @(cd ${DISTDIR}; \ + @(cd ${_DISTDIR}; \ for file in ${PATCHFILES}; do \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ for site in ${PATCH_SITES}; do \ @@ -1131,7 +1159,7 @@ @if [ ! -d ${FILESDIR} ]; then ${MKDIR} ${FILESDIR}; fi @if [ -f ${MD5_FILE} ]; then ${RM} -f ${MD5_FILE}; fi @(cd ${DISTDIR}; \ - for file in ${DISTFILES} ${PATCHFILES}; do \ + for file in ${ALLFILES}; do \ ${MD5} $$file >> ${MD5_FILE}; \ done) .endif @@ -1142,7 +1170,7 @@ ${ECHO_MSG} ">> No MD5 checksum file."; \ else \ (cd ${DISTDIR}; OK=""; \ - for file in ${DISTFILES} ${PATCHFILES}; do \ + for file in ${ALLFILES}; do \ CKSUM=`${MD5} < $$file`; \ CKSUM2=`${GREP} "($$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ if [ "$$CKSUM2" = "" ]; then \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611261252.EAA20502>