#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/install-package - install a package # # Creation : 2001-11-04 fm # Last Update: $Id$ # # Copyright (c) 2001-@@YEAR@@ the eisfair team, team(at)eisfair(dot)org # # usage: # install-package -y - install without question # -p [package -v (version)] version -> optional # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- # this is only a wrapper for # eisman install # include eislib . /var/install/include/eislib #debug=true if ${debug:-false} then exec 2>/tmp/$(basename ${0})-trace$$.log set -x ask_debug=true export ask_debug fi #---------------------------------------------------------------------------- # main #---------------------------------------------------------------------------- main() { local auto='' local package='' local version='' while [ ${#} -ne 0 ] do case ${1} in -y) auto='--auto' shift ;; -p) package=${2} shift;shift ;; -v) version=${2} shift;shift ;; *) mecho --error "error: invalid option switch \"${1}\"!" >&2 exit 1 ;; esac done status=$(eisman check "${package}" "${version:-0.0.0}") # ... if not, then do more if [ -n "${auto}" ] || [ "${status}" = "new" ] || [ "${status}" = "not-installed" ] then if [ -n "${version}" ] then version="=${version}" fi if [ -n "${package}" ] then eisman install ${auto} --unstable ${package}${version} ret="${?}" fi else ret=0 fi exit ${ret:-1} } #---------------------------------------------------------------------------- # call function main #---------------------------------------------------------------------------- main "${@}" #---------------------------------------------------------------------------- # end #----------------------------------------------------------------------------