tagada_multi-install

sebseb01sebseb01
Added on 2009-12-23 00:07:46
tagada_multi-install - Show - Edit - Download
Index: tagada
===================================================================
--- tagada      (révision 9)
+++ tagada      (copie de travail)
@@ -372,15 +372,6 @@
  fi
 }
 
-afunction install_package() {
- if [ $1 == "tsouin" -o $1 == "tsoin" ]
-  then
-     $TAGADA_ROOT_PREFIX aptitude install $2
- else
-     send_message_to_user 8
- fi
-}
-
 function do_you_really_like() {
 if [ -e $1 ]
 then
@@ -547,6 +538,17 @@
        send_message_to_user 2
         ;;
    esac
+   
+elif [ $1  = "tsouin" -a $2  = "tsouin" ]
+  then
+     args=("$@")
+     COUNTER=3
+     PACKAGE=""
+     while [  $COUNTER -lt $# ]; do
+        PACKAGE+=${args[${COUNTER}]}\ 
+        let COUNTER=COUNTER+1 
+     done
+     $TAGADA_ROOT_PREFIX $TAGADA_PACKAGE_SYSTEM_ENDUSER install $PACKAGE
 
 elif [ $# = 2 ]
  then
@@ -636,20 +638,6 @@
         ;;
    esac
 
-elif [ $# = 3 ]
- then
-   case $1 in
-    'tsouin')
-        install_package $2 $3
-        ;;
-        'tsoin')
-            install_package $2 $3
-            ;;
-    *)
-        send_message_to_user 2
-        ;;
-   esac
-
 else
    send_message_to_user 3
 fi