1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tools/makecontrol.sh Fri May 25 22:13:55 2018 +0200
1.3 @@ -0,0 +1,31 @@
1.4 +#!/bin/sh
1.5 +
1.6 +PROGNAME=`basename "$0"`
1.7 +
1.8 +if [ "$1" = '--help' ] || [ ! "$1" ] || [ ! -e "$1" ] ; then
1.9 + cat 1>&2 <<EOF
1.10 +Usage: $PROGNAME <package location>
1.11 +
1.12 +Search for package declarations in the given package, overwriting the Control
1.13 +file for the package with an updated version.
1.14 +EOF
1.15 + exit 1
1.16 +fi
1.17 +
1.18 +PACKAGE="$1"
1.19 +
1.20 +# Obtain the existing Control file and extract the non-provides fields.
1.21 +
1.22 +grep -v '^provides: ' "$PACKAGE/Control" > _non_provides.tmp
1.23 +
1.24 +# Search for package declarations and build provides fields.
1.25 +
1.26 +grep PC_FILENAME -r "$PACKAGE" | cut -d'=' -f 2 | sort -u | sed 's/^ /provides: /' > _provides.tmp
1.27 +
1.28 +# Concatenate the files and overwrite the Control file.
1.29 +
1.30 +cat _provides.tmp _non_provides.tmp > "$PACKAGE/Control"
1.31 +
1.32 +# Remove the temporary files.
1.33 +
1.34 +rm _provides.tmp _non_provides.tmp