head	1.26;
access;
symbols
	pkgsrc-2014Q1:1.25.0.54
	pkgsrc-2014Q1-base:1.25
	pkgsrc-2013Q4:1.25.0.52
	pkgsrc-2013Q4-base:1.25
	pkgsrc-2013Q3:1.25.0.50
	pkgsrc-2013Q3-base:1.25
	pkgsrc-2013Q2:1.25.0.48
	pkgsrc-2013Q2-base:1.25
	pkgsrc-2013Q1:1.25.0.46
	pkgsrc-2013Q1-base:1.25
	pkgsrc-2012Q4:1.25.0.44
	pkgsrc-2012Q4-base:1.25
	pkgsrc-2012Q3:1.25.0.42
	pkgsrc-2012Q3-base:1.25
	pkgsrc-2012Q2:1.25.0.40
	pkgsrc-2012Q2-base:1.25
	pkgsrc-2012Q1:1.25.0.38
	pkgsrc-2012Q1-base:1.25
	pkgsrc-2011Q4:1.25.0.36
	pkgsrc-2011Q4-base:1.25
	pkgsrc-2011Q3:1.25.0.34
	pkgsrc-2011Q3-base:1.25
	pkgsrc-2011Q2:1.25.0.32
	pkgsrc-2011Q2-base:1.25
	pkgsrc-2011Q1:1.25.0.30
	pkgsrc-2011Q1-base:1.25
	pkgsrc-2010Q4:1.25.0.28
	pkgsrc-2010Q4-base:1.25
	pkgsrc-2010Q3:1.25.0.26
	pkgsrc-2010Q3-base:1.25
	pkgsrc-2010Q2:1.25.0.24
	pkgsrc-2010Q2-base:1.25
	pkgsrc-2010Q1:1.25.0.22
	pkgsrc-2010Q1-base:1.25
	pkgsrc-2009Q4:1.25.0.20
	pkgsrc-2009Q4-base:1.25
	pkgsrc-2009Q3:1.25.0.18
	pkgsrc-2009Q3-base:1.25
	pkgsrc-2009Q2:1.25.0.16
	pkgsrc-2009Q2-base:1.25
	pkgsrc-2009Q1:1.25.0.14
	pkgsrc-2009Q1-base:1.25
	pkgsrc-2008Q4:1.25.0.12
	pkgsrc-2008Q4-base:1.25
	pkgsrc-2008Q3:1.25.0.10
	pkgsrc-2008Q3-base:1.25
	cube-native-xorg:1.25.0.8
	cube-native-xorg-base:1.25
	pkgsrc-2008Q2:1.25.0.6
	pkgsrc-2008Q2-base:1.25
	cwrapper:1.25.0.4
	pkgsrc-2008Q1:1.25.0.2
	pkgsrc-2008Q1-base:1.25
	pkgsrc-2007Q4:1.24.0.10
	pkgsrc-2007Q4-base:1.24
	pkgsrc-2007Q3:1.24.0.8
	pkgsrc-2007Q3-base:1.24
	pkgsrc-2007Q2:1.24.0.6
	pkgsrc-2007Q2-base:1.24
	pkgsrc-2007Q1:1.24.0.4
	pkgsrc-2007Q1-base:1.24
	jlam-pkgviews:1.24.0.2
	jlam-pkgviews-base:1.24
	pkgsrc-2006Q4:1.23.0.8
	pkgsrc-2006Q4-base:1.23
	pkgsrc-2006Q3:1.23.0.6
	pkgsrc-2006Q3-base:1.23
	pkgsrc-2006Q2:1.23.0.4
	pkgsrc-2006Q2-base:1.23
	tv-derecurse-eol:1.15.8.1
	pkgsrc-2006Q1:1.23.0.2
	pkgsrc-2006Q1-base:1.23
	pkgsrc-2005Q4:1.21.0.2
	pkgsrc-2005Q4-base:1.21
	pkgsrc-2005Q3:1.17.0.4
	pkgsrc-2005Q3-base:1.17
	pkgsrc-2005Q2:1.17.0.2
	pkgsrc-2005Q2-base:1.17
	tv-derecurse-merge:1.17
	pkgsrc-2005Q1:1.15.0.12
	pkgsrc-2005Q1-base:1.15
	pkgsrc-2004Q4:1.15.0.10
	pkgsrc-2004Q4-base:1.15
	tv-derecurse:1.15.0.8
	tv-derecurse-base:1.15
	pkgsrc-2004Q3:1.15.0.6
	pkgsrc-2004Q3-base:1.15
	pkgsrc-2004Q2:1.15.0.4
	pkgsrc-2004Q2-base:1.15
	pkgsrc-2004Q1:1.15.0.2
	pkgsrc-2004Q1-base:1.15
	pkgsrc-2003Q4:1.11.0.6
	pkgsrc-2003Q4-base:1.11
	pkgviews-mk:1.11.0.4
	pkgviews-mk-base:1.11
	netbsd-1-6-1:1.11.0.2
	netbsd-1-6-1-base:1.11
	netbsd-1-6:1.10.0.4
	netbsd-1-6-RELEASE-base:1.10
	pkgviews:1.9.0.4
	pkgviews-base:1.11
	buildlink2:1.9.0.2
	buildlink2-base:1.10
	netbsd-1-5-PATCH003:1.9
	netbsd-1-5-PATCH001:1.6
	netbsd-1-5-RELEASE:1.2
	netbsd-1-4-PATCH003:1.2;
