On Mon 2015-08-17 09:25:18 +0200, Chris Lamb wrote:
> Updated patch attached (that is backwards-compatible). Thanks to Reiner
> Herrmann.
hm, this is not portable enough for me to push it upstream, since it
depends on GNU interfaces to date :( I'd rather give the patch to
upstream so that they'll accept it (xdotool wants to work on the *BSDs
if possible as well).
The attached patch would probably be enough for upstream to work
portably (though it's much uglier).
However, i'm not sure it's the right thing anyway. we're in the weird
situation right now where xdotool reports a different version than dpkg
because we're grabbing the release date from the build time instead of
the package version:
0 dkg@alice:~$ dpkg -l xdotool
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-========================-=================-=================-=====================================================
ii xdotool 1:3.20150503.1-1 amd64 simulate
(generate) X11 keyboard/mouse input events
0 dkg@alice:~$ xdotool version
xdotool version 3.20150518.1
0 dkg@alice:~$
Thanks for bringing this situation to my attention :)
So i need to think about this a bit more, i think.
--dkg
diff --git a/version.sh b/version.sh
index 6c7d57a..85d8427 100755
--- a/version.sh
+++ b/version.sh
@@ -6,7 +6,14 @@ fi
if [ -z "$MAJOR" -o -z "$RELEASE" -o -z "$REVISION" ] ; then
MAJOR="3"
- RELEASE="$(date +%Y%m%d)"
+ DATE_FMT="+%Y%m%d"
+ if [ -n "$SOURCE_DATE_EPOCH" ] ; then
+ SOURCE_DATE_EPOCH="$(date +%s)"
+ fi
+ # try GNU date syntax and BSD date syntax before giving up SOURCE_DATE_EPOCH:
+ RELEASE="$(TZ=UTC date "--date=@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null)" || \
+ RELEASE="$(TZ=UTC date -r "$SOURCE_DATE_EPOCH" "$DATE_FMT")" || \
+ RELEASE="$(TZ=UTC date "$DATE_FMT")"
REVISION=1
#$([ -d .svn ] && svn info . | awk '/Revision:/ {print $2}')
: ${REVISION=:0}