summaryrefslogtreecommitdiff
path: root/src/util.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-06-15 21:13:29 +0100
committerdavidovski <david@davidovski.xyz>2022-06-15 21:13:29 +0100
commit4501c85fbc29468facc1c9ed80161fb721b926ff (patch)
treead5568a93246d74b426ee1c940daefc4ccc9e183 /src/util.sh
parent9e7e6c466e0dab3a4bf3729fd97428dc2657746e (diff)
added pretty info command
Diffstat (limited to 'src/util.sh')
-rw-r--r--src/util.sh20
1 files changed, 20 insertions, 0 deletions
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" ]
+}