aboutsummaryrefslogtreecommitdiffstats
path: root/Tools/portbuild
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1999-08-18 18:24:53 +0800
committerasami <asami@FreeBSD.org>1999-08-18 18:24:53 +0800
commit0fe66ad87b42a3ad89a61510782570589a85c9d3 (patch)
treed1ddaf726d185a8b4200789802d13be866f81240 /Tools/portbuild
parent51976a4903931914fa601fc180d82feeebfe1178 (diff)
downloadfreebsd-ports-gnome-0fe66ad87b42a3ad89a61510782570589a85c9d3.tar.gz
freebsd-ports-gnome-0fe66ad87b42a3ad89a61510782570589a85c9d3.tar.zst
freebsd-ports-gnome-0fe66ad87b42a3ad89a61510782570589a85c9d3.zip
Do not require dependencies to be deleted to be explicitly listed.
Any dependency that doesn't exist as a package will be automatically deleted from the list of dependencies.
Diffstat (limited to 'Tools/portbuild')
-rwxr-xr-xTools/portbuild/scripts/chopindex32
1 files changed, 29 insertions, 3 deletions
diff --git a/Tools/portbuild/scripts/chopindex b/Tools/portbuild/scripts/chopindex
index feffb55ada19..1c2b4745d595 100755
--- a/Tools/portbuild/scripts/chopindex
+++ b/Tools/portbuild/scripts/chopindex
@@ -5,9 +5,35 @@ if [ $# != 2 ]; then
fi
index=$1
pkgdir=$2
+tmpindex=/tmp/index.$$
+
+# make a list of all pkgnames that don't have corresponding packages
+missing=$(/usr/bin/awk -v FS="|" -v pkgdir=$pkgdir '{
+ if (system(sprintf("test -e %s/All/%s.tgz\n", pkgdir, $1)))
+ print $1 ;
+}' $index)
+
+# make an index for only the ports that have packages
/usr/bin/awk -v FS="|" -v pkgdir=$pkgdir '{
if (system(sprintf("test ! -e %s/All/%s.tgz\n", pkgdir, $1)))
print $0 ;
-}' $index | \
- sed -e 's/XFree86-3\.3\.4//g' -e 's/Motif-2\.1\.10//g' \
- -e 's/ */ /g' -e 's/| /|/g' -e 's/ |/|/g'
+}' $index > $tmpindex
+
+# find missing ports still in the index as a dependency
+delete=""
+sed=""
+for i in $missing; do
+ if fgrep -q $i $tmpindex; then
+ delete="$delete $i"
+ sed="$sed -e s/$(echo $i | sed -e 's/\./\\./g')//g"
+ fi
+done
+
+# delete them
+if [ "$delete" != "" ]; then
+ echo "chopindex: deleting" $delete 1>&2
+fi
+
+sed $sed -e 's/ */ /g' -e 's/| /|/g' -e 's/ |/|/g' $tmpindex
+
+/bin/rm -f $tmpindex