From 8164018d0940b8cc542cb5995a1e7c85187bbdb7 Mon Sep 17 00:00:00 2001 From: rhatto Date: Fri, 10 Nov 2006 22:32:38 +0000 Subject: 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 --- lib/common.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3