locks; strict;
comment	@# @;


1.26
date	2014.06.02.10.24.05;	author wiz;	state dead;
branches;
next	1.25;
commitid	I50hUg08qEFcZVCx;

1.25
date	2008.01.04.15.49.08;	author rillig;	state Exp;
branches;
next	1.24;

1.24
date	2007.01.08.21.36.07;	author rillig;	state Exp;
branches;
next	1.23;

1.23
date	2006.01.15.23.33.23;	author rillig;	state Exp;
branches;
next	1.22;

1.22
date	2005.12.31.02.06.10;	author minskim;	state Exp;
branches;
next	1.21;

1.21
date	2005.11.28.01.22.53;	author rillig;	state Exp;
branches;
next	1.20;

1.20
date	2005.11.16.22.18.03;	author rillig;	state Exp;
branches;
next	1.19;

1.19
date	2005.11.14.20.58.12;	author rillig;	state Exp;
branches;
next	1.18;

1.18
date	2005.11.05.10.14.43;	author rillig;	state Exp;
branches;
next	1.17;

1.17
date	2005.05.09.16.03.58;	author kristerw;	state Exp;
branches;
next	1.16;

1.16
date	2005.05.03.16.34.02;	author jlam;	state Exp;
branches;
next	1.15;

1.15
date	2004.02.25.09.20.59;	author grant;	state Exp;
branches
	1.15.8.1;
next	1.14;

1.14
date	2004.01.30.10.54.36;	author grant;	state Exp;
branches;
next	1.13;

1.13
date	2004.01.17.03.39.35;	author grant;	state Exp;
branches;
next	1.12;

1.12
date	2003.12.10.13.59.06;	author sketch;	state Exp;
branches;
next	1.11;

1.11
date	2002.08.22.08.21.31;	author jlam;	state Exp;
branches;
next	1.10;

1.10
date	2002.08.07.10.56.12;	author agc;	state Exp;
branches;
next	1.9;

1.9
date	2001.10.14.20.34.53;	author dmcmahill;	state Exp;
branches
	1.9.2.1;
next	1.8;

1.8
date	2001.10.12.19.28.02;	author hubertf;	state Exp;
branches;
next	1.7;

1.7
date	2001.07.13.15.14.57;	author dmcmahill;	state Exp;
branches;
next	1.6;

1.6
date	2001.02.17.16.45.10;	author wiz;	state Exp;
branches;
next	1.5;

1.5
date	2001.02.01.08.28.07;	author dmcmahill;	state Exp;
branches;
next	1.4;

1.4
date	2000.12.29.15.56.26;	author dmcmahill;	state Exp;
branches;
next	1.3;

