From 8692458d65fc9ce559ad7cd254d7ed3b606da76e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jan 2014 14:13:40 -0500 Subject: libremakepkg: (minor) refactor things to places that make a bit more sense --- src/chroot-tools/libremakepkg | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index f2dc537..1db9f08 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -212,6 +212,15 @@ main() { fi unset chroot + # Load makepkg configuration ########################################### + # Note that all of these are globals + PKGDEST="$(get_var makepkg PKGDEST "$PWD")" + SRCDEST="$(get_var makepkg SRCDEST "$PWD")" + SRCPKGDEST="$(get_var makepkg SRCPKGDEST "$PWD")" + LOGDEST="$(get_var makepkg LOGDEST "$PWD")" + MAKEFLAGS="$(get_var makepkg MAKEFLAGS '')" + PACKAGER="$(get_var makepkg PACKAGER '')" + # Quick sanity check ################################################### if (( EUID )); then @@ -225,22 +234,8 @@ main() { exit 1 fi - # Load makepkg configuration ########################################### - # Note that all of these are globals - PKGDEST="$(get_var makepkg PKGDEST "$PWD")" - SRCDEST="$(get_var makepkg SRCDEST "$PWD")" - SRCPKGDEST="$(get_var makepkg SRCPKGDEST "$PWD")" - LOGDEST="$(get_var makepkg LOGDEST "$PWD")" + # Make sure that the various *DEST directories exist mkdir -p -- "$PKGDEST" "$SRCDEST" "$SRCPKGDEST" "$LOGDEST" - MAKEFLAGS="$(get_var makepkg MAKEFLAGS '')" - PACKAGER="$(get_var makepkg PACKAGER '')" - - librechroot_flags+=( - -r "$PWD:/startdir_host" - -r "$SRCDEST:/srcdest_host" - -n "$CHROOT" - -l "$copy" - ) # OK, we are starting now ############################################## @@ -248,6 +243,13 @@ main() { lock 9 "/build/.lock" \ "Waiting for existing lock on build directory to be released" else + librechroot_flags+=( + -r "$PWD:/startdir_host" + -r "$SRCDEST:/srcdest_host" + -n "$CHROOT" + -l "$copy" + ) + # Obtain a lock on the chroot lock 9 "$copydir.lock" \ "Waiting for existing lock on chroot copy to be released: [%s]" "$copy" -- cgit v1.1-4-g5e80