head 1.15; access; symbols netbsd-11-0-RC4:1.15 netbsd-11-0-RC3:1.15 netbsd-11-0-RC2:1.15 netbsd-11-0-RC1:1.15 perseant-exfatfs-base-20250801:1.15 netbsd-11:1.15.0.102 netbsd-11-base:1.15 netbsd-10-1-RELEASE:1.15 perseant-exfatfs-base-20240630:1.15 perseant-exfatfs:1.15.0.100 perseant-exfatfs-base:1.15 netbsd-8-3-RELEASE:1.15 netbsd-9-4-RELEASE:1.15 netbsd-10-0-RELEASE:1.15 netbsd-10-0-RC6:1.15 netbsd-10-0-RC5:1.15 netbsd-10-0-RC4:1.15 netbsd-10-0-RC3:1.15 netbsd-10-0-RC2:1.15 netbsd-10-0-RC1:1.15 netbsd-10:1.15.0.98 netbsd-10-base:1.15 netbsd-9-3-RELEASE:1.15 cjep_sun2x-base1:1.15 cjep_sun2x:1.15.0.96 cjep_sun2x-base:1.15 cjep_staticlib_x-base1:1.15 netbsd-9-2-RELEASE:1.15 cjep_staticlib_x:1.15.0.94 cjep_staticlib_x-base:1.15 netbsd-9-1-RELEASE:1.15 phil-wifi-20200421:1.15 phil-wifi-20200411:1.15 is-mlppp:1.15.0.92 is-mlppp-base:1.15 phil-wifi-20200406:1.15 netbsd-8-2-RELEASE:1.15 netbsd-9-0-RELEASE:1.15 netbsd-9-0-RC2:1.15 netbsd-9-0-RC1:1.15 phil-wifi-20191119:1.15 netbsd-9:1.15.0.90 netbsd-9-base:1.15 phil-wifi-20190609:1.15 netbsd-8-1-RELEASE:1.15 netbsd-8-1-RC1:1.15 pgoyette-compat-merge-20190127:1.15 pgoyette-compat-20190127:1.15 pgoyette-compat-20190118:1.15 pgoyette-compat-1226:1.15 pgoyette-compat-1126:1.15 pgoyette-compat-1020:1.15 pgoyette-compat-0930:1.15 pgoyette-compat-0906:1.15 netbsd-7-2-RELEASE:1.15 pgoyette-compat-0728:1.15 netbsd-8-0-RELEASE:1.15 phil-wifi:1.15.0.88 phil-wifi-base:1.15 pgoyette-compat-0625:1.15 netbsd-8-0-RC2:1.15 pgoyette-compat-0521:1.15 pgoyette-compat-0502:1.15 pgoyette-compat-0422:1.15 netbsd-8-0-RC1:1.15 pgoyette-compat-0415:1.15 pgoyette-compat-0407:1.15 pgoyette-compat-0330:1.15 pgoyette-compat-0322:1.15 pgoyette-compat-0315:1.15 netbsd-7-1-2-RELEASE:1.15 pgoyette-compat:1.15.0.86 pgoyette-compat-base:1.15 netbsd-7-1-1-RELEASE:1.15 matt-nb8-mediatek:1.15.0.84 matt-nb8-mediatek-base:1.15 perseant-stdc-iso10646:1.15.0.82 perseant-stdc-iso10646-base:1.15 netbsd-8:1.15.0.80 netbsd-8-base:1.15 prg-localcount2-base3:1.15 prg-localcount2-base2:1.15 prg-localcount2-base1:1.15 prg-localcount2:1.15.0.78 prg-localcount2-base:1.15 pgoyette-localcount-20170426:1.15 bouyer-socketcan-base1:1.15 pgoyette-localcount-20170320:1.15 netbsd-7-1:1.15.0.76 netbsd-7-1-RELEASE:1.15 netbsd-7-1-RC2:1.15 netbsd-7-nhusb-base-20170116:1.15 bouyer-socketcan:1.15.0.74 bouyer-socketcan-base:1.15 pgoyette-localcount-20170107:1.15 netbsd-7-1-RC1:1.15 pgoyette-localcount-20161104:1.15 netbsd-7-0-2-RELEASE:1.15 localcount-20160914:1.15 netbsd-7-nhusb:1.15.0.72 netbsd-7-nhusb-base:1.15 pgoyette-localcount-20160806:1.15 pgoyette-localcount-20160726:1.15 pgoyette-localcount:1.15.0.70 pgoyette-localcount-base:1.15 netbsd-7-0-1-RELEASE:1.15 netbsd-7-0:1.15.0.68 netbsd-7-0-RELEASE:1.15 netbsd-7-0-RC3:1.15 netbsd-7-0-RC2:1.15 netbsd-7-0-RC1:1.15 netbsd-5-2-3-RELEASE:1.15 netbsd-5-1-5-RELEASE:1.15 netbsd-6-0-6-RELEASE:1.15 netbsd-6-1-5-RELEASE:1.15 netbsd-7:1.15.0.66 netbsd-7-base:1.15 yamt-pagecache-base9:1.15 yamt-pagecache-tag8:1.15 netbsd-6-1-4-RELEASE:1.15 netbsd-6-0-5-RELEASE:1.15 tls-earlyentropy:1.15.0.64 tls-earlyentropy-base:1.15 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.15 riastradh-drm2-base3:1.15 netbsd-6-1-3-RELEASE:1.15 netbsd-6-0-4-RELEASE:1.15 netbsd-5-2-2-RELEASE:1.15 netbsd-5-1-4-RELEASE:1.15 netbsd-6-1-2-RELEASE:1.15 netbsd-6-0-3-RELEASE:1.15 netbsd-5-2-1-RELEASE:1.15 netbsd-5-1-3-RELEASE:1.15 netbsd-6-1-1-RELEASE:1.15 riastradh-drm2-base2:1.15 riastradh-drm2-base1:1.15 riastradh-drm2:1.15.0.56 riastradh-drm2-base:1.15 netbsd-6-1:1.15.0.62 netbsd-6-0-2-RELEASE:1.15 netbsd-6-1-RELEASE:1.15 khorben-n900:1.15.0.60 netbsd-6-1-RC4:1.15 netbsd-6-1-RC3:1.15 agc-symver:1.15.0.58 agc-symver-base:1.15 netbsd-6-1-RC2:1.15 netbsd-6-1-RC1:1.15 yamt-pagecache-base8:1.15 netbsd-5-2:1.15.0.54 netbsd-6-0-1-RELEASE:1.15 yamt-pagecache-base7:1.15 netbsd-5-2-RELEASE:1.15 netbsd-5-2-RC1:1.15 matt-nb6-plus-nbase:1.15 yamt-pagecache-base6:1.15 netbsd-6-0:1.15.0.52 netbsd-6-0-RELEASE:1.15 netbsd-6-0-RC2:1.15 tls-maxphys:1.15.0.50 tls-maxphys-base:1.15 matt-nb6-plus:1.15.0.48 matt-nb6-plus-base:1.15 netbsd-6-0-RC1:1.15 yamt-pagecache-base5:1.15 yamt-pagecache-base4:1.15 netbsd-6:1.15.0.46 netbsd-6-base:1.15 netbsd-5-1-2-RELEASE:1.15 netbsd-5-1-1-RELEASE:1.15 yamt-pagecache-base3:1.15 yamt-pagecache-base2:1.15 yamt-pagecache:1.15.0.44 yamt-pagecache-base:1.15 cherry-xenmp:1.15.0.42 cherry-xenmp-base:1.15 bouyer-quota2-nbase:1.15 bouyer-quota2:1.15.0.40 bouyer-quota2-base:1.15 matt-mips64-premerge-20101231:1.15 matt-nb5-mips64-premerge-20101231:1.15 matt-nb5-pq3:1.15.0.38 matt-nb5-pq3-base:1.15 netbsd-5-1:1.15.0.36 netbsd-5-1-RELEASE:1.15 netbsd-5-1-RC4:1.15 matt-nb5-mips64-k15:1.15 netbsd-5-1-RC3:1.15 netbsd-5-1-RC2:1.15 netbsd-5-1-RC1:1.15 netbsd-5-0-2-RELEASE:1.15 matt-nb5-mips64-premerge-20091211:1.15 matt-premerge-20091211:1.15 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.15 matt-nb4-mips64-k7-u2a-k9b:1.15 matt-nb5-mips64-u1-k1-k5:1.15 matt-nb5-mips64:1.15.0.34 netbsd-5-0-1-RELEASE:1.15 jym-xensuspend-nbase:1.15 netbsd-5-0:1.15.0.32 netbsd-5-0-RELEASE:1.15 netbsd-5-0-RC4:1.15 netbsd-5-0-RC3:1.15 netbsd-5-0-RC2:1.15 jym-xensuspend:1.15.0.30 jym-xensuspend-base:1.15 netbsd-5-0-RC1:1.15 netbsd-5:1.15.0.28 netbsd-5-base:1.15 matt-mips64-base2:1.15 matt-mips64:1.15.0.26 netbsd-4-0-1-RELEASE:1.15 wrstuden-revivesa-base-3:1.15 wrstuden-revivesa-base-2:1.15 wrstuden-fixsa-newbase:1.15 wrstuden-revivesa-base-1:1.15 yamt-pf42-base4:1.15 yamt-pf42-base3:1.15 hpcarm-cleanup-nbase:1.15 yamt-pf42-baseX:1.15 yamt-pf42-base2:1.15 wrstuden-revivesa:1.15.0.24 wrstuden-revivesa-base:1.15 yamt-pf42:1.15.0.22 yamt-pf42-base:1.15 mjf-devfs2:1.15.0.20 mjf-devfs2-base:1.15 keiichi-mipv6:1.15.0.18 keiichi-mipv6-base:1.15 mjf-devfs:1.15.0.16 mjf-devfs-base:1.15 matt-armv6-nbase:1.15 matt-armv6-prevmlocking:1.15 wrstuden-fixsa-base-1:1.15 netbsd-4-0:1.15.0.14 netbsd-4-0-RELEASE:1.15 cube-autoconf:1.15.0.12 cube-autoconf-base:1.15 netbsd-4-0-RC5:1.15 netbsd-4-0-RC4:1.15 netbsd-4-0-RC3:1.15 netbsd-4-0-RC2:1.15 netbsd-4-0-RC1:1.15 matt-armv6:1.15.0.10 matt-armv6-base:1.15 matt-mips64-base:1.15 hpcarm-cleanup:1.15.0.8 hpcarm-cleanup-base:1.15 netbsd-3-1-1-RELEASE:1.5 netbsd-3-0-3-RELEASE:1.5 wrstuden-fixsa:1.15.0.6 wrstuden-fixsa-base:1.15 abandoned-netbsd-4-base:1.15 abandoned-netbsd-4:1.15.0.2 netbsd-3-1:1.5.0.6 netbsd-3-1-RELEASE:1.5 netbsd-3-0-2-RELEASE:1.5 netbsd-3-1-RC4:1.5 netbsd-3-1-RC3:1.5 netbsd-3-1-RC2:1.5 netbsd-3-1-RC1:1.5 netbsd-4:1.15.0.4 netbsd-4-base:1.15 netbsd-3-0-1-RELEASE:1.5 netbsd-3-0:1.5.0.4 netbsd-3-0-RELEASE:1.5 netbsd-3-0-RC6:1.5 netbsd-3-0-RC5:1.5 netbsd-3-0-RC4:1.5 netbsd-3-0-RC3:1.5 netbsd-3-0-RC2:1.5 netbsd-3-0-RC1:1.5 netbsd-2-0-3-RELEASE:1.4 netbsd-2-1:1.4.0.6 netbsd-2-1-RELEASE:1.4 netbsd-2-1-RC6:1.4 netbsd-2-1-RC5:1.4 netbsd-2-1-RC4:1.4 netbsd-2-1-RC3:1.4 netbsd-2-1-RC2:1.4 netbsd-2-1-RC1:1.4 netbsd-2-0-2-RELEASE:1.4 netbsd-3:1.5.0.2 netbsd-3-base:1.5 netbsd-2-0-1-RELEASE:1.4 netbsd-2:1.4.0.4 netbsd-2-base:1.4 netbsd-2-0-RELEASE:1.4 netbsd-2-0-RC5:1.4 netbsd-2-0-RC4:1.4 netbsd-2-0-RC3:1.4 netbsd-2-0-RC2:1.4 netbsd-2-0-RC1:1.4 netbsd-2-0:1.4.0.2 netbsd-2-0-base:1.4; locks; strict; comment @# @; 1.15 date 2006.01.28.19.01.23; author apb; state Exp; branches 1.15.20.1; next 1.14; 1.14 date 2006.01.08.10.32.26; author apb; state Exp; branches; next 1.13; 1.13 date 2006.01.08.10.20.12; author apb; state Exp; branches; next 1.12; 1.12 date 2006.01.08.10.19.07; author apb; state Exp; branches; next 1.11; 1.11 date 2006.01.08.10.10.03; author apb; state Exp; branches; next 1.10; 1.10 date 2006.01.04.14.44.41; author apb; state Exp; branches; next 1.9; 1.9 date 2006.01.03.18.31.09; author apb; state Exp; branches; next 1.8; 1.8 date 2006.01.03.16.40.16; author apb; state Exp; branches; next 1.7; 1.7 date 2006.01.03.15.42.42; author apb; state Exp; branches; next 1.6; 1.6 date 2005.10.21.02.41.14; author jmc; state Exp; branches; next 1.5; 1.5 date 2004.07.23.15.11.26; author erh; state Exp; branches; next 1.4; 1.4 date 2004.01.03.02.38.58; author lukem; state Exp; branches; next 1.3; 1.3 date 2003.12.29.03.13.25; author lukem; state Exp; branches; next 1.2; 1.2 date 2003.11.25.07.19.46; author dyoung; state Exp; branches; next 1.1; 1.1 date 2003.06.23.09.02.33; author dyoung; state Exp; branches; next ; 1.15.20.1 date 2008.10.05.20.10.32; author mjf; state dead; branches; next ; desc @@ 1.15 log @No space in "function()", "command;" or "$(command)". Requested by christos. @ text @#!/bin/sh # # syspkgdeps [-a arch] [-m machine] [-s setsdir] [-p prefix] sets # # Compute naive package dependencies based on file & directory # nesting. E.g., if pkg P contains /foo/bar and Q contains /foo, # then Q is considered a dependency of P. # # Each line of output contains two syspkg names, # where the first syspkg depends on the second syspkg. # #set -u prog="${0##*/}" rundir="$(dirname "$0")" # ${0%/*} isn't good enough when there's no "/" . "${rundir}/sets.subr" # # set defaults # prefix=/ usage() { cat 1>&2 <&2 "${prog}: Could not create scratch directory." exit 1 fi PATH_MEMBERSHIP="${SCRATCH}/path-membership" PATH_TO_PKGNAME="${SCRATCH}/pathpkg.db" PARENT_PKGNAMES="${SCRATCH}/parent-pkgnames" PARENT_PATHNAMES="${SCRATCH}/parent-pathnames" echo >&2 "${prog}: indexing packages by pathnames" list_set_files ${sets} | ${SED} 's/^\.\///' | \ ${ENV_CMD} PREFIX="${prefix}" ${AWK} '{ if ($1 == ".") { print ENVIRON["PREFIX"] " " $2; } else { print ENVIRON["PREFIX"] $1 " " $2; } }' | ${SORT} -k 1 -u > "${PATH_MEMBERSHIP}" ${DB} -q -w -f - btree "${PATH_TO_PKGNAME}" < "${PATH_MEMBERSHIP}" if [ $? -ne 0 ]; then echo >&2 "${prog}: error creating database, aborting" exit 1 fi echo >&2 "${prog}: computing parent pathnames" while read pathname pkgname; do # print parent pathname. # (This uses a cheap implementation of dirname from sets.subr.) dirname "${pathname}" done < "${PATH_MEMBERSHIP}" > "${PARENT_PATHNAMES}" echo >&2 "${prog}: selecting parent packages using parent pathnames" ${DB} -q -f - btree "${PATH_TO_PKGNAME}" < "${PARENT_PATHNAMES}" | \ ${PASTE} "${PATH_MEMBERSHIP}" - | \ ${AWK} '{ if ($2 != $4) print $2 " " $4; }' | \ ${SORT} -u > "${SCRATCH}/alldeps" if [ $? -ne 0 ]; then echo >&2 "${prog}: error in parent-directory lookup, aborting" exit 1 fi echo >&2 "${prog}: checking for cyclic dependencies" tsort_errors="$(${TSORT} < "${SCRATCH}/alldeps" 2>&1 >/dev/null)" if [ -n "${tsort_errors}" ]; then # Errors from tsort are usually to do with cyclic dependencies. # The most likely underlying cause is that /foo and /foo/bar/baz # are in syspkg A, but /foo/bar is in syspkg B. echo >&2 "${tsort_errors}" # this is likely to be multiple lines echo >&2 "${prog}: Above messages probably indicate an error in the lists" exit 1 fi echo >&2 "${prog}: removing redundant dependencies" ${HOST_SH} "${rundir}/culldeps" < "${SCRATCH}/alldeps" if [ $? -ne 0 ]; then echo >&2 "${prog}: error in culldeps, aborting" exit 1 fi @ 1.15.20.1 log @Sync with HEAD. @ text @@ 1.14 log @Oops, missed a few echo >&2 changes in previous commit. @ text @d121 1 a121 1 tsort_errors="$( ${TSORT} < "${SCRATCH}/alldeps" 2>&1 >/dev/null )" @ 1.13 log @Detect cyclic dependencies, and abort if any exist. Approved by christos @ text @d119 1 a119 1 echo "checking for cyclic dependencies" 1>&2 d127 2 a128 2 echo "${tsort_errors}" 1>&2 echo "Above messages probably indicate an error in the lists" 1>&2 d132 1 a132 1 echo "removing redundant dependencies" 1>&2 d137 1 a137 1 echo "error in culldeps, aborting" 1>&2 @ 1.12 log @Document input and output format for syspkgdeps and culldeps. Approved by christos @ text @d112 1 a112 2 ${SORT} -u | \ ${HOST_SH} "${rundir}/culldeps" d118 22 @ 1.11 log @When printing messages to stderr, always use echo >&2 "${prog}: ..." Approved by christos @ text @d9 3 @ 1.10 log @* Add a special case for sets="all". * Use dirname, don't try to use a shortcut that doesn't always work. This uses the cheap implementation of dirname from sets.subr. * Fix error in getopts string ("-p" option takes an arg). * Explicitly use ${HOST_SH} to run culldeps script, because we might be on a host where /bin/sh is not a POSIX shell. Reviewed by agc @ text @d68 4 a71 1 [ $? -ne 0 ] && { echo "Could not create scratch directory." 1>&2 ; exit 1 ; } d78 1 a78 1 echo "indexing packages by pathnames" 1>&2 d89 6 a94 2 ${DB} -q -w -f - btree "${PATH_TO_PKGNAME}" < "${PATH_MEMBERSHIP}" || \ echo "shit" 1>&2 d96 1 a96 1 echo "computing parent pathnames" 1>&2 d104 1 a104 1 echo "selecting parent packages using parent pathnames" 1>&2 d113 1 a113 1 echo "error in parent-directory lookup, aborting" 1>&2 @ 1.9 log @Ensure that (almost) all shell variables in distrib/sets/* scripts are used with curly braces and quotes, as in "${var}". Also ensure that command substitution is quoted, as in "$(command)", and convert `command` to $(command). Reviewed by agc @ text @d12 1 a12 3 # # set defaults and import setlist subroutines # d16 4 d35 1 a35 1 while getopts a:m:ps: ch; do d61 3 d66 1 a66 1 SCRATCH="$(${MKTEMP} -d "/var/tmp/${0##*/}.XXXXXX")" d92 3 a94 2 # print parent pathname echo "${pathname%/*}" d103 1 a103 1 "${rundir}/culldeps" @ 1.8 log @Add shell variables defined in sets.subr for almost all commands used by scripts in distrib/sets/*. This is intended to be useful when cross building. Only trivial commands like echo, cat, and rm are excluded from this treatment. While I am here, make ${MTREE} and ${DB} follow the pattern used by most other such variables. Reviewed by agc. @ text @d23 4 a26 4 -a arch set arch (e.g, m68k, mips, powerpc) [$MACHINE_ARCH] -m machine set machine (e.g, amiga, i386, macppc) [$MACHINE] -s setsdir directory to find sets [$setsdir] -p prefix prefix for created plist [$prefix] d36 2 a37 2 MACHINE_ARCH=${OPTARG} MACHINE_CPU=$(arch_to_cpu ${OPTARG}) d40 1 a40 1 MACHINE=${OPTARG} d43 1 a43 1 prefix=${OPTARG} d46 1 a46 1 setsdir=${OPTARG} d58 1 a58 1 sets=$@@ d61 1 a61 1 SCRATCH=$(${MKTEMP} -d /var/tmp/$(basename $0).XXXXXX) d65 4 a68 4 PATH_MEMBERSHIP=$SCRATCH/path-membership PATH_TO_PKGNAME=$SCRATCH/pathpkg.db PARENT_PKGNAMES=$SCRATCH/parent-pkgnames PARENT_PATHNAMES=$SCRATCH/parent-pathnames d72 2 a73 2 list_set_files $sets | ${SED} 's/^\.\///' | \ ${ENV_CMD} PREFIX=$prefix ${AWK} '{ d79 1 a79 1 }' | ${SORT} -k 1 -u > $PATH_MEMBERSHIP d81 2 a82 1 $DB -q -w -f - btree $PATH_TO_PKGNAME < $PATH_MEMBERSHIP || echo "shit" 1>&2 d88 2 a89 2 echo ${pathname%/*} done < $PATH_MEMBERSHIP > $PARENT_PATHNAMES d93 2 a94 2 $DB -q -f - btree $PATH_TO_PKGNAME < $PARENT_PATHNAMES | \ ${PASTE} $PATH_MEMBERSHIP - | \ d97 1 a97 1 $rundir/culldeps @ 1.7 log @Move default values for several shell variables into sets.subr. Reviewed by agc @ text @a17 2 DB="${TOOL_DB} -q" prefix=/ d61 1 a61 1 SCRATCH=$(mktemp -d /var/tmp/$(basename $0).XXXXXX) d72 2 a73 2 list_set_files $sets | sed 's/^\.\///' | \ env PREFIX=$prefix awk '{ d79 1 a79 1 }' | sort -k 1 -u > $PATH_MEMBERSHIP d81 1 a81 1 $DB -w -f - btree $PATH_TO_PKGNAME < $PATH_MEMBERSHIP || echo "shit" 1>&2 d92 5 a96 3 $DB -f - btree $PATH_TO_PKGNAME < $PARENT_PATHNAMES | \ paste $PATH_MEMBERSHIP - | \ awk '{ if ($2 != $4) print $2 " " $4; }' | sort -u | $rundir/culldeps @ 1.6 log @Set default vars so blank and unset both end up w. a reasonable default @ text @a11 3 : ${TOOL_DB:=db} DB="${TOOL_DB} -q" d15 4 a18 2 rundir=${0%/*} . ${rundir}/sets.subr @ 1.5 log @Make all the sets scripts work even when not run from the directory that they reside in. Change any uses of dirname to use shell variable substitution instead. @ text @d12 1 a12 1 : ${TOOL_DB=db} @ 1.4 log @rename all the derived variables to uppercase, and export them to the environment. @ text @d18 2 a19 1 . ./sets.subr d90 1 a90 1 dirname $pathname d97 1 a97 1 awk '{ if ($2 != $4) print $2 " " $4; }' | sort -u | ./culldeps @ 1.3 log @Significant overhaul of how the sets are used: * Add an optional third field to the sets file which is a list of comma separated keywords that control if the line is printed. Currently supported keywords kerberos4 ${MKKERBEROS4} != no kerberos ${MKKERBEROS} != no lint ${MKLINT} != no obsolete ${obsolete} != 0. In this case, non obsolete files are not printed. (This will allow future support for builds with variables such as MKHESIOD and MKYP set to "no".) * Use sh(1)'s getopts where appropriate, and otherwise cleanup the various scripts. * Move defaults for sets.subr from sets.defaults into sets.subr. Move replicated code for determining stuff such as shlibs type from various scripts into sets.subr. * Merge the obsolete.*, krb.*, krb4.* and lint.* into the appropriate main lists with the relevant third field keyword(s). @ text @d25 2 a26 2 -a arch set arch (e.g, m68k, mips, powerpc) [$machine_arch] -m machine set machine (e.g, amiga, i386, macppc) [$machine] d38 2 a39 2 machine_arch=${OPTARG} machine_cpu=$(arch_to_cpu ${OPTARG}) d42 1 a42 1 machine=${OPTARG} @ 1.2 log @Factor duplicated code for setting variables such as machine_cpu and machine_arch to their defaults into sets.defaults, and source it at the top of each script. Also, to be consistent with variable naming, s/arch/machine_arch/. sets.defaults introduces two new variables, krb and krb4, which will affect whether Kerberos- or Kerberos IV-only files are put into the set lists. @ text @d12 2 a13 1 DB="db -q" a17 2 . ./sets.defaults a18 1 setd=$(pwd) d21 11 a31 11 usage() { exec 1>&2 echo "Usage: $0 [-a arch] [-m machine] [-s setsdir] [-p prefix] sets" echo " -a arch set arch (e.g, m68k, mips, powerpc) [$machine_arch]" echo " -m machine set machine (e.g, amiga, i386, macppc) [$machine]" echo " -s setsdir directory to find sets [$setd]" echo " -p prefix prefix for created plist [$prefix]" echo " sets sets to find dependencies for" exit 1 d35 5 a39 6 while : ; do case $1 in -a*) machine_arch=${2} machine_cpu=$(arch_to_cpu ${2}) shift d41 2 a42 2 -m*) machine=$2; shift d44 2 a45 2 -s*) setd=$2; shift d47 2 a48 2 -p*) prefix=$2; shift d50 1 a50 1 -*) a52 3 *) break ;; a53 1 shift d55 1 a61 22 if [ "$object_fmt" = "ELF" ]; then shlib=elf else shlib=aout fi stlib=$shlib # Turn off shlibs for some ports. if [ "$machine_cpu" = "sh3" -o "$machine_arch" = "m68000" ]; then shlib=no fi lkm=yes # Turn off LKMs for some ports. if [ "$machine" = "evbppc" ]; then lkm=no fi # Turn off lintlibs for some ports. # Not needed anymore, leave the hook here for future use. lintlibs= @ 1.1 log @For System Packages, two new utilities, a subroutine library, and a new list: sets.subr -- The set-listing code that is common to makeplist, makeflist, and regpkg has moved here. syspkgdeps -- Compute naive dependencies for system packages based on directory containment. I.e., if package A contains path /p/q, and package B contains path /p, then B is considered a dependency of A. As Jim Wise remarks, this is not quite right: system-package dependencies should indicate a functional dependency. Nevertheless, these naive dependencies protect us from orphaning files when pkg_delete'ing system packages. culldeps -- Helper for syspkgdeps. Removes redundant dependencies from a dependencies table. Essentially does the opposite of a transitive closure on a dependencies table: if the table contains A depends-on B, B depends-on C, and A depends-on C, then A depends-on C is removed because it can be derived from the prior two dependencies. deps -- Dependencies computed by syspkgdeps. @ text @d17 2 d40 2 a41 2 machine_arch=`MACHINE_ARCH=${2} ${make} print_machine_arch` machine_cpu=`MACHINE_ARCH=${2} ${make} print_machine_cpu` @