1.3
date	2000.11.18.07.30.25;	author hubertf;	state Exp;
branches;
next	1.2;

1.2
date	2000.09.21.16.53.14;	author hubertf;	state Exp;
branches;
next	1.1;

1.1
date	2000.09.15.22.05.47;	author hubertf;	state Exp;
branches;
next	;

1.15.8.1
date	2005.05.17.18.29.45;	author tv;	state Exp;
branches;
next	1.15.8.2;

1.15.8.2
date	2006.06.07.15.25.39;	author tv;	state dead;
branches;
next	;

1.9.2.1
date	2002.08.21.05.19.50;	author jlam;	state Exp;
branches;
next	1.9.2.2;

1.9.2.2
date	2002.08.21.22.01.37;	author jlam;	state Exp;
branches;
next	;


desc
@@


1.26
log
@Remove old bulk build code. Use pbulk.
@
text
@#!/bin/sh
# $NetBSD: printdepends,v 1.25 2008/01/04 15:49:08 rillig Exp $
#

# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@@NetBSD.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#      This product includes software developed by Hubert Feyrer for
#	the NetBSD Project.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

# usage: printdepends [brokenfile [bulkfilesdir]]
#
# Generates a list of package dependencies suitable for tsort(1) on
# stdout. Each line of the output has two fields: the package directory
# of the dependency and the package directory of the depending package
# (both in the form category/package).
#
# If <brokenfile> is given, package-specific errors are logged to
# <bulkfilesdir>/${pkgdir}/<brokenfile>. Otherwise no additional logging
# takes place.
#
# The default for <bulkfilesdir> is the pkgsrc directory itself. If
# <bulkfilesdir> differs from the pkgsrc directory, all directories
# that are needed for the log files are created automatically.
#
# Note: printdepends must be called from a pkgsrc root directory.

set -e

# Pull in PKGLIST
if [ -f "$BULK_BUILD_CONF" ]; then
	. $BULK_BUILD_CONF
else
	. `dirname $0`/build.conf
fi

#
# Global variables
#

# The brokenfile_flag variable tells whether we want package-specific
# log files at all. If it is set to "yes", the mkdirs_flag
# variable tells whether the directories of the package-specific log
# files are created if necessary.
brokenfile_flag="yes"
mkdirs_flag="no"
pkgsrcdir="${PWD}"
bulkfilesdir="${pkgsrcdir}"
brokenfile=""

#
# Command line parsing
#

case $# in
0)	brokenfile_flag="no"
	;;
1)	brokenfile="$1"
	;;
2)	brokenfile="$1"
	bulkfilesdir="$2"
	if [ "${bulkfilesdir}" != "${pkgsrcdir}" ]; then
		mkdirs_flag="yes"
	fi
	;;
*)	echo "usage: $0 [brokenfile [bulkfilesdir]]" 1>&2
	exit 1
	;;
esac

#
# Sanity checks
#

case ${BMAKE-""} in
"")	echo "$0: error: BMAKE must be set and non-empty." 1>&2
	exit 1;;
esac
case ${bulkfilesdir} in
/*)	;;
*)	echo "$0: error: The <bulkfilesdir> argument must be absolute." 1>&2
	exit 1;;
esac
case ${brokenfile} in
*/*)	echo "$0: error: The <brokenfile> argument must not contain a slash." 1>&2
	exit 1;;
esac

#
# Get additional system information
#

cd "${pkgsrcdir}/pkgtools/lintpkgsrc"
GREP=`${BMAKE} show-var VARNAME=GREP USE_TOOLS=grep`
MKDIR=`${BMAKE} show-var VARNAME=MKDIR USE_TOOLS=mkdir`
SED=`${BMAKE} show-var VARNAME=SED USE_TOOLS=sed`
cd "${pkgsrcdir}"

case $mkdirs_flag in
yes)	mkbulkdir="${MKDIR}";;
*)	mkbulkdir=":";;
esac

case ${PKGLIST} in
"")	# List of all packages, from pkgsrc/*/Makefile
	list=`${GREP} '^SUBDIR+=' */Makefile | ${GREP} -v '^regress/' | ${SED} -e 's,/Makefile:SUBDIR+=[[:space:]]*,/,' -e 's,#.*,,'`
	;;
