Skip to content

Commit

Permalink
use REPRODUCIBLE_TAR_ARGS for docs production
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Jolly <kangie@gentoo.org>
  • Loading branch information
Kangie committed Dec 2, 2024
1 parent f70bfed commit 365b69e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion niche/generate-docs.bashlib
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ generate-docs_setup_environment() {
export PORTAGE_TMPDIR=${PORTAGE_TMPDIR:-/tmp/${0##*/}}
export PORTAGE_USERNAME="$(whoami)"
export PORTAGE_WORKDIR_MODE="775"
# Make reproducible tarballs. Clobber timestamps, sort files, and set ownership.
export REPRODUCIBLE_TAR_ARGS="--mtime="${SOURCE_DATE_EPOCH:-1970-01-01}" --sort=name --owner=portage --group=portage"
export XZ_DEFAULTS="-9 -T 0"

if [[ ${PWD} == */${CATEGORY}/${PN} ]] ; then
Expand Down Expand Up @@ -76,7 +78,7 @@ generate-docs_create_tarball() {
# within the tarball for posterity.
cp {${0},$(dirname ${BASH_SOURCE}/generate-docs.bashlib)} "${dir}"/${P}-docs/ || { eerror "Failed to embed script within tarball. Exiting!" ; exit 1 ; }

tar -caf "${dir}"/${P}-docs.tar.xz -C "${dir}" ${P}-docs/
tar ${REPRODUCIBLE_TAR_ARGS} -caf "${dir}"/${P}-docs.tar.xz -C "${dir}" ${P}-docs/
eend ${?} || { eerror "Creating tarball failed!" ; exit 1 ; }

einfo "Tarball at ${dir}/${P}-docs.tar.xz"
Expand Down

0 comments on commit 365b69e

Please sign in to comment.