mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 00:20:05 -07:00
kiss: Error on no write permissions in install/remove
This commit is contained in:
parent
469c29f7f7
commit
0891e55b50
14
kiss
14
kiss
@ -228,6 +228,10 @@ pkg_list() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
args() {
|
args() {
|
||||||
|
[ -w "$KISS_ROOT" ] || case $1 in
|
||||||
|
i*|r*) die "No write permissions to \$KISS_ROOT."
|
||||||
|
esac
|
||||||
|
|
||||||
case $1 in b*|c*|i*) pkg_setup "${2-null}"; esac
|
case $1 in b*|c*|i*) pkg_setup "${2-null}"; esac
|
||||||
case $1 in
|
case $1 in
|
||||||
b*) [ -f checksums ] ||
|
b*) [ -f checksums ] ||
|
||||||
@ -271,19 +275,15 @@ args() {
|
|||||||
main() {
|
main() {
|
||||||
trap pkg_clean EXIT INT
|
trap pkg_clean EXIT INT
|
||||||
kiss=${0##*/}
|
kiss=${0##*/}
|
||||||
|
sys_db=${sys_dir:=$KISS_ROOT}/var/db/$kiss
|
||||||
|
|
||||||
[ -z "$KISS_PATH" ] &&
|
[ -z "$KISS_PATH" ] && die "Set \$KISS_PATH to a repository location."
|
||||||
die "Set \$KISS_PATH to a repository location."
|
|
||||||
|
|
||||||
[ -z "$KISS_ROOT" ] && [ "$(id -u)" != 0 ] &&
|
|
||||||
die "\$KISS_ROOT is set to '/' so you need to be root."
|
|
||||||
|
|
||||||
mkdir -p "${cac_dir:=${XDG_CACHE_HOME:=$HOME/.cache}/$kiss}" \
|
mkdir -p "${cac_dir:=${XDG_CACHE_HOME:=$HOME/.cache}/$kiss}" \
|
||||||
"${src_dir:=$cac_dir/sources}" \
|
"${src_dir:=$cac_dir/sources}" \
|
||||||
"${mak_dir:=$cac_dir/build-$$}" \
|
"${mak_dir:=$cac_dir/build-$$}" \
|
||||||
"${bin_dir:=$cac_dir/bin}" \
|
"${bin_dir:=$cac_dir/bin}" \
|
||||||
"${pkg_db:=${pkg_dir:=$cac_dir/pkg-$$}/var/db/$kiss}" \
|
"${pkg_db:=${pkg_dir:=$cac_dir/pkg-$$}/var/db/$kiss}" ||
|
||||||
"${sys_db:=${sys_dir:=$KISS_ROOT}/var/db/$kiss}" ||
|
|
||||||
die "Couldn't create directories."
|
die "Couldn't create directories."
|
||||||
|
|
||||||
args "$@"
|
args "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user