[26808] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r25768 - trunk/debathena/config/auto-update/debian

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Thu Sep 20 15:20:39 2012

Date: Thu, 20 Sep 2012 15:20:33 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201209201920.q8KJKXEe002589@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2012-09-20 15:20:32 -0400 (Thu, 20 Sep 2012)
New Revision: 25768

Modified:
   trunk/debathena/config/auto-update/debian/athena-auto-update
   trunk/debathena/config/auto-update/debian/changelog
Log:
In auto-update:
  * Ensure there are no double slashes in URLs, because Google hates them
  * Make the mirror check non-fatal -- merely warn


Modified: trunk/debathena/config/auto-update/debian/athena-auto-update
===================================================================
--- trunk/debathena/config/auto-update/debian/athena-auto-update	2012-09-20 15:04:16 UTC (rev 25767)
+++ trunk/debathena/config/auto-update/debian/athena-auto-update	2012-09-20 19:20:32 UTC (rev 25768)
@@ -7,17 +7,10 @@
   updmsg="$*"
 }
 
-# NOTE: Unlike complain(), calling warn() without subsequently 
-#       calling "exit" is not supported and its behavior is undefined
 warn() {
-  # If we've already had a warning once, then fail
-  if [ "$updstatus" = "warning" ]; then
-      complain "$*"
-  else
-      updstatus="warning"
-      updmsg="$*"
-      echo "WARNING: $*"
-  fi
+  updstatus="warning"
+  updmsg="$*"
+  echo "WARNING: $*"
 }
 
 save_success() {
@@ -235,13 +228,10 @@
 maybe_reboot
 
 # Ensure that the mirrors aren't broken
-urls=$(cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -v ^# | grep -v ^$ | awk '{print $2"/dists/"$3"/Release"}' | sort | uniq)
+# Google's apt repos are ridiculously picky
+urls=$(cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list | awk '!/^deb/ {next;} $2 ~ /^https/ {printf $2; if ($2 !~ /\/$/) printf "/"; printf "dists/"$3"/Release\n"}' | sort -u)
 failed=""
 for u in $urls; do
-    # We don't (yet) know how to verify other URI schemes
-    if ! echo $u | grep -q "^http:"; then
-	continue
-    fi
     curl -m 60 -sfL -o /dev/null $u
     if [ $? != 0 ]; then
 	if [ -z "$failed" ]; then

Modified: trunk/debathena/config/auto-update/debian/changelog
===================================================================
--- trunk/debathena/config/auto-update/debian/changelog	2012-09-20 15:04:16 UTC (rev 25767)
+++ trunk/debathena/config/auto-update/debian/changelog	2012-09-20 19:20:32 UTC (rev 25768)
@@ -1,3 +1,10 @@
+debathena-auto-update (1.41) unstable; urgency=low
+
+  * Ensure there are no double slashes in URLs, because Google hates them
+  * Make the mirror check non-fatal -- merely warn
+
+ -- Jonathan Reed <jdreed@mit.edu>  Thu, 20 Sep 2012 15:20:23 -0400
+
 debathena-auto-update (1.40) unstable; urgency=low
 
   * Fetch the Release file, not the directory listing, when attempting to


home help back first fref pref prev next nref lref last post