[debian-edu-commits] debian-edu/ 101/183: Remove declare bashism

Alexander Alemayhu ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:37 UTC 2014


This is an automated email from the git hooks/post-receive script.

ccscanf-guest pushed a commit to branch master
in repository desktop-profiles.

commit 4d9b9accb78f503b29b943f6686d2549df84877c
Author: Bart Cornelis <cobaco at linux.be>
Date:   Tue Nov 1 11:19:22 2005 +0000

    Remove declare bashism
---
 listingmodule |  4 ++--
 path2listing  | 14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/listingmodule b/listingmodule
index cde45c1..28d6109 100644
--- a/listingmodule
+++ b/listingmodule
@@ -100,14 +100,14 @@ for_each_requirement(){
   # requirements -> check one by one
   while (test "$PROFILE_REQUIREMENTS"x != x); do
     # attempt to get first (remaining) REQUIREMENT 
-    declare -i C=1;
+    C=1;
     REQUIREMENT=`echo $PROFILE_REQUIREMENTS | cut --fields 1 --delimiter " "`;
 
     # if command requirement
     if (echo "$REQUIREMENT" | grep "^\$(" > /dev/null); then 
       #make sure we have the whole command (with params)
       while (echo "$REQUIREMENT" | grep -v ')$' > /dev/null); do
-        C=C+1;
+        C=`expr $C + 1`;
         REQUIREMENT=`echo $PROFILE_REQUIREMENTS | cut --fields -$C --delimiter " "`;
       done;	
 
diff --git a/path2listing b/path2listing
index f5e94e7..0cf5aae 100644
--- a/path2listing
+++ b/path2listing
@@ -103,16 +103,16 @@ list_sources_in_path_file () {
 # $3 is the file where it should be added into
 add_as_profile () {
   if (test -r "$3"); then 
-    declare -i mandatory_number="$(cat "$3" | grep '^mandatory' | wc -l) + 1";
-    declare -i default_number="$(cat "$3" | grep '^default' | wc -l) + 1";
+    mandatory_number="$(expr $(cat "$3" | grep '^mandatory' | wc -l) + 1)";
+    default_number="$(expr $(cat "$3" | grep '^default' | wc -l) + 1)";
   else 
-    declare -i mandatory_number=1;
-    declare -i default_number=1;
+    mandatory_number=1;
+    default_number=1;
   fi;  
   
-  if (test 0 -lt $2); then
+  if (test 0 -lt "$2"); then
     echo "mandatory_$mandatory_number;GCONF;$1;$2;;" >> "$3";
-  elif (test 0 -gt $2);then  
+  elif (test 0 -gt "$2");then  
     echo "default_$default_number;GCONF;$1;$2;;" >> "$3";
   else
     echo "gconf-user-settings;GCONF;$1;$2;;Default location of user settings" >> $3;
@@ -239,7 +239,7 @@ done;
     # the  '- USER_SOURCE_RANK * SOURCE_DISTANCE' at the end is to ensure that
     # the user-source ends up with precedence 0, yielding all mandatory sources
     # with a positive precedence, and all default sources with a negative one
-    declare -i PRECEDENCE="$(echo "$ITEM" | cut --fields 1) * $SOURCE_DISTANCE - $USER_SOURCE_RANK * $SOURCE_DISTANCE";
+    PRECEDENCE="$(expr $(echo "$ITEM" | cut --fields 1) \* $SOURCE_DISTANCE - $USER_SOURCE_RANK \* $SOURCE_DISTANCE)";
     CONFIG_SOURCE="$(echo "$ITEM" | cut --fields 2)";
 
     # add a profile-metadata entry for this configuration source

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/desktop-profiles.git



More information about the debian-edu-commits mailing list