1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-25 00:20:05 -07:00

pkg_install: Use rsync

This commit is contained in:
Dylan Araps 2019-07-21 11:35:25 +03:00
parent cd96858358
commit b788295577

16
kiss
View File

@ -707,15 +707,13 @@ pkg_install() {
[ -f "$KISS_ROOT/$pkg_db/$pkg_name/manifest" ] && [ -f "$KISS_ROOT/$pkg_db/$pkg_name/manifest" ] &&
cp -f "$KISS_ROOT/$pkg_db/$pkg_name/manifest" "$cac_dir/m-$pkg_name" cp -f "$KISS_ROOT/$pkg_db/$pkg_name/manifest" "$cac_dir/m-$pkg_name"
# Install the package by using 'tar' and overwrite any existing files # Install the package by using 'rsync' and overwrite any existing files
# (ignoring files in '/etc'). # (excluding '/etc/').
(cd "$tar_dir"; tar cpf - --exclude ./etc/\* . | rsync -Kav --exclude etc -- "$tar_dir/" "$KISS_ROOT/"
tar -C "$KISS_ROOT/" -vxpf -)
# Install all '/etc' files however don't overwrite any which already # If '/etc/' exists in the package, install it but don't overwrite.
# exist. [ -d "$tar_dir/etc" ] &&
(cd "$tar_dir"; tar cpf - ./etc | rsync -Kav --ignore-existing "$tar_dir/etc" "$KISS_ROOT/"
tar -C "$KISS_ROOT/" -kvxpf -) 2>/dev/null
# Remove any leftover files if this is an upgrade. # Remove any leftover files if this is an upgrade.
[ -f "$cac_dir/m-$pkg_name" ] [ -f "$cac_dir/m-$pkg_name" ]
@ -949,7 +947,7 @@ args() {
# Print version and exit. # Print version and exit.
v*) v*)
log "$kiss 0.4.2" log "$kiss 0.5.0"
;; ;;
# Catch all invalid arguments as well as # Catch all invalid arguments as well as