From 95a7a0a3c7f9ae3c14012f6a4780448035c9d420 Mon Sep 17 00:00:00 2001 From: rhatto Date: Thu, 27 Nov 2008 02:17:13 +0000 Subject: minor fixes git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@538 04377dda-e619-0410-9926-eae83683ac58 --- trunk/lib/common.sh | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'trunk/lib') diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 38afca8..c542e19 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -306,22 +306,6 @@ function eval_config { # arch and version functions # ----------------------------------------------- -function default_distro { - - # get distro name from /etc/slackware-version - if [ -f "$1/etc/slamd64-version" ]; then - echo Slamd64 - elif [ -f "$1/etc/bluewhite64-version" ]; then - echo Bluewhite64 - elif [ -f "$1/etc/sflack-version" ]; then - echo Sflack - elif [ -f "$1/etc/slackware-version" ]; then - cat $1/etc/slackware-version | awk '{ print $1 }' - else - echo Slackware - fi -} - function default_version { # get version from /etc/slackware-version @@ -366,6 +350,29 @@ function default_arch { } +function default_distro { + + # get distro name from /etc/slackware-version + if [ "`default_arch`" == "x86_64" ]; then + if [ -f "$1/etc/slamd64-version" ]; then + echo slamd64 + elif [ -f "$1/etc/bluewhite64-version" ]; then + echo bluewhite64 + elif [ -f "$1/etc/sflack-version" ]; then + echo sflack + else + echo slamd64 + fi + else + if [ -f "$1/etc/slackware-version" ]; then + cat $1/etc/slackware-version | awk '{ print $1 }' + else + echo slackware + fi + fi + +} + # ----------------------------------------------- # template functions # ----------------------------------------------- -- cgit v1.2.3