From 8cbd5fc2e616785d97e84f7e17b845b74a6ccfd1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 6 Mar 2014 12:16:33 -0500 Subject: Update for the new version of systemd --- src/chroot-tools/indent | 4 +--- src/chroot-tools/librechroot | 22 ++-------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/chroot-tools/indent b/src/chroot-tools/indent index 0e2d0e0..5a7f654 100755 --- a/src/chroot-tools/indent +++ b/src/chroot-tools/indent @@ -19,9 +19,7 @@ while (1) { $c = substr($buffer, $_, 1); if ($c eq "\n") { syswrite(STDOUT, $indent) if ($print_indent); - # XXX: SYSTEMD-STDOUT HACK - #syswrite(STDOUT, $c, 1); - syswrite(STDOUT, "\r\n", 2); + syswrite(STDOUT, $c, 1); $print_indent = 1; } elsif ($c eq "\r") { syswrite(STDOUT, $c, 1); 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 -- cgit v1.2.2