mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
makepkg: hack around tee in run_package function
Piping the package function through tee to log the outut also clears any variables set in the package function. This is a problem in split packages as package variable overrides are done in the package function. This is fixed by creating a node which the output is piped through and duplicated using the tee function. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
9804911c5f
commit
708ce1480f
@ -740,7 +740,16 @@ run_package() {
|
||||
mv "$BUILDLOG" "$BUILDLOG.$i"
|
||||
fi
|
||||
|
||||
package 2>&1 | tee "$BUILDLOG"; ret=${PIPESTATUS[0]}
|
||||
# ensure overridden package variables suvrive tee with split packages
|
||||
logpipe=$(mktemp -u "$startdir/logpipe.XXXXXXXX")
|
||||
mknod "$logpipe" p
|
||||
exec 3>&1
|
||||
tee "$BUILDLOG" < "$logpipe" &
|
||||
exec 1>"$logpipe" 2>"$logpipe"
|
||||
package 2>&1 || ret=$?
|
||||
sync
|
||||
exec 1>&3 2>&3 3>&-
|
||||
rm "$logpipe"
|
||||
else
|
||||
package 2>&1 || ret=$?
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user