aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-01-05 22:50:07 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-01-05 22:50:07 +0000
commitce77b525169bcc20d841d728571d47dc69ca6862 (patch)
treeab09561142a02143174de552e2291a2feefaff7a /lib
parent99ace5d5b81660af343d1b76a7e2f5c236635013 (diff)
downloadsimplepkg-ce77b525169bcc20d841d728571d47dc69ca6862.tar.gz
simplepkg-ce77b525169bcc20d841d728571d47dc69ca6862.tar.bz2
new common functions: default_arch and default_version
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@81 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'lib')
-rw-r--r--lib/common.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/common.sh b/lib/common.sh
index 5da1ed7..0749dd4 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -266,3 +266,17 @@ function eval_config {
}
+function default_version {
+
+ # get version from /etc/slackware-version
+ cat $1/etc/slackware-version | awk '{ print $2 }' | sed -e 's/.0$//'
+
+}
+
+function default_arch {
+
+ # get arch from /etc/slackware-version
+ cat $1/etc/slackware-version | awk '{ print $3 }' | sed -e 's/(//' -e 's/)//'
+
+}
+