# HG changeset patch # User Paul Boddie # Date 1527279235 -7200 # Node ID 8a38d4dc8d0655efcc3710a07488dfcb5210feec # Parent c9cbc0cafa8017865c2568fe55e8e28c416761dd Added a tool to regenerate package Control files from package declarations. diff -r c9cbc0cafa80 -r 8a38d4dc8d06 tools/makecontrol.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/makecontrol.sh Fri May 25 22:13:55 2018 +0200 @@ -0,0 +1,31 @@ +#!/bin/sh + +PROGNAME=`basename "$0"` + +if [ "$1" = '--help' ] || [ ! "$1" ] || [ ! -e "$1" ] ; then + cat 1>&2 < + +Search for package declarations in the given package, overwriting the Control +file for the package with an updated version. +EOF + exit 1 +fi + +PACKAGE="$1" + +# Obtain the existing Control file and extract the non-provides fields. + +grep -v '^provides: ' "$PACKAGE/Control" > _non_provides.tmp + +# Search for package declarations and build provides fields. + +grep PC_FILENAME -r "$PACKAGE" | cut -d'=' -f 2 | sort -u | sed 's/^ /provides: /' > _provides.tmp + +# Concatenate the files and overwrite the Control file. + +cat _provides.tmp _non_provides.tmp > "$PACKAGE/Control" + +# Remove the temporary files. + +rm _provides.tmp _non_provides.tmp