*)	list="${PKGLIST}"
	;;
esac

for pkgdir in $list; do
	if cd "${pkgsrcdir}/${pkgdir}"; then
		if deps=`${BMAKE} show-depends-dirs`; then
			case ${deps} in
			"")	# Make the package depend on itself.
				# Otherwise it would not show up in the
				# dependency graph.
				echo "${pkgdir} ${pkgdir}";;
			*)	for dep in $deps; do
					echo "${dep} ${pkgdir}"
				done;;
			esac
		else
			echo "$0: error: could not extract dependencies for ${pkgdir} -- skipping." 1>&2

			[ $brokenfile_flag = yes ] || continue

			${mkbulkdir} "${bulkfilesdir}/${pkgdir}"
			{ echo "[printdepends] command failed: ${BMAKE} show-depends-dirs"
			  ( ${BMAKE} show-depends-dirs
			  ) || true
			} >> "${bulkfilesdir}/${pkgdir}/${brokenfile}" 2>&1
		fi
	else
		${mkbulkdir} "${bulkfilesdir}"
		{ echo "[printdepends] command failed: cd ${pkgsrcdir}/${pkgdir}"
		  ( cd "${pkgsrcdir}/${pkgdir}"
		  ) || true
		} 1>&2
	fi
done
@


1.25
log
@Replaced all references to pkglint with lintpkgsrc, which has its own
package since a few days.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.24 2007/01/08 21:36:07 rillig Exp $
@


1.24
log
@Shortened the code.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.23 2006/01/15 23:33:23 rillig Exp $
d115 1
a115 1
cd "${pkgsrcdir}/pkgtools/pkglint"
@


1.23
log
@Allow "=" characters to appear in a line that comments out a package in a
category Makefile. Adjusted the other regular expressions to express more
clearly what is meant.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.22 2005/12/31 02:06:10 minskim Exp $
d149 1
a149 3
			case $brokenfile_flag in
			no)	continue;;
			esac
@


1.22
log
@Fix a typo (show-depends-dir -> show-depends-dirs).
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.21 2005/11/28 01:22:53 rillig Exp $
d128 1
a128 1
	list=`${GREP} '^[[:space:]]*'SUBDIR */Makefile | ${GREP} -v regress/ | ${SED} 's,/Makefile.*=[[:space:]]*,/,'`
@


1.21
log
@- Since printindex does not use the .pkglist cache anymore, this program
  does not need to create it.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.20 2005/11/16 22:18:03 rillig Exp $
d154 1
a154 1
			{ echo "[printdepends] command failed: ${BMAKE} show-depends-dir"
@


1.20
log
@Made printdepends very similar to printindex, as both iterate over all
pkgsrc packages, collecting different information.

- BMAKE is taken from the environment instead of querying `uname -s`.
- package-specific log files can be saved in a directory tree different
  from PKGSRCDIR.
- Added sanity checks for BMAKE, bulkfilesdir and brokenfile.
- The .pkglist cache is saved in ${BULKFILESDIR} instead of ${PKGSRCDIR}.
- Reformatted the diagnostics.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.19 2005/11/14 20:58:12 rillig Exp $
a133 4
# cache the package list for printindex
${mkbulkdir} "${bulkfilesdir}"
echo list='"'${list}'"' > "${bulkfilesdir}/.pkglist"

@


1.19
log
@Removed the code for printing progress information again, as printindex
is mostly used in batch mode. Impatient users should count the number of
lines in the output file if they can't wait.
@
text
@d2 2
a3 1
# $NetBSD: printdepends,v 1.18 2005/11/05 10:14:43 rillig Exp $
a4 1
#
d33 1
d35 4
a38 2
# Print list of pkg dependencies suitable for tsort(1).
# Start in $USR_PKGSRC.
d40 3
a42 2
# If an argument is given, use it as a file name
# to contain any failure messages in each package directory.
d44 7
d59 3
a61 5
if [ ! -z "$1" ]; then
	brokenfile=$1
else
	brokenfile=/dev/null
fi
d63 28
a90 4
opsys=`uname -s`
case "$opsys" in
NetBSD)	BMAKE=make ;;
*)	BMAKE=bmake ;;
d93 3
a95 1
export BMAKE
d97 17
a113 2
# $USR_PKGSRC
cwd=$PWD
d115 1
a115 2
# get some initial variables
cd $cwd/pkgtools/pkglint
d117 1
d119 6
a124 1
cd $cwd
d126 2
a127 4
if [ -n "${PKGLIST}" ]; then
	list="${PKGLIST}"
