Créé répertoire de configuration
[hvlinux.git] / functions
index 17dcbdb..89230b9 100644 (file)
--- a/functions
+++ b/functions
@@ -496,23 +496,14 @@ hv_groupadd()
 {
     arguments=${*}
 
-    set +e
-
+    # The last argument is the group name
     while [ $# -ne 0 ]; do
-       last_argument=${*}
+       groupname=${*}
        shift
     done
 
-    groupadd ${arguments}
-    error=$?
-
-    set -e
-
-    if [ ${error} -eq 0 -o ${error} -eq 9 ]; then
-        # 9 means the group already exists
-        return ${EXIT_SUCCESS}
-    else
-        exit ${EXIT_FAILURE}
+    if ! cat /etc/group | egrep "^${groupname}:" 1> /dev/null 2>&1; then
+        groupadd ${arguments}    
     fi
 }
 
@@ -522,7 +513,7 @@ hv_useradd()
 {
     arguments="${*}"
 
-    # The last argument is the username
+    # The last argument is the user name
     while [ $# -ne 0 ]; do
        username=${*}
        shift
@@ -753,9 +744,9 @@ ipkg_display_build_infos()
 #   -l     Unique identification label in 'install.log'
 #          (default is package name and version)
 #   -m     Installation mode:
-#            ac   Standard autoconf package, build in separate dir
-#            acnb Standard autoconf package, building in source dir
-#            nb   No autoconf (configure)
+#            ac   Standard autoconf package, build in separate dir (default)
+#            acnb Standard autoconf package, build in source dir
+#            noac No autoconf (configure)
 #            gnome
 #            xorg
 #            pm
@@ -847,7 +838,7 @@ ipkg()
     exec > ${PACKAGE_LOG} 2>&1
 
     # Sourcing standard ac script.
-    source ${SCRDIR}/../functions-ac
+    source ${SCRDIR}/../functions-ipkg
     source ${SCRDIR}/${DEFAULT_IPKG_SCRIPT}
     ipkg_script ${ALT_SCRIPT_NAME}