[pacman-dev] [PATCH] makepkg: Log commands to logfile

Dave Reisner d at falconindy.com
Tue Jul 2 15:55:37 EDT 2013


On Tue, Jul 02, 2013 at 09:40:13PM +0200, Alain Kalker wrote:
> For debugging PKGBUILDs, and for reporting build failures upstream,
> it is very important to know the exact commands that are executed
> leading up to a problem.
> By using `set -x` and an appropriate value for PS4, commands are
> logged before they are executed.

If you want to report build failures upstream, then building via makepkg
is already wrong.

-1 on this.

> Signed-off-by: Alain Kalker <a.c.kalker at gmail.com>
> ---
>  scripts/makepkg.sh.in | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 2a39157..859159f 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -1468,8 +1468,15 @@ run_function() {
>  		tee "$BUILDLOG" < "$logpipe" &
>  		local teepid=$!
>  
> +		local restoreps4=$PS4
> +		PS4='$ '
> +		set -x
> +
>  		$pkgfunc &>"$logpipe"
>  
> +		set +x
> +		PS4=$restoreps4
> +
>  		wait $teepid
>  		rm "$logpipe"
>  	else
> -- 
> 1.8.3.2
> 
> 


More information about the pacman-dev mailing list