From c7d0670d7a8c3a9ff8b80a12158d14a145795ada Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 16 Nov 2008 10:56:25 +0100 Subject: bin/pkg: pkg_add: Check if a package exists before installing it --- bin/pkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index cc07702..0a08f9a 100755 --- a/bin/pkg +++ b/bin/pkg @@ -165,7 +165,7 @@ function vcs_to_list { echo -n "$1 git " echo ${$(git --git-dir=$1/.git log -n 1)[2]} } else { - warn "Unsupported or no repository: $1\n" + warn "No git repository found: $1\n" } } @@ -475,6 +475,7 @@ function pkg_add { info "Package '$1' is already installed!\n" return 100 } + list_exists $1 || die "No such package: $1\n" info "Retrieving package $1...\n" cd $PDIR || return 255 vcs_add $1 || return 255 -- cgit v1.2.3