summaryrefslogtreecommitdiff
path: root/src/xi.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/xi.sh
parent9e7e6c466e0dab3a4bf3729fd97428dc2657746e (diff)
added pretty info command
Diffstat (limited to 'src/xi.sh')
-rwxr-xr-xsrc/xi.sh42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/xi.sh b/src/xi.sh
index 92222f9..923612c 100755
--- a/src/xi.sh
+++ b/src/xi.sh
@@ -133,6 +133,21 @@ done
. ${LIBDIR}/get.sh
. ${LIBDIR}/remove.sh
+do_install () {
+ [ "$#" = "0" ] && set -- $(installed)
+
+ toinstall=${CACHE_DIR}/toinstall
+
+ echo "" > $toinstall
+ tofetch=""
+ for f in $@; do
+ [ -f "$f" ] && echo $f >> $toinstall || tofetch="$tofetch$f "
+ done
+
+ get $tofetch
+ install $(cat $toinstall)
+}
+
shift $((OPTIND-1))
if [ "$#" = "0" ]; then
@@ -147,19 +162,7 @@ else
"install" | "update")
shift
checkroot
-
- [ "$#" = "0" ] && set -- $(installed)
-
- toinstall=${CACHE_DIR}/toinstall
-
- echo "" > $toinstall
- tofetch=""
- for f in $@; do
- [ -f "$f" ] && echo $f >> $toinstall || tofetch="$tofetch$f "
- done
-
- get $tofetch
- install $(cat $toinstall)
+ do_install $@
;;
"build")
shift
@@ -187,8 +190,8 @@ else
"reinstall")
shift
checkroot
- $0 remove $@
- $0 install $@
+ remove $@
+ do_install $@
;;
"files")
shift
@@ -221,14 +224,7 @@ else
;;
"info")
shift
- for package in $@; do
- infofile=${INSTALLED_DIR}/$package/info
- [ -f $infofile ] && {
- cat $infofile
- } || {
- printf "Package info for $package could not be found!"
- }
- done
+ info $@
;;
"verify")
shift