about summary refs log tree commit diff
path: root/buildtools
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-07-10 21:46:22 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-07-10 21:46:22 +0000
commit760c739e8fdf68efcaad8d27b28104c141502505 (patch)
treea07d7356c9995e234d6662c200f5f7045b07e909 /buildtools
parentb321e07b724019a2451cdd7d274f0920d8081b93 (diff)
downloadnetpbm-mirror-760c739e8fdf68efcaad8d27b28104c141502505.tar.gz
netpbm-mirror-760c739e8fdf68efcaad8d27b28104c141502505.tar.xz
netpbm-mirror-760c739e8fdf68efcaad8d27b28104c141502505.zip
Add COMPILED_BY environment variable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4566 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'buildtools')
-rwxr-xr-xbuildtools/stamp-date16
1 files changed, 12 insertions, 4 deletions
diff --git a/buildtools/stamp-date b/buildtools/stamp-date
index f867416d..baeec3fd 100755
--- a/buildtools/stamp-date
+++ b/buildtools/stamp-date
@@ -12,6 +12,11 @@
 # SOURCE_DATE_EPOCH is an environment variable as described here:
 # https://reproducible-builds.org/specs/source-date-epoch/ on 2017.03.16.
 
+# COMPILED_BY is a similar environment variable whose value is some
+# description of who is doing the build.  If it is not set, we use the
+# value of LOGNAME; if that is not set, we use the value of User; if that
+# is not set, we use the output of program 'whoami'.
+
 SOURCE_DATE_OR_NONE=${SOURCE_DATE_EPOCH:-NONE}
 
 NOW_FROM_DATE_PGM=$(date +%s)
@@ -24,9 +29,12 @@ else
 fi
 
 LOGNAME_OR_UNKNOWN=${LOGNAME:-UNKNOWN}
-USER=${USER:-$LOGNAME_OR_UNKNOWN}
-if [ "$USER" = "UNKNOWN" ]; then
-    USER=$(whoami)
+USER_OR_UNKNOWN=${USER:-$LOGNAME_OR_UNKNOWN}
+COMPILED_BY_OR_UNKNOWN=${COMPILED_BY:-$USER_OR_UNKNOWN}
+if [ "$COMPILED_BY_OR_UNKNOWN" = "UNKNOWN" ]; then
+    COMPILED_BY=$(whoami)
+else
+    COMPILED_BY=$COMPILED_BY_OR_UNKNOWN
 fi
 
 echo "/* This file tells some facts about the building of the package */"
@@ -36,4 +44,4 @@ if [ "$SOURCE_DATE_OR_NONE" != "NONE" ]; then
   echo "#define SOURCE_DATETIME $SOURCE_DATE_OR_NONE"
 fi
 echo "#define BUILD_DATETIME $BUILD_DATETIME"
-echo "#define COMPILED_BY \"$USER\""
+echo "#define COMPILED_BY \"$COMPILED_BY\""