Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 May 2002 20:36:23 -0400
From:      The Anarcat <anarcat@anarcat.dyndns.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        anarcat@anarcat.dyndns.org
Subject:   ports/37809: make index target fails on read-only /usr/ports
Message-ID:  <20020507003720.5803D64@shall.anarcat.dyndns.org>

next in thread | raw e-mail | index | archive | help

>Number:         37809
>Category:       ports
>Synopsis:       make index target fails on read-only /usr/ports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 06 17:40:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     The Anarcat
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Nada, Inc.
>Environment:
System: FreeBSD lenny.anarcat.dyndns.org 4.5-STABLE FreeBSD 4.5-STABLE #1: Tue Apr 30 18:11:04 EDT 2002 anarcat@lenny.anarcat.dyndns.org:/usr/obj/usr/src/sys/LENNY i386

>Description:

make index is a pretty cpu and disk intensive activity. In some setups,
a simple file server is used to serve a ports tree as read-only, and a
more powerful machine is setup as the build machine.

Well, in my setup anyways. :)

The make index target doesn't really take this into account and
hardcodes the path to the INDEX file.

>How-To-Repeat:

mount -r /usr/porst
make index

>Fix:

This patch "works" here, but I'm not sure it is correct since it
discards all .CURDIR in favor of PORTSDIR.

While I'm here, %s#${.CURDIR}/INDEX#${INDEXFILE}#g

If the latter is not appropriate, only patch the index and ${INDEXFILE}
target, and everything should be merry.

--- /usr/ports/Makefile	Sun Dec 23 05:58:42 2001
+++ Makefile	Mon May  6 20:15:50 2002
@@ -56,26 +56,28 @@
 
 .include <bsd.port.subdir.mk>
 
+INDEXFILE?=${PORTSDIR}/INDEX
+
 index:
-	@rm -f ${.CURDIR}/INDEX
-	@cd ${.CURDIR} && make ${.CURDIR}/INDEX
+	@rm -f ${INDEXFILE}
+	@cd ${.CURDIR} && make ${INDEXFILE}
 
-${.CURDIR}/INDEX:
+${INDEXFILE}:
 	@echo -n "Generating INDEX - please wait.."
-	@cd ${.CURDIR} && make describe ECHO_MSG="echo > /dev/null" | \
-		perl ${.CURDIR}/Tools/make_index > ${.CURDIR}/INDEX
+	@cd ${PORTSDIR} && make describe ECHO_MSG="echo > /dev/null" | \
+		perl ${PORTSDIR}/Tools/make_index > ${INDEXFILE}
 .if !defined(INDEX_NOSORT)
-	@sed -e 's./..g' ${.CURDIR}/INDEX | \
+	@sed -e 's./..g' ${INDEXFILE} | \
 		sort -t '|' +1 -2 | \
-		sed -e 's../.g' > ${.CURDIR}/INDEX.tmp
-	@mv -f ${.CURDIR}/INDEX.tmp ${.CURDIR}/INDEX
+		sed -e 's../.g' > ${INDEXFILE}.tmp
+	@mv -f ${INDEXFILE}.tmp ${INDEXFILE}
 .endif
 	@echo " Done."
 
-print-index:	${.CURDIR}/INDEX
-	@awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }' < ${.CURDIR}/INDEX
+print-index:	${INDEXFILE}
+	@awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }' < ${INDEXFILE}
 
-parallel: ${.CURDIR}/INDEX
+parallel: ${INDEXFILE}
 .if !defined(branch)
 	@echo "The parallel target requires a branch parameter,"
 	@echo "e.g.: \"make parallel branch=X\""
@@ -84,7 +86,7 @@
 .for dir in ${SUBDIR}
 	@echo "all: ${dir}-all"
 .endfor
-	@awk -F '|' '{me=$$1; here=$$2; bdep=$$8; rdep=$$9; split(here, tmp, "/"); if (bdep != "") { gsub("$$", ".tgz", bdep); gsub(" ", ".tgz ", bdep); } if (rdep != "") { gsub("$$", ".tgz", rdep); gsub(" ", ".tgz ", rdep); } print tmp[4] "-all: " me ".tgz"; print me ": " me ".tgz"; print me ".tgz: " bdep " " rdep; printf("\t@/var/portbuild/scripts/pdispatch ${branch} /var/portbuild/scripts/portbuild %s.tgz %s", me, here); if (bdep != "") printf(" %s", bdep); if (rdep != "") printf(" %s", rdep); printf("\n")}' < ${.CURDIR}/INDEX
+	@awk -F '|' '{me=$$1; here=$$2; bdep=$$8; rdep=$$9; split(here, tmp, "/"); if (bdep != "") { gsub("$$", ".tgz", bdep); gsub(" ", ".tgz ", bdep); } if (rdep != "") { gsub("$$", ".tgz", rdep); gsub(" ", ".tgz ", rdep); } print tmp[4] "-all: " me ".tgz"; print me ": " me ".tgz"; print me ".tgz: " bdep " " rdep; printf("\t@/var/portbuild/scripts/pdispatch ${branch} /var/portbuild/scripts/portbuild %s.tgz %s", me, here); if (bdep != "") printf(" %s", bdep); if (rdep != "") printf(" %s", rdep); printf("\n")}' < ${INDEXFILE}
 
 CVS?= cvs
 .if defined(SUPHOST)
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020507003720.5803D64>