[28492] in Source-Commits

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

installer commit [lsb-release]: Fix check for lsb-release

daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Wed Mar 11 02:57:46 2015

Date: Wed, 11 Mar 2015 02:57:38 -0400
From: Anders Kaseorg <andersk@mit.edu>
Message-Id: <201503110657.t2B6vcid014589@drugstore.mit.edu>
To: source-commits@mit.edu

https://github.com/mit-athena/installer/commit/673d767ec255965bf3f4910c1dde382ae6b14c5f
commit 673d767ec255965bf3f4910c1dde382ae6b14c5f
Author: Anders Kaseorg <andersk@mit.edu>
Date:   Wed Mar 11 02:55:13 2015 -0400

    Fix check for lsb-release
    
    If lsb-release has never been installed, then dpkg-query exits with
    nonzero status, which would terminate the script silently.
    
    If lsb-release has been installed and removed, then the precedence of
    ! over && meant that the script would run ‘apt-get update’ but not
    ‘apt-get install lsb-release’.
    
    Signed-off-by: Anders Kaseorg <andersk@mit.edu>

 install-debathena.beta.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/install-debathena.beta.sh b/install-debathena.beta.sh
index 440c770..afebc50 100644
--- a/install-debathena.beta.sh
+++ b/install-debathena.beta.sh
@@ -52,13 +52,13 @@ if test -f /root/pxe-install-flag ; then
   rm -f /root/pxe-install-flag
 fi
 
-have_lsbrelease="$(dpkg-query -W -f '${Status}' lsb-release 2>/dev/null)"
+have_lsbrelease="$(dpkg-query -W -f '${Status}' lsb-release 2>/dev/null)" || :
 if [ "$have_lsbrelease" != "install ok installed" ]; then
   echo "The installer requires the 'lsb-release' package to determine"
   echo "whether or not installation can proceed."
   ask "Is it ok to install this package now? [Y/n] " y
   if [ y = "$answer" ]; then
-    if ! apt-get -qq update && apt-get -qqy install lsb-release; then
+    if ! apt-get -qq update || ! apt-get -qqy install lsb-release; then
 	error "Could not install lsb-release.  Try installing it manually."
 	exit 1
     fi

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