1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-25 12:20:42 +01:00

cleanup: use package files instead of source package dotfiles

Try to build a source package if at least one binary package is missing. If
that is the case, clean up possibly built packages so we can cleanly recover
from a prior crash.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-03-06 21:15:42 +01:00
parent 2184f4dae7
commit a9eb892920

46
mk.sh
View file

@ -89,31 +89,41 @@ done < "$PACKAGELIST"
echo "--- building packages ---"
while read pkg; do
if [ ! -e "$PKGLOGDIR/.$pkg" ]; then
include_pkg "$pkg"
include_pkg "$pkg"
rm -rf "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR"
mkdir -p "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR"
found="yes"
if [ ! -z "$DEPENDS" ]; then
pkg install -omD -r "$TCDIR/$TARGET" -R "$REPODIR" $DEPENDS
for f in $SUBPKG; do
if [ ! -f "$REPODIR/${f}.pkg" ]; then
found="no"
break
fi
done
run_pkg_command "build"
run_pkg_command "deploy"
deploy_dev_cleanup
strip_files ${PKGDEPLOYDIR}/{bin,lib}
[ "x$found" == "xno" ] || continue;
for f in $SUBPKG; do
pkg pack -r "$REPODIR" \
-d "$PKGDEPLOYDIR/${f}.desc" \
-l "$PKGDEPLOYDIR/${f}.files"
done
for f in $SUBPKG; do
rm -f "$REPODIR/${f}.pkg"
done
rm -rf "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR"
touch "$PKGLOGDIR/.$pkg"
rm -rf "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR"
mkdir -p "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR"
if [ ! -z "$DEPENDS" ]; then
pkg install -omD -r "$TCDIR/$TARGET" -R "$REPODIR" $DEPENDS
fi
run_pkg_command "build"
run_pkg_command "deploy"
deploy_dev_cleanup
strip_files ${PKGDEPLOYDIR}/{bin,lib}
for f in $SUBPKG; do
pkg pack -r "$REPODIR" -d "$PKGDEPLOYDIR/${f}.desc" \
-l "$PKGDEPLOYDIR/${f}.files"
done
rm -rf "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR"
done < "$PACKAGELIST"
echo "--- done ---"