diff options
author | merakor <cem@ckyln.com> | 2020-04-22 21:03:37 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2020-04-22 21:03:37 +0000 |
commit | ef39477c9ef4ef365d7f38e8bc261c7b9efb028e (patch) | |
tree | 64b946bdde154b2776e01460bd6260449bd5b55c /kiss | |
parent | 24386a5dcbfa4ae72aae9b63c355cc2e02f05360 (diff) | |
download | cpt-ef39477c9ef4ef365d7f38e8bc261c7b9efb028e.tar.gz |
kiss: use install instead of cp where possible
FossilOrigin-Name: 101e70067bc73239cfc1c525dadbd4971f77989868ae842ba48cbafc15041980
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -870,21 +870,18 @@ pkg_install_files() { # The 'test' will run with '-e' for no-overwrite and '-z' # for overwrite. case $line in /etc/*) ;; - */) [ -d "$line" ] || mkdir -m "$perms" "$line" ;; - *) test "$1" "$line" || cp -Pp "$2/$line" "${line%/*}" ;; + */) [ -d "$line" ] || + install -o root -g root -m "$perms" -d "$line" ;; + *) test "$1" "$line" || + if [ -L "$2/$line" ]; then + cp -fPp "$2/$line" "${line%/*}" + chown -h root:root "$line" + else + install -o root -g root -m "$perms" "$2/$line" "$line" + fi esac - # Set the ownership of the result to root:root. - chown root:root "$line" - - # Preserve permissions by using chmod. This runs after - # chown as chown will reset suid/guid when ownership changes. - # - # This only runs on non-directories as we desire the reset - # behavior mentioned above. - [ -d "$line" ] || chmod "$perms" "$line" - - printf '%s %s (%s)\e[K\r' "$3" "$i/$man_tot" "$line" + printf '%s %s (%s)\e[J\r' "$3" "$i/$man_tot" "$line" done printf '\n' |