aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/simplaret43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/simplaret b/src/simplaret
index adef9b8..7b68b60 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -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