mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-09-28 12:22:39 -06:00
kiss: simplify pkg_install_files further
This commit is contained in:
parent
7481a9dca0
commit
44c39789f7
13
kiss
13
kiss
@ -1046,12 +1046,11 @@ pkg_swap() {
|
|||||||
mv -f "$mak_dir/.$1" "../installed/$1/manifest"
|
mv -f "$mak_dir/.$1" "../installed/$1/manifest"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_install_files() {
|
file_rwx() {
|
||||||
while read -r file; do
|
|
||||||
# Grab the octal permissions so that directory creation
|
# Grab the octal permissions so that directory creation
|
||||||
# preserves permissions.
|
# preserves permissions.
|
||||||
# See: [2] at top of script.
|
# See: [2] at top of script.
|
||||||
rwx=$(ls -ld "$2/${file#/}") oct='' b='' o=0
|
rwx=$(ls -ld "$1") oct='' o=0
|
||||||
|
|
||||||
# Convert the output of 'ls' (rwxrwx---) to octal. This is simply
|
# Convert the output of 'ls' (rwxrwx---) to octal. This is simply
|
||||||
# a 1-9 loop with the second digit being the value of the field.
|
# a 1-9 loop with the second digit being the value of the field.
|
||||||
@ -1068,7 +1067,10 @@ pkg_install_files() {
|
|||||||
oct=$oct$o o=0
|
oct=$oct$o o=0
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_install_files() {
|
||||||
|
while read -r file; do
|
||||||
_file=$KISS_ROOT/${file#/}
|
_file=$KISS_ROOT/${file#/}
|
||||||
|
|
||||||
# Copy files and create directories (preserving permissions),
|
# Copy files and create directories (preserving permissions),
|
||||||
@ -1080,7 +1082,10 @@ pkg_install_files() {
|
|||||||
*/)
|
*/)
|
||||||
# Skip directories if they already exist in the file system.
|
# Skip directories if they already exist in the file system.
|
||||||
# (Think /usr/bin, /usr/lib, etc).
|
# (Think /usr/bin, /usr/lib, etc).
|
||||||
[ -d "$_file" ] || mkdir -m "$oct" "$_file"
|
[ -d "$_file" ] || {
|
||||||
|
file_rwx "$2/${file#/}"
|
||||||
|
mkdir -m "$oct" "$_file"
|
||||||
|
}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
Loading…
Reference in New Issue
Block a user