]> pd.if.org Git - zpackage/blob - zpm
read in global and local config file in zpm dispatcher
[zpackage] / zpm
1 #!/bin/sh
2
3 [ -z "$1" ] && set help
4 cmd="$1"
5 shift
6
7 die() {
8         echo $*
9         exit 1;
10 }
11
12 # parse command line options
13
14 # read in config files
15
16 test -r /etc/zpmrc && . /etc/zpmrc
17 test -r $HOME/.zpmrc && . $HOME/zpmrc
18 test -r .zpmrc && . .zpmrc
19
20 case $cmd in
21         help)
22                 ecmd=$(command -v "zpm-$cmd") && { exec "$ecmd" "$@" || die "$0: unknown command zpm help"; }
23                 find $(echo $PATH | tr ':' ' ') -maxdepth 1 -type f -name 'zpm-*' -executable -printf '%P\n'
24                 ;;
25         *)
26                 ecmd=$(command -v "zpm-$cmd") || die "$0: unknown command $cmd $@"
27                 exec "$ecmd" "$@" || die "$0: could not exec $ecmd"
28                 ;;
29 esac
30
31 exit 0
32
33 note: add/edit a note file, - from stdin, list if none
34 ack: acknowledge a note file
35
36 build:
37         build a package from source
38         - take file names on stdin and build package from them
39         - <name> repackage an installed package
40
41 install: install a package, - <name> for from a file
42
43 remove: remove a package
44
45 db: edit package databases used for finding packages
46
47 info: get information on a package
48
49 track: add a package to config tracked packages
50
51 add: add to a repository/database
52
53 clean: clean a repository/database
54
55 update: update a package, or all if no name