aboutsummaryrefslogtreecommitdiff
path: root/src/simplaret
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-01-23 18:09:09 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-01-23 18:09:09 +0000
commit7ab3b0a5a38d54b451c22dbff54163abf42d1450 (patch)
tree9331aed4482862e3fb03142188f463539c5663c8 /src/simplaret
parent52b532304a7a11ed7d0cb8b3a189ee7e0524bddb (diff)
downloadsimplepkg-7ab3b0a5a38d54b451c22dbff54163abf42d1450.tar.gz
simplepkg-7ab3b0a5a38d54b451c22dbff54163abf42d1450.tar.bz2
simplaret: new function simplaret_set_arch
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@115 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src/simplaret')
-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