summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-06 00:19:28 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-06 00:19:28 +0000
commita57976f75af07822fc3a0b606a81ddc8f864e016 (patch)
tree6aa623f50ee65a7735ec4d25b01f894898e096c5 /bin/emerge-webrsync
parentKeep the RootConfig.sets attribute in sync with the SetConfig. (diff)
downloadportage-multirepo-a57976f75af07822fc3a0b606a81ddc8f864e016.tar.gz
portage-multirepo-a57976f75af07822fc3a0b606a81ddc8f864e016.tar.bz2
portage-multirepo-a57976f75af07822fc3a0b606a81ddc8f864e016.zip
Fix broken timestamp logic in do_snapshot(). Thanks to Alon
Bar-Lev <alonbl@gentoo.org> for this patch. svn path=/main/trunk/; revision=8851
Diffstat (limited to 'bin/emerge-webrsync')
-rwxr-xr-xbin/emerge-webrsync11
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index bb6e6627..eefba192 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -61,10 +61,9 @@ get_date_part() {
fi
}
-get_utc_from_string() {
+get_utc_second_from_string() {
local s="$1"
-
- seconds=$(date -d "${s:0:4}-${s:4:2}-${s:6:2}" -u +"%s")
+ date -d "${s:0:4}-${s:4:2}-${s:6:2}" -u +"%s"
}
get_portage_timestamp() {
@@ -241,14 +240,14 @@ do_snapshot() {
have_files=0
fi
else
- utc_date=$(get_utc_from_string "${date}")
+ local utc_seconds=$(get_utc_second_from_string "${date}")
#
# Check that this snapshot
# is what it claims to be...
#
- if [ ${snapshot_timestamp} -lt ${seconds} ] || \
- [ ${snapshot_timestamp} -gt $((${seconds}+ 2*86400)) ]; then
+ if [ ${snapshot_timestamp} -lt ${utc_seconds} ] || \
+ [ ${snapshot_timestamp} -gt $((${utc_seconds}+ 2*86400)) ]; then
echo "Warning: Snapshot timestamp is not in acceptable period."
have_files=0