mirror of
https://github.com/pygos/build.git
synced 2024-12-23 23:50:51 +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:
parent
2184f4dae7
commit
a9eb892920
1 changed files with 28 additions and 18 deletions
46
mk.sh
46
mk.sh
|
@ -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 ---"
|
||||
|
||||
|
|
Loading…
Reference in a new issue