Rely on USERLAND since it's automatically generated by
authorZac Medico <zmedico@gentoo.org>
Sat, 29 Dec 2007 13:56:57 +0000 (13:56 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 29 Dec 2007 13:56:57 +0000 (13:56 -0000)
isolated-functions.sh when necessary. (trunk r9107)

svn path=/main/branches/2.1.2/; revision=9108

bin/emerge-webrsync

index 2349963e482b58b97d3b7c81e8f3cdc52fa2c32a..8a68a4402152712103cc287912d1fe6c85455380 100755 (executable)
@@ -95,10 +95,11 @@ while (( $attempts <  40 )) ; do
        # generated yet.  Therefore, always start by looking for the previous day's
        # snapshot (for attempts=1, subtract 1 day from the current UTC time).
        daysbefore=$(expr $(date -u +"%s") - 86400 \* ${attempts})
-       DATE_ARGS="-d @${daysbefore}"
-       # ${USERLAND} is unreliable since the portage tree might be empty, so test
-       # success of the -r option to distinguish between gnu and bsd date.
-       date -r ${daysbefore} >&/dev/null && DATE_ARGS="-r ${daysbefore}"
+       if [ "${USERLAND}" = "BSD" ]; then
+               DATE_ARGS="-r ${daysbefore}"
+       else
+               DATE_ARGS="-d @${daysbefore}"
+       fi
        day=$(date ${DATE_ARGS} -u +"%d")
        month=$(date ${DATE_ARGS} -u +"%m")
        year=$(date ${DATE_ARGS} -u +"%Y")