From 4501c85fbc29468facc1c9ed80161fb721b926ff Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 15 Jun 2022 21:13:29 +0100 Subject: added pretty info command --- src/util.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/util.sh') diff --git a/src/util.sh b/src/util.sh index 96d326d..2b7044c 100644 --- a/src/util.sh +++ b/src/util.sh @@ -83,3 +83,23 @@ prompt_question () { [ "${var%${var#?}}"x != 'nx' ] } +# return if a package is present on the system or not +# +is_installed() { + [ -f "${INSTALLED_DIR}/$1/checksum" ] +} + +# get the installed checksum of a package ($1) +# +get_installed_version () { + local name=$1 + local file="${INSTALLED_DIR}/$name/checksum" + [ -f $file ] && + cat $file +} + +# +# +package_exists () { + [ -f "${PACKAGES_DIR}/$1" ] +} -- cgit v1.2.1