Display error message on installation error
This commit is contained in:
parent
05537dc903
commit
5ccc30daba
1 changed files with 33 additions and 5 deletions
|
@ -3,6 +3,7 @@
|
|||
# Install missing packages
|
||||
DEB_PACKAGES_LIST="screen libnet-ldap-perl libxml-libxml-perl libgearman-client-perl libmailtools-perl libmail-sendmail-perl libdatetime-format-iso8601-perl libnet-ip-perl"
|
||||
ARCH_PACKAGES_LIST="screen perl-io-socket-ssl perl-email-simple perl-email-mime perl-term-readkey perl-ldap perl-lwp-protocol-https perl-datetime-format-iso8601 perl-net-ip"
|
||||
GENTOO_PACKAGES_LIST="app-misc/screen dev-perl/IO-Socket-SSL dev-perl/Email-Simple dev-perl/Email-MIME dev-perl/TermReadKey dev-perl/perl-ldap dev-perl/LWP-Protocol-https dev-perl/DateTime-Format-ISO8601 dev-perl/Net-IP"
|
||||
FBSD_PACKAGES_LIST="screen p5-IO-Socket-SSL p5-Email-Simple p5-Email-MIME p5-Term-ANSIColor p5-Term-ReadKey p5-LWP-Protocol-https p5-DateTime-Format-ISO8601 p5-Net-IP"
|
||||
|
||||
KERNEL=`uname -s`
|
||||
|
@ -14,7 +15,11 @@ then
|
|||
do
|
||||
if ! pkg info "$PK" > /dev/null 2> /dev/null
|
||||
then
|
||||
PACKAGESITE="http://canon.acu.epita.fr/repo-lab" pkg install "$PK"
|
||||
if ! PACKAGESITE="http://canon.acu.epita.fr/repo-lab" pkg install "$PK"
|
||||
then
|
||||
echo "Error during installation of $PK"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
@ -26,7 +31,11 @@ then
|
|||
|
||||
if ! whereis dpkg > /dev/null 2> /dev/null
|
||||
then
|
||||
aptitude install dpkg
|
||||
if ! aptitude install dpkg
|
||||
then
|
||||
echo "Error during installation of $PK"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
for PK in $DEB_PACKAGES_LIST
|
||||
|
@ -54,20 +63,39 @@ then
|
|||
do
|
||||
if ! pacman -Qi "$PK" > /dev/null 2> /dev/null
|
||||
then
|
||||
pacman -S "$PK"
|
||||
if ! pacman -S "$PK"
|
||||
then
|
||||
echo "Error during installation of $PK"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
elif [ -f "/etc/gentoo-release" ]
|
||||
then
|
||||
|
||||
for PK in $GENTOO_PACKAGES_LIST
|
||||
do
|
||||
if ! equery list "$PK" > /dev/null 2> /dev/null
|
||||
then
|
||||
if ! emerge "$PK"
|
||||
then
|
||||
echo "Error during installation of $PK"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
|
||||
echo "Unknown distribution :("
|
||||
echo "Unsupported GNU/Linux distribution :("
|
||||
exit 1;
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
echo "Unknown operating system :("
|
||||
echo "Unsupported operating system :("
|
||||
exit 1;
|
||||
|
||||
fi
|
||||
|
|
Reference in a new issue