diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-04-30 18:25:10 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-04-30 18:25:10 +0000 |
commit | a08eee91d7f42f30c836cfe36680741479d46c27 (patch) | |
tree | 2aaffb8992eb7a98ba66f52db00d3e1b374e5ab2 | |
parent | 0010ee6416a0597e5e6b2e0bb57309a81e53f439 (diff) | |
download | portage-a08eee91d7f42f30c836cfe36680741479d46c27.tar.gz portage-a08eee91d7f42f30c836cfe36680741479d46c27.tar.bz2 portage-a08eee91d7f42f30c836cfe36680741479d46c27.zip |
Bug #219837 - Adjust date calculations to improve accuracy.
svn path=/main/trunk/; revision=10047
-rwxr-xr-x | bin/emerge-webrsync | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 84b1075f9..fbb2cd509 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -308,11 +308,15 @@ do_snapshot() { } do_latest_snapshot() { - local attempts=-1 + local attempts=0 local r=1 vecho "Fetching most recent snapshot ..." + # The snapshot for a given day is generated at 01:45 UTC on the following + # day, so the current day's snapshot (going by UTC time) hasn't been + # generated yet. Therefore, always start by looking for the previous day's + # snapshot (for attempts=1, subtract 1 day from the current UTC time). while (( ${attempts} < 40 )) ; do local day local month @@ -326,9 +330,9 @@ do_latest_snapshot() { day=$(get_date_part ${utc_attempt} "%d") month=$(get_date_part ${utc_attempt} "%m") year=$(get_date_part ${utc_attempt} "%Y") - utc_midnight=$(get_date_part $(expr ${utc_attempt} - ${utc_attempt} % 86400) "%s") + utc_midnight=$(expr ${utc_attempt} - ${utc_attempt} % 86400) - if [ ${utc_midnight} -lt $(($(get_portage_timestamp)-86400)) ]; then + if [ ${utc_midnight} -lt $(get_portage_timestamp) ]; then wecho "portage content is newer than available snapshots (use --revert option to overide)" r=0 break |