#!/usr/bin/env bash set -e source $(dirname $0)/env.sh cd $LUNA_ROOT/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 built." fi install_port() { 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