puke: cleanup

This commit is contained in:
Dylan Araps 2019-05-13 11:42:11 +03:00
parent f8d233273a
commit 72e96edc7a

14
puke
View File

@ -18,6 +18,13 @@ clean() {
"$rep_dir/$name/.manifest" 2>/dev/null
}
source_type() {
[ -f "$1" ] && return 2
[ -f "$src_dir/${1##*/}" ] && return 3
[ -z "${1##git:*}" ] && return 4
[ -z "${1##*://*}" ] && return 5
}
pkg_setup() {
[ -z "$1" ] && die "No package specified."
cd "$rep_dir/$1" || die "Package '$1' not in repository."
@ -40,13 +47,6 @@ pkg_depends() {
[ -n "$missing" ] && die "Missing dependencies:$missing"
}
source_type() {
[ -f "$1" ] && return 2
[ -f "$src_dir/${1##*/}" ] && return 3
[ -z "${1##git:*}" ] && return 4
[ -z "${1##*://*}" ] && return 5
}
pkg_sources() {
while read -r src; do
source_type "$src"