[pacman-dev] [PATCH 3/4] makepkg: unify source file times for improved build reproducibility

Dave Reisner d at falconindy.com
Mon Apr 17 12:34:22 UTC 2017


On Mon, Apr 17, 2017 at 10:03:02PM +1000, Allan McRae wrote:
> From: Levente Polyak <anthraxx at archlinux.org>
> 
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---
>  scripts/makepkg.sh.in | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 7692ade5..df4d6a06 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -475,6 +475,9 @@ run_prepare() {
>  }
>  
>  run_build() {
> +	# unify source times before building for reproducibility
> +	find "$srcdir" -exec touch -h -d "@${SOURCE_DATE_EPOCH}" {} \;
> +

I'd use the '{} +' form of find here to avoid excessive forking.

>  	run_function_safe "build"
>  }
>  
> -- 
> 2.12.0


More information about the pacman-dev mailing list