diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-06 12:16:33 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-06 12:16:33 -0500 |
commit | 8cbd5fc2e616785d97e84f7e17b845b74a6ccfd1 (patch) | |
tree | 4f3f2b45aa11e0facaf7873105226bfcf32c9dd8 /src/chroot-tools/librechroot | |
parent | 5656c9706cf6f96e0646e9594750d8239e5fcbea (diff) |
Update for the new version of systemdv20140306
Diffstat (limited to 'src/chroot-tools/librechroot')
-rwxr-xr-x | src/chroot-tools/librechroot | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 051148d..f449f0d 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -186,23 +186,7 @@ arch_nspawn_flags=() sysd_nspawn_flags=() arch-nspawn() { local copydir=$1; shift - # XXX: SYSTEMD-STDOUT HACK - if [[ -t 1 ]]; then - cmd=("$@") - else - # 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; -while(1) { - $size=sysread(STDIN, $buffer, 40); - last if ($size < 1); - $buffer =~ s/\n/\r\n/g; - syswrite(STDOUT, $buffer); -}' - cmd=(bash --noprofile --norc -c "set -o pipefail; $(printf '%q ' "$@") |& perl -e $(printf '%q' "$perlcmd")") - fi + local cmd=("$@") set +u # if an array is empty, it counts as unbound "$_arch_nspawn" "${arch_nspawn_flags[@]}" "$copydir" "${sysd_nspawn_flags[@]}" -- "${cmd[@]}" @@ -381,9 +365,7 @@ main() { arch-nspawn "$copydir" pacman -Sy "$@" ;; update) - # umount resolv.conf so that it can be upgraded, if nescessary - # this disables DNS, so fetch everything first - arch-nspawn "$copydir" bash -c 'pacman -Syuw --noconfirm && umount /etc/resolv.conf && pacman -Su --noconfirm' + arch-nspawn "$copydir" bash -c 'pacman -Syu --noconfirm' ;; clean-pkgs) trap "rm -f '$copydir'/bin/chcleanup '$copydir'/chrootexec" EXIT |