else
	# List of all pkgs, from pkgsrc/*/Makefile
d129 4
a132 1
fi
d135 2
a136 1
echo list='"'${list}'"' > .pkglist
d138 12
a149 16
for pkgdir in $list
do
	if [ ! -d $pkgdir ]; then
		echo "WARNING:  the package directory $pkgdir is listed in" > /dev/stderr
		echo $pkgdir | ${SED} 's;/.*;/Makefile;g' > /dev/stderr
		echo "but the directory does not exist.  Please fix this!" > /dev/stderr
	else
		l=`cd $pkgdir && ${BMAKE} show-depends-dirs`
		if [ $? != 0 ]; then
			echo "WARNING (printdepends):  the package in $pkgdir had problem with" > /dev/stderr
			echo "    ${BMAKE} show-depends-dirs" > /dev/stderr
			echo "    dependency information in the cache will" > /dev/stderr
			echo "    be dropped for $pkgdir" > /dev/stderr
			echo "${BMAKE} show-depends-dirs failed:" > $brokenfile
			${BMAKE} show-depends-dirs  >> $brokenfile 2>&1
			echo "$pkgdir $pkgdir"
d151 11
a161 9
			if [ "$l" = "" ]; then
				# No dependencies
				echo "$pkgdir $pkgdir"
			else
				for depdir in $l
				do
					echo "$depdir $pkgdir"
				done
			fi
d163 6
@


1.18
log
@As the printdepends program takes quite a long time, every 50 packages a
status line is printed on stderr to get an impression about how the
program gets along.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.17 2005/05/09 16:03:58 kristerw Exp $
a80 9
pkgbar=""
for i in $list; do
  pkgbar="${pkgbar} a"
done
npackages=`echo "$pkgbar" | wc -w`
npackages=`echo $npackages`

cpackages=0
cpackages_mod_50=""
a108 7
	cpackages_mod_50="${cpackages_mod_50}+";
	case $cpackages_mod_50 in
	++++++++++++++++++++++++++++++++++++++++++++++++++)
		cpackages_mod_50=""
		cpackages=`expr $cpackages + 50`
		echo "${cpackages} of ${npackages} packages finished." 1>&2;;
	esac
@


1.17
log
@Do not add the things in pkgsrc/regress to the bulk build since they
are not meant to be built -- regress testing is done using the
pkgtools/pkg_regress tool.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.16 2005/05/03 16:34:02 jlam Exp $
d81 9
d97 1
a97 3
		cd $pkgdir

		l=`${BMAKE} show-depends-dirs`
d118 7
a124 1
	cd $cwd
@


1.16
log
@Teach the bulk build scripts about the new tools framework.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.15 2004/02/25 09:20:59 grant Exp $
d75 1
a75 1
	list=`${GREP} '^[[:space:]]*'SUBDIR */Makefile | ${SED} 's,/Makefile.*=[[:space:]]*,/,'`
@


1.15
log
@s/netbsd.org/NetBSD.org/
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.14 2004/01/30 10:54:36 grant Exp $
d67 2
a68 2
GREP=`${BMAKE} show-var VARNAME=GREP`
SED=`${BMAKE} show-var VARNAME=SED`
@


1.15.8.1
log
@sync [all but bsd.pkg.mk] with HEAD
@
text
@d2 1
a2 1
# $NetBSD$
d67 2
a68 2
GREP=`${BMAKE} show-var VARNAME=GREP USE_TOOLS=grep`
SED=`${BMAKE} show-var VARNAME=SED USE_TOOLS=sed`
d75 1
a75 1
	list=`${GREP} '^[[:space:]]*'SUBDIR */Makefile | ${GREP} -v regress/ | ${SED} 's,/Makefile.*=[[:space:]]*,/,'`
