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