diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2006-11-10 22:32:38 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2006-11-10 22:32:38 +0000 |
commit | 8164018d0940b8cc542cb5995a1e7c85187bbdb7 (patch) | |
tree | 09612ad6aed56f3788936b4f42ccbac7cacabae8 /lib | |
parent | 87552a5d93c064e38b74ac0468d014b4bc33f39c (diff) | |
download | simplepkg-8164018d0940b8cc542cb5995a1e7c85187bbdb7.tar.gz simplepkg-8164018d0940b8cc542cb5995a1e7c85187bbdb7.tar.bz2 |
start to apply changes from the huge TODO list
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@25 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/common.sh b/lib/common.sh index af31da3..5c9a4fa 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -55,6 +55,39 @@ function package_name { fi } +function package_version { + + # get VERSION from a package name + local file pack version + file="`basename $1`" + pack="`package_name $1`" + version="`echo $file | sed -e "s/^$pack//" | cut -d "-" -f 1`" + echo $version + +} + +function package_arch { + + # get ARCH from a package name + local file pack arch + file="`basename $1`" + pack="`package_name $1`" + arch="`echo $file | sed -e "s/^$pack//" | cut -d "-" -f 2`" + echo $arch + +} + +function package_build { + + # get BUILD from a package name + local file pack build + file="`basename $1`" + pack="`package_name $1`" + build="`echo $file | sed -e "s/^$pack//" | cut -d "-" -f 3`" + echo $build + +} + function install_packages { if [[ "$SIMPLARET_CLEAN" == "1" ]]; then |