[hamradio-commits] [limesuite] 07/09: Use SOURCE_DATE_EPOCH variable instead of hand crafted equivalent

Andreas E. Bombe aeb at moszumanska.debian.org
Thu Mar 30 23:19:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

aeb pushed a commit to branch master
in repository limesuite.

commit cba54a4daf9f7fb06323b7da4d8795e5ef7218a2
Author: Andreas Bombe <aeb at debian.org>
Date:   Thu Mar 30 21:19:09 2017 +0200

    Use SOURCE_DATE_EPOCH variable instead of hand crafted equivalent
    
    SOURCE_DATE_EPOCH is the standard way to get a reproducible build time
    stamp. It is the same value as the one I extracted manually before I
    knew of that variable.
---
 debian/changelog                        |  2 ++
 debian/patches/override-build-timestamp | 14 ++++++++------
 debian/patches/version-string           |  4 ++--
 debian/rules                            |  6 +-----
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f550585..837fb5a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ limesuite (17.02.1+dfsg-1) UNRELEASED; urgency=medium
   * New upstream release 17.02.1
     - Works correctly with current LimeSDR firmware (Closes: #858591)
   * Remove backported fix-abs-overload patch, included in release
+  * Use SOURCE_DATE_EPOCH variable instead of hand crafted equivalent
+    to set BUILD_TIMESTAMP in override-build-timestamp patch
 
  -- Andreas Bombe <aeb at debian.org>  Thu, 30 Mar 2017 14:38:41 +0200
 
diff --git a/debian/patches/override-build-timestamp b/debian/patches/override-build-timestamp
index 3d34e8a..8388f9b 100644
--- a/debian/patches/override-build-timestamp
+++ b/debian/patches/override-build-timestamp
@@ -8,17 +8,19 @@ Author: Andreas Bombe <aeb at debian.org>
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -49,7 +49,12 @@
+@@ -49,7 +49,14 @@
  
  set(LIME_SUITE_LIBVER "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
  set(LIME_SUITE_VERSION "${LIME_SUITE_LIBVER}-${LIME_SUITE_EXTVER}")
 -string(TIMESTAMP BUILD_TIMESTAMP "%Y-%m-%d")
 +
-+if (NOT OVERRIDE_TIMESTAMP)
-+    message(FATAL_ERROR "OVERRIDE_TIMESTAMP not set")
-+else (NOT OVERRIDE_TIMESTAMP)
-+    string(TIMESTAMP BUILD_TIMESTAMP "${OVERRIDE_TIMESTAMP}")
-+endif (NOT OVERRIDE_TIMESTAMP)
++if (NOT $ENV{SOURCE_DATE_EPOCH})
++    message(FATAL_ERROR "SOURCE_DATE_EPOCH not set")
++else (NOT $ENV{SOURCE_DATE_EPOCH})
++    execute_process(COMMAND date --date=@$ENV{SOURCE_DATE_EPOCH} -I
++	OUTPUT_VARIABLE BUILD_TIMESTAMP
++	OUTPUT_STRIP_TRAILING_WHITESPACE)
++endif (NOT $ENV{SOURCE_DATE_EPOCH})
  
  #LIME_SUITE_ROOT is compiled into the library to locate the install base.
  #By default, the LIME_SUITE_ROOT is set to the CMAKE_INSTALL_PREFIX.
diff --git a/debian/patches/version-string b/debian/patches/version-string
index 19b02cb..e3756d8 100644
--- a/debian/patches/version-string
+++ b/debian/patches/version-string
@@ -47,5 +47,5 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  set(LIME_SUITE_LIBVER "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 -set(LIME_SUITE_VERSION "${LIME_SUITE_LIBVER}-${LIME_SUITE_EXTVER}")
  
- if (NOT OVERRIDE_TIMESTAMP)
-     message(FATAL_ERROR "OVERRIDE_TIMESTAMP not set")
+ if (NOT $ENV{SOURCE_DATE_EPOCH})
+     message(FATAL_ERROR "SOURCE_DATE_EPOCH not set")
diff --git a/debian/rules b/debian/rules
index cd8e5c2..f9095ae 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,9 +10,6 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 # extract the last section of the changelog version for extra info
 DEB_VERSION ?= $(shell dpkg-parsechangelog -S Version)
 
-# use changelog timestamp instead of build timestamp for reproducible builds
-DEB_TIMESTAMP ?= $(shell date --date=@$(shell dpkg-parsechangelog -S Timestamp) +%Y-%m-%d)
-
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
@@ -25,8 +22,7 @@ override_dh_auto_configure:
 		-DCMAKE_AUTOSET_INSTALL_RPATH=FALSE \
 		-DUDEV_RULES_PATH=/lib/udev/rules.d \
 		-DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" \
-		-DOVERRIDE_LIME_SUITE_VERSION="$(DEB_VERSION)" \
-		-DOVERRIDE_TIMESTAMP="$(DEB_TIMESTAMP)"
+		-DOVERRIDE_LIME_SUITE_VERSION="$(DEB_VERSION)"
 
 override_dh_installdocs:
 	dh_installdocs -p soapysdr-module-lms7 \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/limesuite.git



More information about the pkg-hamradio-commits mailing list