]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
simplaret: new function simplaret_set_arch
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Tue, 23 Jan 2007 18:09:09 +0000 (18:09 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Tue, 23 Jan 2007 18:09:09 +0000 (18:09 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@115 04377dda-e619-0410-9926-eae83683ac58

src/simplaret

index adef9b8ee764dcc1f21966881f39a51870ff1b40..7b68b60eb2f82ae81dd3313f74002f7e60701f25 100755 (executable)
@@ -706,8 +706,10 @@ function simplaret_install {
 
 function simplaret_distro_folder {
 
-  # set the distro folder
+  # first we point to the correct arch
+  simplaret_set_arch
 
+  # then we set the distro folder
   if [ "$ARCH" == "i386" ]; then
     DISTRO="slackware"
     DISTRO_FOLDER="$DISTRO-$VERSION"
@@ -730,10 +732,49 @@ function simplaret_distro_folder {
   elif [ "$ARCH" == "sparc" ]; then
     DISTRO="splack"
     DISTRO_FOLDER="tree-$VERSION"
+  else
+    DISTRO="$ARCH"
+    DISTRO_FOLDER="$DISTRO-$VERSION"
   fi
 
 }
 
+function simplaret_set_arch {
+
+  # set correct value for ARCH
+
+  local found repos_type
+
+  # any arch defined in ARCH_i386 that hasn't an entry
+  # on $REPOS_CONF will be mapped to i386
+
+  ARCH_i386=" nocona prescott pentium4m pentium4 pentium-m pentium3m pentium3 "
+  ARCH_i386="$ARCH_i386 pentium2 i686 pentium-pro i586 pentium-mmx pentium i486 "
+  ARCH_i386="$ARCH_i386 athlon-mp athlon-xp athlon4 athlon-tbird athlon k6 k6-2 "
+  ARCH_i386="$ARCH_i386 k6-3 winchip-c6 winchip2 c3 c3-2 i386 "
+
+  # any arch defined in ARCH_x86_64 that hasn't an entry
+  # on $REPOS_CONF will be mapped to x86_64
+
+  ARCH_x86_64=" k8 opteron athlon64 athlon-fx x86_64 "
+
+  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"
+      else
+        echo "$BASENAME: error: no repository definition for arch $ARCH"
+        echo "$BASENAME: please check your $CONF and $REPOS_CONF config files"
+        exit 1
+      fi
+    fi
+  done
+
+}
+
 if [ -z "$1" ]; then
   simplaret_usage
   exit 1