[25774] in Source-Commits

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

Re: /svn/athena r25222 - trunk/debathena/scripts/installer

daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Sat Jul 9 02:02:44 2011

Date: Fri, 8 Jul 2011 23:08:29 -0400 (EDT)
From: Geoffrey Thomas <geofft@MIT.EDU>
To: "andrew m. boardman" <amb@mit.edu>
cc: source-commits@mit.edu
In-Reply-To: <201107090203.p6923d9D008232@drugstore.mit.edu>
Message-ID: <alpine.DEB.2.00.1107082305450.32427@tyger.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

I really really don't like that we're depending on "bleeding", 
"development", and "proposed" being alphabetically in order, because 
that's the kind of thing we're going to get wrong one day and not notice. 
Can we at least document that more explicitly?

But better would be something on the order of

hesclusters=$(dig +short +bufsize=2048 ${hostname}.cluster.ns.athena.mit.edu TXT \
     |sed -e 's/"$//' -ne 's/^"apt_release //p')
for i in bleeding development proposed; do
   if echo "$hesclusters" | grep -fqx "$i"; then
     hescluster=$i
     break
   fi
done

-- 
Geoffrey Thomas
geofft@mit.edu

On Fri, 8 Jul 2011, andrew m. boardman wrote:

> Author: amb
> Date: 2011-07-08 22:03:39 -0400 (Fri, 08 Jul 2011)
> New Revision: 25222
>
> Modified:
>   trunk/debathena/scripts/installer/install-debathena.beta.sh
> Log:
> Extract only one line of the hesiod cluster info, which can contain
> multiple entries.
>
>
> Modified: trunk/debathena/scripts/installer/install-debathena.beta.sh
> ===================================================================
> --- trunk/debathena/scripts/installer/install-debathena.beta.sh	2011-07-05 18:32:09 UTC (rev 25221)
> +++ trunk/debathena/scripts/installer/install-debathena.beta.sh	2011-07-09 02:03:39 UTC (rev 25222)
> @@ -244,8 +244,11 @@
> sourceslist=/etc/apt/sources.list.d/debathena.list
> clustersourceslist=/etc/apt/sources.list.d/debathena.clusterinfo.list
> if [ -z "$hostname" ] ; then hostname=`hostname` ; fi
> +
> +# Note that hesiod may contain multiple apt_release lines.  We want, in order
> +# of priority, just one of "bleeding" (maybe), "development", or "proposed".
> hescluster=$(dig +short +bufsize=2048 ${hostname}.cluster.ns.athena.mit.edu TXT \
> -    |sed -e 's/"$//' -ne 's/^"apt_release //p') || hescluster=""
> +    |sed -e 's/"$//' -ne 's/^"apt_release //p'|sort|head -1) || hescluster=""
>
> if [ ! -e "$sourceslist" ] || ! grep -q debathena "$sourceslist"; then
>   if [ -e "$sourceslist" ]; then
>
>

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