aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/common.sh33
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