diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-03 02:16:44 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-03 02:16:44 -0500 |
commit | 52cc0c3ff27d4c48d3461d9fd898367aa4a92631 (patch) | |
tree | f4d2b4fcfbc1c6cda116b7723ebe2eee774b0cd6 /src/chroot-tools | |
parent | 3793e4fac9d1d853251e84838caa2b8849d1f32b (diff) | |
parent | 58e2a9cd5aa9a4eb80f8da675685f62aca128eb3 (diff) |
Merge branch 'master' into xbs
Conflicts:
src/lib/conf.sh
Diffstat (limited to 'src/chroot-tools')
-rwxr-xr-x | src/chroot-tools/chcleanup | 2 | ||||
-rw-r--r-- | src/chroot-tools/hooks-distcc.sh | 2 | ||||
-rwxr-xr-x | src/chroot-tools/librechroot | 6 | ||||
-rw-r--r-- | src/chroot-tools/makechrootpkg.sh.patch | 10 |
4 files changed, 11 insertions, 9 deletions
diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index 0c78989..2ff45f9 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -53,7 +53,7 @@ fi source /etc/libretools.d/chroot.conf # If we're running makepkg -if [ -f PKGBUILD ]; then +if [[ -f PKGBUILD ]]; then export CARCH="$(. /etc/makepkg.conf; printf '%s' "$CARCH")" source ./PKGBUILD CHROOTEXTRAPKG+=("${depends[@]}" diff --git a/src/chroot-tools/hooks-distcc.sh b/src/chroot-tools/hooks-distcc.sh index 9e42242..d8d708a 100644 --- a/src/chroot-tools/hooks-distcc.sh +++ b/src/chroot-tools/hooks-distcc.sh @@ -75,7 +75,7 @@ distcc_stop() { if [[ -f "$copydir/run/distcc-tool.pid" ]]; then - odaemon=$(cat "$copydir/distcc-tool.pid") + odaemon=$(< "$copydir/distcc-tool.pid") kill -- "$odaemon" rm -f -- \ diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index b55cae1..5e16587 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -178,7 +178,7 @@ calculate_directories() { check_mountpoint() { local file=$1 local mountpoint="$(df -P "$file"|sed '1d;s/.*\s//')" - local mountopts=($(LANG=C mount|awk "{ if (\$3==\"$mountpoint\") { gsub(/[(,)]/, \" \", \$6); print \$6 } }")) + local mountopts=($(LC_ALL=C mount|awk "{ if (\$3==\"$mountpoint\") { gsub(/[(,)]/, \" \", \$6); print \$6 } }")) ! in_array nosuid "${mountopts[@]}" && ! in_array noexec "${mountopts[@]}" } @@ -190,8 +190,8 @@ arch-nspawn() { if [[ -t 1 ]]; then cmd=("$@") else - # This perl script is equivalent to `sed -s 's|\n|\r\n|g', but - # it doesn't line-buffer. + # This perl script is similar to `sed 's|\n|\r\n|g'`, (or, more + # correctly, `sed 's|$|\r|'`) but it does't line-buffer. local perlcmd=' my $size; my $buffer; diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index 4082bdd..4dd1146 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ ---- makechrootpkg.sh.in 2013-10-15 21:33:17.000000000 -0400 -+++ makechrootpkg.sh.ugly 2013-10-25 19:05:08.000000000 -0400 +--- makechrootpkg.sh.in 2013-10-26 14:53:57.000000000 -0400 ++++ makechrootpkg.sh.ugly 2013-11-16 15:14:04.000000000 -0500 @@ -12,6 +12,7 @@ shopt -s nullglob @@ -92,7 +92,7 @@ # Get a read lock on the root chroot to make # sure we don't clone a half-updated chroot slock 8 "$chrootdir/root.lock" "Locking clean chroot" -@@ -154,10 +171,15 @@ +@@ -154,11 +171,16 @@ # Drop the read lock again lock_close 8 @@ -100,6 +100,7 @@ } -clean_temporary() { +- stat_busy "Removing temporary copy [%s]" "$copy" +# Usage: delete_chroot $copydir [$copy] +delete_chroot() { + local copydir=$1 @@ -107,9 +108,10 @@ + # Detect chrootdir filesystem type + local chroottype=$(stat -f -c %T "$copydir") + - stat_busy "Removing temporary copy [%s]" "$copy" ++ stat_busy "Removing chroot copy [%s]" "$copy" if [[ "$chroottype" == btrfs ]]; then btrfs subvolume delete "$copydir" >/dev/null || + die "Unable to delete subvolume %s" "$copydir" @@ -173,9 +195,14 @@ stat_done } |