summaryrefslogtreecommitdiffstats
path: root/source/a/pkgtools
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/pkgtools')
-rw-r--r--source/a/pkgtools/manpages/makepkg.87
-rwxr-xr-xsource/a/pkgtools/pkgtools.SlackBuild2
-rw-r--r--source/a/pkgtools/scripts/makepkg16
3 files changed, 20 insertions, 5 deletions
diff --git a/source/a/pkgtools/manpages/makepkg.8 b/source/a/pkgtools/manpages/makepkg.8
index 16a98f3fb..488519e1f 100644
--- a/source/a/pkgtools/manpages/makepkg.8
+++ b/source/a/pkgtools/manpages/makepkg.8
@@ -80,6 +80,13 @@ with pkgtools version < 15.0.
.B --xattrs
Support storing extended attributes in the package. The resulting package will not be
compatible with pkgtools version < 15.0.
+.SH ENVIRONMENT
+.TP
+.B SOURCE_DATE_EPOCH
+A UNIX date-time (seconds since 1 Jan 1970). If set, any newer timestamps in the package
+will be rewritten ("clamped") to this date-time. See
+.I https://reproducible-builds.org/specs/source-date-epoch/
+for more details.
.SH INSTALLATION SCRIPTS
There are 3 types of installation scripts supported in the Slackware package
system.
diff --git a/source/a/pkgtools/pkgtools.SlackBuild b/source/a/pkgtools/pkgtools.SlackBuild
index bdcb11ac0..749641335 100755
--- a/source/a/pkgtools/pkgtools.SlackBuild
+++ b/source/a/pkgtools/pkgtools.SlackBuild
@@ -30,7 +30,7 @@ PKGNAM=pkgtools
# *** UPDATE THESE WITH EACH BUILD:
VERSION=15.0
ARCH=${ARCH:-noarch}
-BUILD=${BUILD:-20}
+BUILD=${BUILD:-21}
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
diff --git a/source/a/pkgtools/scripts/makepkg b/source/a/pkgtools/scripts/makepkg
index f9241cb96..63ab83cb8 100644
--- a/source/a/pkgtools/scripts/makepkg
+++ b/source/a/pkgtools/scripts/makepkg
@@ -21,6 +21,9 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Mon 2 Jul 15:32:14 UTC 2018
+# Sort file lists and support SOURCE_DATE_EPOCH, for reproducibility.
+#
# Mon May 21 18:31:20 UTC 2018
# Add --compress option, usually used to change the preset compression level
# or block size.
@@ -163,6 +166,11 @@ while [ 0 ]; do
fi
done
+unset MTIME
+if [ -n "${SOURCE_DATE_EPOCH}" ]; then
+ MTIME="--clamp-mtime --mtime=@${SOURCE_DATE_EPOCH}"
+fi
+
PACKAGE_NAME="$1"
TARGET_NAME="$(dirname $PACKAGE_NAME)"
PACKAGE_NAME="$(basename $PACKAGE_NAME)"
@@ -171,14 +179,14 @@ PACKAGE_NAME="$(basename $PACKAGE_NAME)"
if [ ! "$(basename $PACKAGE_NAME .tgz)" = "$PACKAGE_NAME" ]; then
EXTENSION="tgz"
COMPEXT="gz"
- COMPRESSOR="gzip ${COMPRESS_OPTION} -c"
+ COMPRESSOR="gzip ${COMPRESS_OPTION} -cn"
if ! which gzip 1> /dev/null 2> /dev/null ; then
echo "ERROR: gzip compression utility not found in \$PATH."
exit 3
fi
elif [ ! "$(basename $PACKAGE_NAME .tar.gz)" = "$PACKAGE_NAME" ]; then
EXTENSION="tar.gz"
- COMPRESSOR="gzip ${COMPRESS_OPTION} -c"
+ COMPRESSOR="gzip ${COMPRESS_OPTION} -cn"
if ! which gzip 1> /dev/null 2> /dev/null ; then
echo "ERROR: gzip compression utility not found in \$PATH."
exit 3
@@ -290,7 +298,7 @@ echo
echo "Searching for symbolic links:"
# Get rid of possible pre-existing trouble:
INST=$(mktemp $TMP/makepkg.XXXXXX)
-find . -type l -printf "%p\t%l\n" | sed 's,^\./,, ; s, ,\\ ,g' | tee $INST
+find . -type l -printf "%p\t%l\n" | LC_COLLATE=C sort | sed 's,^\./,, ; s, ,\\ ,g' | tee $INST
if [ ! "$(cat $INST)" = "" ]; then
echo
echo "Making symbolic link creation script:"
@@ -404,7 +412,7 @@ rm -f ${TARGET_NAME}/${TAR_NAME}.${EXTENSION}
# find ./ | sed '2,$s,^\./,,' | cpio --quiet -ovHustar > ${TARGET_NAME}/${TAR_NAME}.tar
# Create the package:
-find ./ | sed '2,$s,^\./,,' | tar --no-recursion $ACLS $XATTRS -T - -cvf - | $COMPRESSOR > ${TARGET_NAME}/${TAR_NAME}.${EXTENSION}
+find ./ | LC_COLLATE=C sort | sed '2,$s,^\./,,' | tar --no-recursion $ACLS $XATTRS $MTIME -T - -cvf - | $COMPRESSOR > ${TARGET_NAME}/${TAR_NAME}.${EXTENSION}
ERRCODE=$?
if [ ! $ERRCODE = 0 ]; then
echo "ERROR: $COMPRESSOR returned error code $ERRCODE -- makepkg failed."