ports: Add a little script to list installed ports
This commit is contained in:
parent
3db342e897
commit
e7d41fa6dc
55
ports/list-ports.sh
Executable file
55
ports/list-ports.sh
Executable file
@ -0,0 +1,55 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd $(dirname $0)/..
|
||||||
|
|
||||||
|
source tools/env.sh
|
||||||
|
|
||||||
|
cd ports
|
||||||
|
|
||||||
|
unset_vars()
|
||||||
|
{
|
||||||
|
unset pkgname
|
||||||
|
unset pkgver
|
||||||
|
unset pkgurl
|
||||||
|
unset pkgmode
|
||||||
|
unset setupdir
|
||||||
|
unset builddir
|
||||||
|
unset installdir
|
||||||
|
unset srcdir
|
||||||
|
unset port_unpack
|
||||||
|
unset port_patch
|
||||||
|
unset port_configure
|
||||||
|
unset port_build
|
||||||
|
unset port_install
|
||||||
|
unset port_uninstall
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! [ -f ./ports.list ]
|
||||||
|
then
|
||||||
|
echo "No ports installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
export HAVE_PORTS=0
|
||||||
|
|
||||||
|
install_port()
|
||||||
|
{
|
||||||
|
HAVE_PORTS=1
|
||||||
|
unset_vars
|
||||||
|
cd $LUNA_ROOT/ports
|
||||||
|
export DESTDIR=${DESTDIR:-"$LUNA_ROOT/initrd"}
|
||||||
|
export portdir=$PWD/$1
|
||||||
|
export workdir=$portdir/workdir
|
||||||
|
source $portdir/package.sh
|
||||||
|
echo "$pkgname $pkgver"
|
||||||
|
}
|
||||||
|
|
||||||
|
while read package; do
|
||||||
|
install_port $package
|
||||||
|
done < ./ports.list
|
||||||
|
|
||||||
|
if [ "$HAVE_PORTS" = "0" ]
|
||||||
|
then
|
||||||
|
echo "No ports installed."
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user