[26949] in Source-Commits

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

Re: /svn/athena r25845 -

daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Fri Mar 8 12:17:03 2013

Date: Fri, 8 Mar 2013 12:16:54 -0500 (EST)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201303081644.r28GiLGQ013720@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1303081216480.9389@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

Thanks, ACK.
-Ben

On Fri, 8 Mar 2013, Jonathan D Reed wrote:

> Author: jdreed
> Date: 2013-03-08 11:44:21 -0500 (Fri, 08 Mar 2013)
> New Revision: 25845
>
> Modified:
>   trunk/debathena/debathena/thirdparty/debian/thirdparty
> Log:
> * Whitespace cleanup
> * Make nologin file a variable
> * Clearer error messages for the log
> * Identify the case where the simulation succeeds, but the transaction
>  fails, which indicates a more serious problem.
>
>
> Modified: trunk/debathena/debathena/thirdparty/debian/thirdparty
> ===================================================================
> --- trunk/debathena/debathena/thirdparty/debian/thirdparty	2013-03-07 22:59:53 UTC (rev 25844)
> +++ trunk/debathena/debathena/thirdparty/debian/thirdparty	2013-03-08 16:44:21 UTC (rev 25845)
> @@ -1,11 +1,14 @@
> #!/bin/sh
> #
> -# debathena-thirdparty-installer
> +# debathena-thirdparty "installer"
> +#
> +# Consider "set -e" at some point
>
> LISTDIR=/var/lib/debathena-thirdparty
> LOG=/var/log/athena-thirdparty
> STATFILE=/var/lib/debathena-thirdparty/status
> FLAGFILE=/var/lib/debathena-thirdparty/update_required
> +NOLOGIN=/var/run/athena-nologin
>
> status=ok
> statusmsg="Nothing to do"
> @@ -21,7 +24,7 @@
> }
>
> save_state() {
> -    rm -f $statfile
> +    rm -f $STATFILE
>     echo "$status|$statusmsg" > $STATFILE
> }
>
> @@ -34,7 +37,7 @@
>     echo "*Ending thirdparty installation at $(date)"
>     echo "-----"
>     echo
> -    rm -f /var/run/athena-nologin
> +    rm -f $NOLOGIN
>     save_state
>     exit
> }
> @@ -47,16 +50,13 @@
> 	return 0
>     fi
> }
> -
>
> -
> -
> install() {
> -    if [ 0 != "$(id -u)" ]; then
> +    if [ "0" != "$(id -u)" ]; then
> 	echo "Root privileges required for installation." >&2
> 	exit 1
>     fi
> -    touch /var/run/athena-nologin
> +    touch $NOLOGIN
>     exec 3>&1
>     exec >> $LOG 2>&1
>     trap finish EXIT
> @@ -65,16 +65,21 @@
>     echo "** Required package list:"
>     cat "${LISTDIR}/dependencies"
>     echo "** Trying monolithic transaction..."
> -    if should_install $(cat ${LISTDIR}/dependencies) &&
> -	apt-get -y install $(cat ${LISTDIR}/dependencies); then
> -	echo "**Monolithic transaction succeeded"
> +    if should_install $(cat ${LISTDIR}/dependencies); then
> +	echo "** Simulation successful, continuing..."
> +	if apt-get -y install $(cat ${LISTDIR}/dependencies); then
> +	    echo "** Monolithic transaction succeeded."
> +	else
> +	    echo "** Monolitic transaction failed (shouldn't happen)"
> +	fi
>     else
> +	echo "** Simulation unsuccessful (would remove debathena packages)"
> 	echo "** Installing required packages one by one..."
> 	for pkg in $(cat "${LISTDIR}/dependencies"); do
> 	    echo "** Installing $pkg..."
> 	    if ! should_install $pkg; then
> 		echo "** Installation of $pkg is IMPOSSIBLE"
> -		complain "Some required packages failed to install"
> +		complain "Some required packages are impossible to install"
> 	    else
> 		apt-get -y install $pkg
> 		if [ $? != 0 ]; then
> @@ -91,7 +96,7 @@
> 	echo "** Installing $pkg..."
> 	if ! should_install $pkg; then
> 	    echo "** Installation of $pkg is IMPOSSIBLE"
> -	    whine "Some optional packages failed to install"
> +	    whine "Some optional packages are impossible to install"
> 	else
> 	    apt-get -y install $pkg
> 	    if [ $? != 0 ]; then
>
>

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