From 26ade85b28348434810e72b53e8dd2d49c8dfe85 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 29 Dec 2007 13:56:57 +0000 Subject: [PATCH] Rely on USERLAND since it's automatically generated by isolated-functions.sh when necessary. (trunk r9107) svn path=/main/branches/2.1.2/; revision=9108 --- bin/emerge-webrsync | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 2349963e4..8a68a4402 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -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") -- 2.26.2