@


1.15.8.2
log
@EOL the tv-derecurse branch; it has become too outdated.  The last live
revision can be fetched at the tv-derecurse-eol tag.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.15.8.1 2005/05/17 18:29:45 tv Exp $
@


1.14
log
@allow the user to set the packages to build in build.conf (PKGLIST).

cache the list in printdepends so that printindex doesn't need to
run the same command(s) again at the start of a bulk build.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.13 2004/01/17 03:39:35 grant Exp $
d5 1
a5 1
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@@netbsd.org>
@


1.13
log
@use GREP and SED as set by defs.opsys.mk so this works on non-NetBSD.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.12 2003/12/10 13:59:06 sketch Exp $
d41 7
d71 9
a79 5
# List of all pkgs, from pkgsrc/*/Makefile
list=`${GREP} '^[[:space:]]*'SUBDIR */Makefile | ${SED} 's,/Makefile.*=[[:space:]]*,/,'`
#list=`${GREP} '^[^#].*'SUBDIR ma*/Makefile | ${SED} 's,/Makefile.*= *,/,'`
#list=x11/gnome
#list='x11/xteddy x11/xsnow'
@


1.12
log
@Replace hardcoded '/usr/pkgsrc' in comments.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.11 2002/08/22 08:21:31 jlam Exp $
d47 8
d58 6
d65 2
a66 2
 list=`grep '^[[:space:]]*'SUBDIR */Makefile | sed 's,/Makefile.*=[[:space:]]*,/,'`
#list=`grep '^[^#].*'SUBDIR ma*/Makefile | sed 's,/Makefile.*= *,/,'`
d74 1
a74 1
		echo $pkgdir | sed 's;/.*;/Makefile;g' > /dev/stderr
a101 1

@


1.11
log
@Merge pkgsrc/mk from the buildlink2 branch back into the main trunk.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.9.2.2 2002/08/21 22:01:37 jlam Exp $
d35 1
a35 1
# Start in /usr/pkgsrc.
d47 1
a47 1
# /usr/pkgsrc
@


1.10
log
@Make these scripts useful on platforms other than NetBSD by using a BMAKE
environment variable, which contains the name of the make(1) program to
invoke - suggestion by Julien Letessier some time ago, the confusion mine,
since I thought he was referring to something else completely.

Don't rely on there being a POSIX tr(1) in the path by default - test
explicitly for both "yes" and "YES".

Set the default for PRUNEDISTFILES to "no", since we can't assume that
the user wants us to delete something which he may have been keeping
around, and there are other ways of accomplishing this aim (lintpkgsrc
-o, for example).

Clean up some superfluous white space at the end of lines.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.9 2001/10/14 20:34:53 dmcmahill Exp $
@


1.9
log
@add some more failure checks for robustness.

- if something fails while extracting the DEPENDS for a particular package,
  mark that package as broken and drop the DEPENDS info for it.  This allows
  the build to continue and properly marks the package as broken.

- if something fails while extracting the PKGNAME, also mark the pkg as broken.

- be more careful about seeing if directories exist before cd'ing to them.
  Lack of such a test has caused problems elsewhere, so hopefully this will
  make the system more robust.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.8 2001/10/12 19:28:02 hubertf Exp $
d65 1
a65 1
		l=`make show-depends-dirs`
d68 1
a68 1
			echo "    make show-depends-dirs" > /dev/stderr
d71 2
a72 2
			echo "make show-depends-dirs failed:" > $brokenfile
			make show-depends-dirs  >> $brokenfile 2>&1
@


1.9.2.1
log
@Merge pkgsrc/mk from pkgsrc-current into the buildlink2 branch.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.10 2002/08/07 10:56:12 agc Exp $
d65 1
a65 1
		l=`${BMAKE} show-depends-dirs`
d68 1
a68 1
			echo "    ${BMAKE} show-depends-dirs" > /dev/stderr
