Update instalee

This commit is contained in:
xerus2000 2020-06-21 16:19:54 +02:00
parent 6d93f94cb8
commit 18c4c76b4f

View file

@ -8,7 +8,7 @@ get() {
result=$(cat "$home/sources" | while read source
do find "$home/packages/$1" -name "$source*" 2>/dev/null
done)
test "$result" || (echo "No source for package '$1'" >>/dev/stderr && exit 1)
test ! "$result" && echo "No source for package '$1'" >>/dev/stderr && exit 1
echo "$result"
}
@ -23,16 +23,23 @@ case $1 in
-a)
dir="$home/packages/$2"
mkdir -p "$dir"
echo "$4">"$dir/$3"
test $# -gt 3 && echo "$4">"$dir/$3" || $EDITOR "$dir/$3"
;;
*)
get "$1" | while read pkg; do
set -e
pkgs=$(get "$1")
echo "$pkgs" | while read pkg; do
underline "$pkg"
name="$(basename $pkg)"
base="${name%_*}"
test "$base" = "custom" && $pkg && exit 0
ext="${name##$base}"
mgr="$home/managers/$base"
args="$(getcontent "$pkg")"
(test "$base" = "manual" && echo "$args") || (install="$(find "$mgr" -name "install$ext" | head -1)" && echo $install $args && $install $args)
install="$(find "$mgr" -name "install$ext" | head -1)" && echo "Invoking '$install $args'" && $install $args
exit 0
done
;;
esac