Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jul 1999 16:13:19 +0200 (CEST)
From:      Johan Karlsson <k@numeri.campus.luth.se>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/12548: New 'fecth-recursive(-list)' targets in ports
Message-ID:  <199907071413.QAA47170@numeri.campus.luth.se>

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

>Number:         12548
>Category:       ports
>Synopsis:       New 'fecth-recursive(-list)' targets in ports
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul  7 07:20:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Johan Karlsson
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:
	
	

>Description:
	Sometimes I would like to be able to fetch the distfiles 
	for a port AND all its dependencies before actually building.

	I have written a new target for the bsd.port.mk file which fetch
	all distfiles for the port and for all direct and indirect 
	dependencies. 

	This is usefull if you only have a modem connection to Internet 
	or for a mobile computer.
	eg.
		connect to Internet
		cd $(PORT)
		make fetch-recursive
		disconnect
		make all install

	In the target fetch-recursive I use 
	${MAKE} -k fetch
	to do the fetching. -k is used since I want the fetch to 
	continue even if there are some problems with one of the distfiles.
	eg.
	fetch for $(PORTS)/java/java-doc
		You have to fetch the documentation from
		    http://java.sun.com/products/jdk/1.1/docs.html

		Put jdk118-doc.tar.gz in in /usr/ports/distfiles/ and run make again.

		All this hassle is because of the license and export restrictions
		as described in
		    http://java.sun.com/feedback/faq/downloading.html

		*** Error code 1
	
	The user then only has to fetch the problematic ones manually.

	The targets 'fetch-recursive(-list)' should also be added to the
	bsd.port.subdir.mk file.

>How-To-Repeat:
>Fix:
Add the following to $(PORTS)/Mk/bsd.port.mk


# fetch-recursive		- Retrieves ${DISTFILES} (and ${PATCHFILES} if defined),
#						  for port and dependencies, into ${DISTDIR} as necessary.
# fetch-recursive-list	- Show list of files that would be 
#						  retrieved by fetch-recursive
fetch-recursive:
	@${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies"
	@setvar dirs "`${MAKE} all-depends-recursive-list`";\
		setvar dirs "${.CURDIR} $$dirs";\
		for dir in $$dirs; do\
			cd $$dir && ${MAKE} -k fetch;\
		done

fetch-recursive-list:
	@setvar dirs "`${MAKE} all-depends-recursive-list`";\
		setvar dirs "${.CURDIR} $$dirs";\
		for dir in $$dirs; do\
			cd $$dir && ${MAKE} fetch-list;\
		done


# Internal targets used by fetch-recursive(-list)
all-depends-list:
	@setvar builddirs "`${MAKE} build-depends-list`";\
		setvar rundirs "`${MAKE} run-depends-list`";\
		setvar dirs "`${ECHO} $$builddirs $$rundirs`";\
		${ECHO} $$dirs

all-depends-recursive-list:
	@setvar dirs "";\
		setvar _dirs "`${MAKE} all-depends-list`";\
		while [ "$$_dirs" ]; do\
			setvar __dirs "$$_dirs";\
			setvar _dirs "";\
			for dir in $$__dirs; do\
				if ! (echo $$dirs | grep $$dir)>/dev/null; then\
					setvar dirs "$$dirs $$dir";\
					setvar _dirs "$$_dirs `cd $$dir && ${MAKE} all-depends-list`";\
				fi;\
			done;\
		done;\
		${ECHO} $$dirs



>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?199907071413.QAA47170>