make, scripts: Preserve modification time on installation

Implemented -p switch on pkg.sh log-install and used it on standard
installation rules.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-08-31 19:40:39 +00:00
commit 92040c66e7
12 changed files with 34 additions and 28 deletions

View file

@ -420,7 +420,7 @@ build_pkg()
scm_files |
grep -v VERSION |
cpio -o -H newc |
( cd $src_tree; cpio --make-directories -i)
( cd $src_tree; cpio -m --make-directories -i)
echo $version > $src_tree/VERSION
local pkgfmt
@ -669,6 +669,7 @@ cmd_log_install()
local c_opmode=opmode_install
local c_absolute=0
local c_wrap=0
local install_opts
set -- `getopt 'DLWi:a:f:l:bg:cdm:o:psS:vA' $*`
@ -696,8 +697,10 @@ cmd_log_install()
;;
-b)
install_opts="$install_opts $1"
;;
-c)
install_opts="$install_opts $1"
;;
-d)
c_mode_dir=true;;
@ -713,13 +716,16 @@ cmd_log_install()
c_owner=$2
shift;;
-p)
install_opts="$install_opts $1"
;;
-s)
install_opts="$install_opts $1"
;;
-S)
c_suffix=$2
shift;;
-v)
install_opts="$install_opts $1"
;;
-L)
c_opmode=opmode_link;;
@ -754,8 +760,8 @@ cmd_log_install()
check_create_parent $c_create_leading_dirs $c_target
cp -d $c_source $c_target || exit $?
else
[ "$c_create_leading_dirs" ] && local opts=-D
install $opts $args || exit $?
[ "$c_create_leading_dirs" ] && local install_opts="$install_opts -D"
install $install_opts $args || exit $?
fi
;;