[pacman-dev,4/4,RFC] makepkg: unify times for generated files in srcdir before packaging

Message ID 20170417120303.9412-4-allan@archlinux.org
State Superseded, archived
Headers show
Series [pacman-dev,1/4] makepkg: extract parts of the write_pkginfo for use elsewhere | expand

Commit Message

Allan McRae April 17, 2017, 12:03 p.m. UTC
From: Levente Polyak <anthraxx@archlinux.org>

Signed-off-by: Allan McRae <allan@archlinux.org>
---

[Allan] I'm told his is useful for some python packages that generate pyo/pyc
files during package...  I am undecided about its suitability for inclusion
in makepkg yet.

 scripts/makepkg.sh.in | 2 ++
 1 file changed, 2 insertions(+)

Comments

Dave Reisner April 17, 2017, 12:35 p.m. UTC | #1
On Mon, Apr 17, 2017 at 10:03:03PM +1000, Allan McRae wrote:
> From: Levente Polyak <anthraxx@archlinux.org>
> 
> Signed-off-by: Allan McRae <allan@archlinux.org>
> ---
> 
> [Allan] I'm told his is useful for some python packages that generate pyo/pyc
> files during package...  I am undecided about its suitability for inclusion
> in makepkg yet.
> 
>  scripts/makepkg.sh.in | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index df4d6a06..84b83e7d 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -493,6 +493,8 @@ run_package() {
>  		pkgfunc="package_$1"
>  	fi
>  
> +	# unify source times before package for reproducibility
> +	find "$srcdir" -exec touch -h -d "@${SOURCE_DATE_EPOCH}" {} \;

Same as 3/4 -- prefer {} +.

If we accept this patch, the commit message should include an
explanation as to why this is useful.

>  	run_function_safe "$pkgfunc"
>  }
>  
> -- 
> 2.12.0

Patch

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index df4d6a06..84b83e7d 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -493,6 +493,8 @@  run_package() {
 		pkgfunc="package_$1"
 	fi
 
+	# unify source times before package for reproducibility
+	find "$srcdir" -exec touch -h -d "@${SOURCE_DATE_EPOCH}" {} \;
 	run_function_safe "$pkgfunc"
 }