pkgsrc/mk/flavor/pkg/list-dependencies
rillig ec3566cb97 Use SIGUSR1 instead of SIGINT, since the latter may occur indepenently
and should be handled like everywhere else.
2007-11-22 10:08:38 +00:00

67 lines
1.3 KiB
Bash
Executable file

#!/bin/sh
#
######################################################################
#
# NAME
# list-dependencies -- build package dependencies list
#
# SYNOPSIS
# list-dependencies bootstrap build full
#
# DESCRIPTION
# For each (reduced) dependency a line of the following format is
# printed:
#
# <depends_type> <pattern> <directory>
#
# Valid dependency types are "bootstrap", "build" and "full".
#
# ENVIRONMENT
# AWK
# Path to the awk interpreter.
#
# PKGSRCDIR
# Root directory of the pkgsrc tree.
#
# SED
# Path to the sed command.
#
# The following variables are used by the reduce-depends.awk script:
#
# PKG_ADMIN
# Path to the pkg_admin command.
#
# PWD_CMD
# Path to the pwd command.
#
######################################################################
: ${ECHO:=echo}
set -e
trap "exit 1" USR1
reduce_depends() {
${AWK} -f ${PKGSRCDIR}/mk/flavor/pkg/reduce-depends.awk "$1" \
|| kill -USR1 $$
}
print_entries() {
reduce_depends "$2" | while read dep; do
pattern=`${ECHO} "$dep" | ${SED} -e "s,:.*,,"`
dir=`${ECHO} "$dep" | ${SED} -e "s,.*:,,"`
[ "$pattern" ]
[ "$dir" ]
${ECHO} "$1 $pattern $dir"
done
}
if [ $# != 3 ]; then
echo "usage: list-dependencies bootstrap_depends build_depends depends" 1>&2
exit 1
fi
print_entries bootstrap "$1"
print_entries build "$2"
print_entries full "$3"