Skip to contentSkip to conversation

openldap: Reproducibility: Remove user, hostname, pwd from version string

PATCH New Douglas Royds 1 participant 1 message Oct 26, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openldap: Reproducibility: Remove user, hostname, pwd from version string

This updated patch also sets the date and time strings to the SOURCE_DATE_EPOCH. The WHOWHERE string will now be set to simply "openldap"
in the case that a SOURCE_DATE_EPOCH is set.

Upstream-Status: Submitted [https://www.openldap.org/its/index.cgi/Incoming?id=8928]

---
 .../remove-user-host-pwd-from-version.patch   | 27 +++++++++++++++----
 1 file changed, 22 insertions(+), 5 deletions(-)
meta-oe/recipes-support/openldap/openldap/remove-user-host-pwd-from-version.patch +22 -5
index 478a680ca..4eb389797 100644
@@ -1,12 +1,29 @@
-diff -ru openldap-2.4.46.original/build/mkversion openldap-2.4.46/build/mkversion
---- openldap-2.4.46.original/build/mkversion	2018-03-23 04:44:27.000000000 +1300
-+++ openldap-2.4.46/build/mkversion	2018-10-09 14:34:51.152684040 +1300
-@@ -50,7 +50,7 @@
+diff -ru openldap-2.4.46.orig/build/mkversion openldap-2.4.46/build/mkversion
+--- openldap-2.4.46.orig/build/mkversion	2018-10-25 18:46:10.383750480 +1300
++++ openldap-2.4.46/build/mkversion	2018-10-25 18:46:33.156232586 +1300
+@@ -50,7 +50,15 @@
  fi
  
  APPLICATION=$1
 -WHOWHERE="$USER@`uname -n`:`pwd`"
-+WHOWHERE="${SOURCE_DATE_EPOCH:-$USER@`uname -n`:`pwd`}"
++if [ -n "${SOURCE_DATE_EPOCH}" ]; then
++   WHOWHERE="openldap"
++   DATE=$(date -d@$SOURCE_DATE_EPOCH +' %b %d %Y ')
++   TIME=$(date -d@$SOURCE_DATE_EPOCH +' %H:%M:%S ')
++else
++   WHOWHERE="$USER@$(uname -n):$(pwd)"
++   DATE='" __DATE__ "'
++   TIME='" __TIME__ "'
++fi
  
  cat << __EOF__
  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+@@ -72,7 +80,7 @@
+ "COPYING RESTRICTIONS APPLY\n";
+ 
+ $static $const char $SYMBOL[] =
+-"@(#) \$$PACKAGE: $APPLICATION $VERSION (" __DATE__ " " __TIME__ ") \$\n"
++"@(#) \$$PACKAGE: $APPLICATION $VERSION ($DATE $TIME) \$\n"
+ "\t$WHOWHERE\n";
+ 
+ __EOF__
Signature · 1 line
2.17.1