summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-30 22:33:03 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-30 22:33:03 +0000
commitfedcac13e7a440edad3f6280f9ec1f1828a258e9 (patch)
tree1b5a13251cfc5a985060e0bea91d96c3cb36023b
parentIgnore EEXIST from rmdir since some kernels (such as solaris) return that ins... (diff)
downloadportage-fedcac13e7a440edad3f6280f9ec1f1828a258e9.tar.gz
portage-fedcac13e7a440edad3f6280f9ec1f1828a258e9.tar.bz2
portage-fedcac13e7a440edad3f6280f9ec1f1828a258e9.zip
For bug #164532, don't rely on ${USERLAND} since the portage tree might be empty. (trunk r5840)
svn path=/main/branches/2.1.2/; revision=5841
-rwxr-xr-xbin/emerge-webrsync6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index be5f6d6d9..b1362b379 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -7,7 +7,7 @@
eval $(/usr/lib/portage/bin/portageq envvar -v FEATURES FETCHCOMMAND \
GENTOO_MIRRORS PORTAGE_INST_UID PORTAGE_INST_GID PORTAGE_NICENESS \
- PORTAGE_TMPDIR PORTDIR USERLAND)
+ PORTAGE_TMPDIR PORTDIR)
DISTDIR="${PORTAGE_TMPDIR}/emerge-webrsync"
# If PORTAGE_NICENESS is overriden via the env then it will
@@ -94,7 +94,9 @@ while (( $attempts < 40 )) ; do
# snapshot (for attempts=1, subtract 1 day from the current UTC time).
daysbefore=$(expr $(date -u +"%s") - 86400 \* ${attempts})
DATE_ARGS="-d @${daysbefore}"
- [ "${USERLAND}" != "GNU" ] && DATE_ARGS="-r ${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}"
day=$(date ${DATE_ARGS} -u +"%d")
month=$(date ${DATE_ARGS} -u +"%m")
year=$(date ${DATE_ARGS} -u +"%Y")