forked from kiss-community/kiss
kiss: Simplfy pkg_find usage
This commit is contained in:
parent
3990e34dc0
commit
44c6050a39
14
kiss
14
kiss
@ -195,8 +195,6 @@ pkg_sources() {
|
|||||||
# having a source of the same name.
|
# having a source of the same name.
|
||||||
mkdir -p "$src_dir/$1" && cd "$src_dir/$1"
|
mkdir -p "$src_dir/$1" && cd "$src_dir/$1"
|
||||||
|
|
||||||
repo_dir=$(pkg_find "$1")
|
|
||||||
|
|
||||||
while read -r src dest || [ "$src" ]; do
|
while read -r src dest || [ "$src" ]; do
|
||||||
# Comment.
|
# Comment.
|
||||||
if [ -z "${src##\#*}" ]; then :
|
if [ -z "${src##\#*}" ]; then :
|
||||||
@ -258,13 +256,13 @@ pkg_sources() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Local source.
|
# Local source.
|
||||||
elif [ -f "$repo_dir/$src" ]; then
|
elif [ -f "$(pkg_find "$1")/$src" ]; then
|
||||||
log "$1" "Found local file '$src'"
|
log "$1" "Found local file '$src'"
|
||||||
|
|
||||||
else
|
else
|
||||||
die "$1" "No local file '$src'"
|
die "$1" "No local file '$src'"
|
||||||
fi
|
fi
|
||||||
done < "$repo_dir/sources"
|
done < "$(pkg_find "$1")/sources"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_extract() {
|
pkg_extract() {
|
||||||
@ -272,8 +270,6 @@ pkg_extract() {
|
|||||||
# any local repository files.
|
# any local repository files.
|
||||||
log "$1" "Extracting sources"
|
log "$1" "Extracting sources"
|
||||||
|
|
||||||
repo_dir=$(pkg_find "$1")
|
|
||||||
|
|
||||||
while read -r src dest || [ "$src" ]; do
|
while read -r src dest || [ "$src" ]; do
|
||||||
mkdir -p "$mak_dir/$1/$dest" && cd "$mak_dir/$1/$dest"
|
mkdir -p "$mak_dir/$1/$dest" && cd "$mak_dir/$1/$dest"
|
||||||
|
|
||||||
@ -307,8 +303,8 @@ pkg_extract() {
|
|||||||
|
|
||||||
*)
|
*)
|
||||||
# Local file.
|
# Local file.
|
||||||
if [ -f "$repo_dir/$src" ]; then
|
if [ -f "$(pkg_find "$1")/$src" ]; then
|
||||||
cp -f "$repo_dir/$src" .
|
cp -f "$(pkg_find "$1")/$src" .
|
||||||
|
|
||||||
# Remote file.
|
# Remote file.
|
||||||
elif [ -f "$src_dir/$1/${src##*/}" ]; then
|
elif [ -f "$src_dir/$1/${src##*/}" ]; then
|
||||||
@ -319,7 +315,7 @@ pkg_extract() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done < "$repo_dir/sources"
|
done < "$(pkg_find "$1")/sources"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_depends() {
|
pkg_depends() {
|
||||||
|
Loading…
Reference in New Issue
Block a user