123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #!/bin/bash
-
-
- get_dst() {
- #
- # Find out target path for src file $2 of group $1
- #
- local grp=$1
- local src=$2
- echo "$(get_root $grp)/$(ini 1value "files:$grp:$src")"
- }
-
- get_root() {
- #
- # Find out target rooot for group $1
- #
- local grp="$1"
- local root=$(ini 1value "roots:$grp")
- test -n "$root" || die "missing in config.ini: roots:$grp"
- echo "$root"
- }
-
- install() {
- #
- # Install product
- #
- local dst group mode src
- ini values "lists:group" \
- | while read group;
- do
- mode=$(ini 1value "modes:$group")
- ini lskeys "files:$group" \
- | while read src;
- do
- dst=$(get_dst "$group" "$src")
- command -p install -DTvm $mode $src "$dst"
- done
- done
- test -f .autoclean && clean || :
- }
-
- uninstall() {
- #
- # Uninstall product
- #
- local dst group src
- ini values "lists:group" \
- | while read group;
- do
- ini lskeys "files:$group" \
- | while read src;
- do
- dst=$(get_dst "$group" "$src")
- rm -vf "$dst"
- done
- done
- }
|