[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible FreeBSD: use BSD-style date argument for future date
Holger Levsen
holger at layer-acht.org
Fri Dec 23 01:20:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit d35ab3fa597eff866b07b56437cecd9afc6ec3e3
Author: Ed Maste <emaste at freebsd.org>
Date: Thu Dec 22 20:15:14 2016 -0500
reproducible FreeBSD: use BSD-style date argument for future date
FreeBSD's date command does not understand the --set format.
Signed-off-by: Ed Maste <emaste at freebsd.org>
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
bin/reproducible_freebsd.sh | 3 ++-
hosts/freebsd-jenkins/usr/local/etc/sudoers | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/bin/reproducible_freebsd.sh b/bin/reproducible_freebsd.sh
index ed42686..dcd48a9 100755
--- a/bin/reproducible_freebsd.sh
+++ b/bin/reproducible_freebsd.sh
@@ -142,7 +142,8 @@ for FREEBSD_TARGET in ${FREEBSD_TARGETS} ;do
fi
# set time forward 398 days and some
- $RSSH "sudo service ntpd stop ; sudo date --set='+398 days +6 hours +23 minutes' ; date"
+ FUTURE_DATE=$(expr $(date +%s) + 34410180)
+ $RSSH "sudo service ntpd stop ; sudo date -f %s $FUTURE_DATE ; date"
echo "$(date -u) - system is running in the future now."
echo "============================================================================="
diff --git a/hosts/freebsd-jenkins/usr/local/etc/sudoers b/hosts/freebsd-jenkins/usr/local/etc/sudoers
index fbff205..a0bd35e 100644
--- a/hosts/freebsd-jenkins/usr/local/etc/sudoers
+++ b/hosts/freebsd-jenkins/usr/local/etc/sudoers
@@ -110,7 +110,7 @@ jenkins ALL= NOPASSWD: /usr/bin/make -j ? buildworld, \
/usr/sbin/service ntpd stop, \
/usr/sbin/service ntpd status, \
/usr/sbin/ntpdate -b pool.ntp.org, \
- /bin/date --set=*
+ /bin/date -f %s *
## Uncomment to allow any user to run sudo if they know the password
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list