Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10047 - main/trunk/bin
Date: Wed, 30 Apr 2008 18:25:14
Message-Id: E1JrGzP-0004UT-M1@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-04-30 18:25:10 +0000 (Wed, 30 Apr 2008)
3 New Revision: 10047
4
5 Modified:
6 main/trunk/bin/emerge-webrsync
7 Log:
8 Bug #219837 - Adjust date calculations to improve accuracy.
9
10
11 Modified: main/trunk/bin/emerge-webrsync
12 ===================================================================
13 --- main/trunk/bin/emerge-webrsync 2008-04-30 09:00:46 UTC (rev 10046)
14 +++ main/trunk/bin/emerge-webrsync 2008-04-30 18:25:10 UTC (rev 10047)
15 @@ -308,11 +308,15 @@
16 }
17
18 do_latest_snapshot() {
19 - local attempts=-1
20 + local attempts=0
21 local r=1
22
23 vecho "Fetching most recent snapshot ..."
24
25 + # The snapshot for a given day is generated at 01:45 UTC on the following
26 + # day, so the current day's snapshot (going by UTC time) hasn't been
27 + # generated yet. Therefore, always start by looking for the previous day's
28 + # snapshot (for attempts=1, subtract 1 day from the current UTC time).
29 while (( ${attempts} < 40 )) ; do
30 local day
31 local month
32 @@ -326,9 +330,9 @@
33 day=$(get_date_part ${utc_attempt} "%d")
34 month=$(get_date_part ${utc_attempt} "%m")
35 year=$(get_date_part ${utc_attempt} "%Y")
36 - utc_midnight=$(get_date_part $(expr ${utc_attempt} - ${utc_attempt} % 86400) "%s")
37 + utc_midnight=$(expr ${utc_attempt} - ${utc_attempt} % 86400)
38
39 - if [ ${utc_midnight} -lt $(($(get_portage_timestamp)-86400)) ]; then
40 + if [ ${utc_midnight} -lt $(get_portage_timestamp) ]; then
41 wecho "portage content is newer than available snapshots (use --revert option to overide)"
42 r=0
43 break
44
45 --
46 gentoo-commits@l.g.o mailing list