Luna/tools/install-built-ports.sh

54 lines
948 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
2022-10-26 19:56:43 +00:00
unset islib
2022-10-23 17:27:34 +00:00
}
if ! [ -f ./ports.list ]
then
echo "No ports built."
exit 0
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
2022-10-26 19:56:43 +00:00
if ! [ "$islib" = "1" ]
then
echo "installing port: $pkgname version $pkgver"
mkdir -p $installdir
cd $installdir
port_install | filter-lines $pkgname "install"
fi
}
while read package; do
install_port $package
done < ./ports.list