summaryrefslogtreecommitdiff
path: root/src/chroot-tools/libremakepkg
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-09-14 17:00:05 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-09-14 17:00:05 -0400
commit19cc5956ac565b0abc349e8b3f8275ae1168bd3b (patch)
treeba926e35059b832d109363cbcf03c23655904a16 /src/chroot-tools/libremakepkg
parent564a4cfa06a8a1cf880583669cc578f8cc45dc44 (diff)
libremakepkg: clean up temporary files created by prepare_chroot
Diffstat (limited to 'src/chroot-tools/libremakepkg')
-rwxr-xr-xsrc/chroot-tools/libremakepkg11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg
index 5494202..99c448f 100755
--- a/src/chroot-tools/libremakepkg
+++ b/src/chroot-tools/libremakepkg
@@ -88,8 +88,15 @@ add_to_local_repo() {
done
}
+hook_post_build+=('cleanup')
+cleanup() {
+ local copydir=$1
+ rm -f -- "$copydir"/chroot{prepare,build}
+}
+
build() (
local copydir=$1; shift
+ local repack=$1; shift
local netflag=''
local run=()
@@ -101,6 +108,7 @@ build() (
run=(librechroot "${librechroot_flags[@]}" run)
fi
+ prepare_chroot "$copydir" "$LIBREHOME" "$repack" false
"${run[@]}" /chrootprepare "$@"
run_hook pre_build "$copydir"
trap "run_hook post_build '$copydir'" EXIT
@@ -237,11 +245,10 @@ main() {
# Pre-build
run_hook check_pkgbuild
download_sources "$copydir" "$LIBREUSER"
- prepare_chroot "$copydir" "$LIBREHOME" "$repack" false
# Build
trap "exit_copy '$copydir' '$LIBREUSER'" EXIT
- build "$copydir" "${makepkg_args[@]}"
+ build "$copydir" "$repack" "${makepkg_args[@]}"
# Post-build
run_hook check_pkg