d71 2
a72 2
			echo "${BMAKE} show-depends-dirs failed:" > $brokenfile
			${BMAKE} show-depends-dirs  >> $brokenfile 2>&1
@


1.9.2.2
log
@Merge conflicts.
@
text
@@


1.8
log
@Change my non-standard copyright header to a BSD-style one.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.7 2001/07/13 15:14:57 dmcmahill Exp $
d37 9
d66 7
a72 2
		if [ "$l" = "" ]; then
			# No dependencies
d75 9
a83 4
			for depdir in $l
			do
				echo "$depdir $pkgdir"
			done
@


1.7
log
@if a package subdirectory is listed in the category makefile, but doesn't
exist, then spit out a big warning to stderr (since we often capture stdout
for other purposes) and don't try and descend to that directory.
@
text
@d2 31
a32 1
# $NetBSD: printdepends,v 1.6 2001/02/17 16:45:10 wiz Exp $
a35 3
#
# (c) Copyright 2000 Hubert Feyrer <hubertf@@netbsd.org>.
#     All rights reserved.
@


1.6
log
@Handle new category-Makefile format
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.5 2001/02/01 08:28:07 dmcmahill Exp $
d22 6
a27 1
	cd $pkgdir
d29 10
a38 9
	l=`make show-depends-dirs`
	if [ "$l" = "" ]; then
		# No dependencies
		echo "$pkgdir $pkgdir"
	else
		for depdir in $l
		do
			echo "$depdir $pkgdir"
		done
@


1.5
log
@take advantage of new target in bsd.pkg.mk to simplify the script and be
sure to not miss libtool depends.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.4 2000/12/29 15:56:26 dmcmahill Exp $
d15 1
a15 1
 list=`grep '^[^#].*'SUBDIR */Makefile | sed 's,/Makefile.*= *,/,'`
a18 1

@


1.4
log
@add hostname and pid to the temp makefile name to avoid conflicts when
pkgsrc is shared via nfs where multiple machines may want to run the script
at the same time.  Also avoid conflicts if multiple copies are run on the
same machine at once.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.3 2000/11/18 07:30:25 hubertf Exp $
a19 9
mf=$cwd/.m.`hostname`.$$
# Makefile to print the DEPENDS' and BUILD_DEPENDS' directory parts
# bsd.pkg.mk is pulled in via the Makefile
cat >$mf <<EOF
bla:
	@@echo \${DEPENDS:C/^[^:]*://:C/:.*$//} \${BUILD_DEPENDS:C/^[^:]*://:C/:.*$//}
.include "Makefile"
EOF

d25 1
a25 1
	l=`make -f - <$mf bla`	# XXX NOT -f $mf !
d30 1
a30 1
		for reldir in $l
d32 1
a32 5
			cd $reldir
			d=`dirname $PWD`
			absdir=`basename $d`/`basename $PWD`
			cd -
			echo "$absdir $pkgdir"
a37 1
rm -f $mf
@


1.3
log
@Unconditionally step back out of the dir that we went in before.
(How did this EVER work before?!?)
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.2 2000/09/21 16:53:14 hubertf Exp $
d20 1
a20 1

d23 1
a23 1
cat >$cwd/.m <<EOF
d34 1
a34 1
	l=`make -f - <$cwd/.m bla`	# XXX NOT -f $cwd/.m !
d51 1
a51 1
rm -f $cwd/.m
@


1.2
log
@Print pkgs with no dependencies as depending on themselves, as they
don't get built.
@
text
@d2 1
a2 1
# $NetBSD: printdepends,v 1.1 2000/09/15 22:05:47 hubertf Exp $
a46 1
		cd $cwd
d48 1
@


1.1
log
@Bulk build framework
@
text
@d2 1
a2 1
# $NetBSD$
d18 1
d34 15
a48 9
	for reldir in `make -f - <$cwd/.m bla`	# XXX
	do
		cd $reldir
		d=`dirname $PWD`
		absdir=`basename $d`/`basename $PWD`
		cd -
		echo "$absdir $pkgdir"
	done
	cd $cwd
@

