summaryrefslogtreecommitdiff
path: root/src/query.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-02-20 21:33:41 +0000
committerdavidovski <david@davidovski.xyz>2022-02-20 21:33:41 +0000
commit42352a35a057c8315e8acd8ea4217df8353ae16a (patch)
tree73dc6600425d8d39d97a1acc480ddf028ce7be40 /src/query.sh
parent0e307ec9997b94a2a782746d2a28ab15a9ea2a87 (diff)
added remove command
Diffstat (limited to 'src/query.sh')
-rw-r--r--src/query.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/query.sh b/src/query.sh
index d5571b0..7292434 100644
--- a/src/query.sh
+++ b/src/query.sh
@@ -1,7 +1,16 @@
#!/bin/sh
+
+list () {
+ find ${PACKAGES_DIR} -type f | sed "s,${PACKAGES_DIR}/,,"
+}
+
+list_installed () {
+ ls -1 ${INSTALLED_DIR}
+}
+
search () {
- find ${PACKAGES_DIR} -type f | sed "s,${PACKAGES_DIR}/,," | grep $(echo $@ | sed "s/ /\\|/g")
+ list | grep $(echo $@ | sed "s/ /\\|/g")
}
files () {
@@ -11,7 +20,7 @@ files () {
done
}
-file () {
+file_info () {
for file in $@; do
[ ! -f ${SYSROOT}$file ] && file=$(realpath $file)
for list in ${INSTALLED_DIR}/*/files; do
@@ -21,3 +30,4 @@ file () {
done
done
}
+