mirror of
https://github.com/pygos/build.git
synced 2024-11-22 02:59:47 +01:00
Cleanup directories before and after building a package
In case a package build fails, we can simply restart the build script without having to do manual cleanup of the intermediate directories. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
parent
8fa44569d8
commit
e497ba164c
2 changed files with 3 additions and 5 deletions
6
mk.sh
6
mk.sh
|
@ -92,8 +92,8 @@ while read pkg; do
|
|||
if [ ! -e "$PKGLOGDIR/.$pkg" ]; then
|
||||
include_pkg "$pkg"
|
||||
|
||||
rm -rf "$TCDIR/$TARGET"
|
||||
mkdir -p "$TCDIR/$TARGET"
|
||||
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
|
||||
|
@ -110,7 +110,7 @@ while read pkg; do
|
|||
-l "$PKGDEPLOYDIR/${f}.files"
|
||||
done
|
||||
|
||||
rm -rf "$PKGBUILDDIR" "$PKGDEPLOYDIR"
|
||||
rm -rf "$TCDIR/$TARGET" "$PKGBUILDDIR" "$PKGDEPLOYDIR"
|
||||
touch "$PKGLOGDIR/.$pkg"
|
||||
fi
|
||||
done < "$PACKAGELIST"
|
||||
|
|
|
@ -17,8 +17,6 @@ run_pkg_command() {
|
|||
|
||||
echo "$PKGNAME - $FUNCTION"
|
||||
|
||||
mkdir -p "$PKGBUILDDIR" "$PKGDEPLOYDIR"
|
||||
|
||||
pushd "$PKGBUILDDIR" > /dev/null
|
||||
$FUNCTION "$SRC" &>> "$LOGFILE" < /dev/null
|
||||
popd > /dev/null
|
||||
|
|
Loading…
Reference in a new issue