public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10048 - main/branches/2.1.2/bin
@ 2008-04-30 18:28 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-04-30 18:28 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-04-30 18:28:16 +0000 (Wed, 30 Apr 2008)
New Revision: 10048

Modified:
   main/branches/2.1.2/bin/emerge-webrsync
Log:
Bug #219837 - Adjust date calculations to improve accuracy. (trunk r10047)


Modified: main/branches/2.1.2/bin/emerge-webrsync
===================================================================
--- main/branches/2.1.2/bin/emerge-webrsync	2008-04-30 18:25:10 UTC (rev 10047)
+++ main/branches/2.1.2/bin/emerge-webrsync	2008-04-30 18:28:16 UTC (rev 10048)
@@ -308,11 +308,15 @@
 }
 
 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 @@
 		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

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-30 18:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-30 18:28 [gentoo-commits] portage r10048 - main/branches/2.1.2/bin Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox