From 86ee0a5da2a3a02d291ae40c8570bcd97ff066de Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 1 Oct 2013 20:21:07 -0400 Subject: libremakepkg: when prefixing output with ' | ', do better than sed. There are two downsizes to using sed; it line-buffers, and (the existing pattern) doesn't handle '\r'. So, now I've included a Perl helper program to do a better job. I'd originally written it in C, and while that version was faster (the Perl version stutters occasionally), it required recompilation for different architectures. I could have gotten around that with tcc, but I didn't want to add any dependencies. Which is why I settled on Perl. It's part of group=(base), and it is required by packages in group=(base-devel), so I can count on it always being there. It doesn't handle every movement character, just '\n' and '\r', but that's enough for curl and pacman. --- src/chroot-tools/libremakepkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/chroot-tools/libremakepkg') diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index df4cd07..f808070 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -30,6 +30,7 @@ shopt -s nullglob umask 0022 # Global variables: +readonly _indent="$(librelib chroot/indent)" readonly INCHROOT=$([[ -f /.arch-chroot ]] && echo true || echo false) NONET=true # can be changed with the -N flag # {SRC,LOG,PKG}DEST set at runtime by makepkg.conf @@ -50,7 +51,7 @@ hook_check_pkg=(:) # Boring/mundane functions ##################################################### indent() { - sed 's/^/ | /' + "$_indent" ' | ' } # Usage: exit_copy $copydir $src_owner -- cgit v1.2.3-2-g168b