X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=bin%2Fzpm;fp=bin%2Fzpm;h=06599acaf4123844aaaea5a6cc9ded32086cd1d5;hp=0000000000000000000000000000000000000000;hb=0419c62f964b259df1c1816f5870ef62eb97ed7c;hpb=0c2216d1e0dc8565a6bf61c9572e47bb1ae1c1fb diff --git a/bin/zpm b/bin/zpm new file mode 100755 index 0000000..06599ac --- /dev/null +++ b/bin/zpm @@ -0,0 +1,69 @@ +#!/bin/sh + +# parse command line options +while getopts P: opt; do + case $opt in + P) PATH=$OPTARG:$PATH ;; + *) printf "zpm unknown option '%s'\n" "$opt"; exit 1 ;; + esac +done +shift $((OPTIND - 1)) + +#: ${ZPMPATH:=/usr/libexec/zpm} + +if [ -n "$ZPMPATH" ]; then + PATH="$PATH:$ZPMPATH" +fi +export PATH + +[ -z "$1" ] && set help +cmd="$1" +shift + +die() { + echo $* + exit 1; +} + +# read in config files + +test -r /etc/zpmrc && . /etc/zpmrc +test -r $HOME/.zpmrc && . $HOME/zpmrc +test -r .zpmrc && . .zpmrc + +case $cmd in + help) + ecmd=$(command -v "zpm-$cmd") && { exec "$ecmd" "$@" || die "$0: unknown command zpm help"; } + find $(echo $PATH | tr ':' ' ') -maxdepth 1 -type f -name 'zpm-*' -executable -printf '%P\n' + ;; + *) + ecmd=$(command -v "zpm-$cmd") || die "$0: unknown command $cmd $@" + exec "$ecmd" "$@" || die "$0: could not exec $ecmd" + ;; +esac + +exit 0 + +note: add/edit a note file, - from stdin, list if none +ack: acknowledge a note file + +build: + build a package from source + - take file names on stdin and build package from them + - repackage an installed package + +install: install a package, - for from a file + +remove: remove a package + +db: edit package databases used for finding packages + +info: get information on a package + +track: add a package to config tracked packages + +add: add to a repository/database + +clean: clean a repository/database + +update: update a package, or all if no name