]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
simplaret_set_arch fixes
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Wed, 24 Jan 2007 02:03:31 +0000 (02:03 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Wed, 24 Jan 2007 02:03:31 +0000 (02:03 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@124 04377dda-e619-0410-9926-eae83683ac58

src/simplaret

index 4563e235ec6e1707fa022230fbfe3b712ed93382..500e4564884e0bc57e7aebb2eaaebc98d3c14424 100755 (executable)
@@ -761,7 +761,7 @@ function simplaret_set_arch {
 
   # set correct value for ARCH
 
-  local found repos_type
+  local repos_type new_arch
 
   # any arch defined in ARCH_i386 that hasn't an entry
   # on $REPOS_CONF will be mapped to i386
@@ -779,18 +779,24 @@ function simplaret_set_arch {
   for repos_type in patches root repos noarch; do
     if [ -z "`simplaret_repository $repos_type`" ]; then
       # there's no repository definition for that arch
-      if echo $ARCH_i386 | grep -q " $ARCH "; then
-        ARCH="i386"
-      elif echo $ARCH_x86_64 | grep -q " $ARCH "; then
-        ARCH="x86_64"
+      if echo "$ARCH_i386" | grep -q " $ARCH "; then
+        new_arch="i386"
+      elif echo "$ARCH_x86_64" | grep -q " $ARCH "; then
+        new_arch="x86_64"
       else
         echo "$BASENAME: error: no repository definition for arch $ARCH"
         echo "$BASENAME: please check your $CONF and $REPOS_CONF config files"
         exit 1
       fi
+    else
+      return
     fi
   done
 
+  echo "$BASENAME: changing arch from $ARCH to $new_arch"
+
+  ARCH="$new_arch"
+
 }
 
 if [ -z "$1" ]; then