Luna/ports/list-ports.sh

55 lines
851 B
Bash
Raw Normal View History

#!/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