| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function prepare_doPackages { |
| |
| |
| if [[ $FLAG_PACKAGES == 'false' ]];then |
| return |
| fi |
| |
| |
| cli_printMessage '-' 'AsSeparatorLine' |
| |
| |
| cli_printMessage "`gettext "Checking required packages"`" 'AsResponseLine' |
| |
| |
| cli_printMessage '-' 'AsSeparatorLine' |
| |
| local PACKAGE='' |
| local WARNING='' |
| local PACKAGES='' |
| local PACKAGES_THIRDS='' |
| local -a PACKAGES_MISSING |
| local RPM='/bin/rpm' |
| local YUM='/usr/bin/yum' |
| |
| |
| cli_checkFiles $RPM 'x' |
| cli_checkFiles $YUM 'x' |
| |
| |
| PACKAGES="inkscape ImageMagick netpbm netpbm-progs syslinux gimp |
| coreutils texinfo info tetex-latex tetex-fonts tetex-xdvi |
| tetex-dvips gettext texi2html gnome-doc-utils elinks |
| docbook-style-xsl docbook-utils docbook-dtds |
| docbook-style-dsssl docbook-simple docbook-utils-pdf |
| docbook-slides firefox sudo yum rpm" |
| |
| |
| |
| |
| PACKAGES_THIRDS="(inkscape|blender)" |
| |
| |
| for PACKAGE in $PACKAGES;do |
| $RPM -q --queryformat "%{NAME}\n" $PACKAGE --quiet |
| if [[ $? -ne 0 ]];then |
| PACKAGES_MISSING[((++${#PACKAGES_MISSING[*]}))]=$PACKAGE |
| fi |
| done |
| |
| |
| if [[ ${#PACKAGES_MISSING[*]} -eq 0 ]];then |
| cli_printMessage "`gettext "The required packages has been already installed."`" |
| return |
| fi |
| |
| |
| |
| |
| cli_printMessage "`ngettext "The following package needs to be installed" \ |
| "The following packages need to be installed" \ |
| "${#PACKAGES_MISSING[*]}"`:" |
| |
| |
| |
| for PACKAGE in ${PACKAGES_MISSING[@]};do |
| if [[ $PACKAGE =~ $PACKAGES_THIRDS ]];then |
| WARNING=" (`gettext "requires third party repository!"`)" |
| fi |
| cli_printMessage "${PACKAGE}${WARNING}" 'AsResponseLine' |
| done |
| |
| |
| cli_printMessage "`gettext "Do you want to continue"`" 'AsYesOrNoRequestLine' |
| |
| |
| |
| sudo ${YUM} install ${PACKAGES_MISSING[*]} |
| |
| } |