mirror of
https://github.com/pygos/build.git
synced 2024-11-22 19:19:46 +01:00
ffacb26218
Instead of having a "depends" file with a list of packages, add a "DEPENDS" variable to the build script. Generate the rootfs dependencies from a config file stored in the cfg directory. Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
36 lines
870 B
Bash
Executable file
36 lines
870 B
Bash
Executable file
fetch_package() {
|
|
local PKGDIR="$1"
|
|
local NAME="$2"
|
|
echo "$NAME"
|
|
|
|
unset -f build deploy prepare
|
|
unset -v VERSION TARBALL URL SRCDIR SHA256SUM DEPENDS
|
|
source "$SCRIPTDIR/$PKGDIR/$NAME/build"
|
|
|
|
if [ -z "$TARBALL" ]; then
|
|
return
|
|
fi
|
|
|
|
if [ ! -e "$PKGDOWNLOADDIR/$TARBALL" ]; then
|
|
curl -o "$PKGDOWNLOADDIR/$TARBALL" --silent --show-error \
|
|
-L "$URL/$TARBALL"
|
|
fi
|
|
|
|
pushd "$PKGDOWNLOADDIR" > /dev/null
|
|
echo "$SHA256SUM ${TARBALL}" > "${TARBALL}.sha256"
|
|
sha256sum -c --quiet "${TARBALL}.sha256"
|
|
rm "${TARBALL}.sha256"
|
|
popd > /dev/null
|
|
|
|
if [ ! -e "$PKGSRCDIR/$SRCDIR" ]; then
|
|
local LOGFILE="$PKGLOGDIR/${NAME}-prepare.log"
|
|
|
|
echo "unpacking..."
|
|
tar -C "$PKGSRCDIR" -xf "$PKGDOWNLOADDIR/$TARBALL"
|
|
|
|
pushd "$PKGSRCDIR/$SRCDIR" > /dev/null
|
|
echo "preparing..."
|
|
prepare "$SCRIPTDIR/$PKGDIR/$NAME" &>> "$LOGFILE" < /dev/null
|
|
popd > /dev/null
|
|
fi
|
|
}
|