diff mbox series

[1/7] builddeb: Pass -n to gzip for reproducible packages

Message ID 20200920222556.10002-2-guillem@hadrons.org
State New
Headers show
Series builddeb: Improve Debian packaging | expand

Commit Message

Guillem Jover Sept. 20, 2020, 10:25 p.m. UTC
We should not be encoding the timestamp, otherwise we end up generating
unreproducible files that cascade into unreproducible packages.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
---
 scripts/package/builddeb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masahiro Yamada Oct. 9, 2020, 2:58 p.m. UTC | #1
On Mon, Sep 21, 2020 at 7:48 AM Guillem Jover <guillem@hadrons.org> wrote:
>
> We should not be encoding the timestamp, otherwise we end up generating
> unreproducible files that cascade into unreproducible packages.
>
> Signed-off-by: Guillem Jover <guillem@hadrons.org>


Applied to linux-kbuild.
Thanks.

> ---
>  scripts/package/builddeb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 6df3c9f8b2da..b14abbe5afbb 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -31,7 +31,7 @@ create_package() {
>         mkdir -p "$pdir/usr/share/doc/$pname"
>         cp debian/copyright "$pdir/usr/share/doc/$pname/"
>         cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian"
> -       gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
> +       gzip -n -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
>         sh -c "cd '$pdir'; find . -type f ! -path './DEBIAN/*' -printf '%P\0' \
>                 | xargs -r0 md5sum > DEBIAN/md5sums"
>
> --
> 2.28.0.297.g1956fa8f8d
>
diff mbox series

Patch

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 6df3c9f8b2da..b14abbe5afbb 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -31,7 +31,7 @@  create_package() {
 	mkdir -p "$pdir/usr/share/doc/$pname"
 	cp debian/copyright "$pdir/usr/share/doc/$pname/"
 	cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian"
-	gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
+	gzip -n -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
 	sh -c "cd '$pdir'; find . -type f ! -path './DEBIAN/*' -printf '%P\0' \
 		| xargs -r0 md5sum > DEBIAN/md5sums"