Luna/tools/install-built-ports.sh

49 lines
861 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
source $(dirname $0)/env.sh
cd $LUNA_ROOT/ports
2022-10-23 17:27:34 +00:00
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 built."
fi
install_port()
{
2022-10-23 17:27:34 +00:00
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 "installing port: $pkgname version $pkgver"
mkdir -p $installdir
cd $installdir
port_install | filter-lines $pkgname "install"
}
while read package; do
install_port $package
done < ./ports.list