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

@ -348,25 +348,25 @@ endef
# --- special installation rules, that the general rules farther down
# below don't catch for whatever reason >
$(INSTALL_INITDIR)/%: %.init | provide_dir_INIT
$(INSTALL) -o $(INITOWNER) -g $(INITGROUP) -m $(INITMODE) $< $@
$(INSTALL) -p -o $(INITOWNER) -g $(INITGROUP) -m $(INITMODE) $< $@
$(INSTALL_SYSTEMDDIR)/%.service: %.service | provide_dir_SYSTEMD
$(INSTALL) -o $(SYSTEMDOWNER) -g $(SYSTEMDGROUP) -m $(SYSTEMDMODE) $< $@
$(INSTALL) -p -o $(SYSTEMDOWNER) -g $(SYSTEMDGROUP) -m $(SYSTEMDMODE) $< $@
$(INSTALL_LOGROTDIR)/%: %.logrotate | provide_dir_LOGROT
$(INSTALL) -o $(LOGROTOWNER) -g $(LOGROTGROUP) -m $(LOGROTMODE) $< $@
$(INSTALL) -p -o $(LOGROTOWNER) -g $(LOGROTGROUP) -m $(LOGROTMODE) $< $@
$(INSTALL_APACHE_CONFDIR)/%.conf: %.apache-conf | provide_dir_APACHE_CONF
$(INSTALL) -o $(APACHE_CONFOWNER) -g $(APACHE_CONFGROUP) -m $(APACHE_CONFMODE) $< $@
$(INSTALL) -p -o $(APACHE_CONFOWNER) -g $(APACHE_CONFGROUP) -m $(APACHE_CONFMODE) $< $@
$(INSTALL_RSYSLOGDIR)/%.conf: %.rsyslog | provide_dir_RSYSLOG
$(INSTALL) -o $(RSYSLOGOWNER) -g $(RSYSLOGGROUP) -m $(RSYSLOGMODE) $< $@
$(INSTALL) -p -o $(RSYSLOGOWNER) -g $(RSYSLOGGROUP) -m $(RSYSLOGMODE) $< $@
$(INSTALL_RSYSLOGDIR)/%.bprof: rsyslog-%.bprof | provide_dir_RSYSLOG
$(INSTALL) -o $(RSYSLOGOWNER) -g $(RSYSLOGGROUP) -m $(RSYSLOGMODE) $< $@
$(INSTALL) -p -o $(RSYSLOGOWNER) -g $(RSYSLOGGROUP) -m $(RSYSLOGMODE) $< $@
$(INSTALL_SYSCFGDIR)/%: %.sysconf | provide_dir_SYSCFG
$(INSTALL) -o $(INITOWNER) -g $(INITGROUP) -m $(INITMODE) $< $@
$(INSTALL) -p -o $(INITOWNER) -g $(INITGROUP) -m $(INITMODE) $< $@
# --- special installation rules <
@ -390,8 +390,8 @@ $$(TOPDIR)/dir_install_$(1).done:
$$(BUILD_$(1)DIR)/%: % $$(TOPDIR)/dir_build_$(1).done
@if [ ! $$< -ef $$@ -a "`echo $$< | $(SED) 's/\..*//'`" != local ]; then \
echo install -m $($(1)MODE) $$< $$@ ;\
install -m $($(1)MODE) $$< $$@ ;\
echo install -p -m $($(1)MODE) $$< $$@ ;\
install -p -m $($(1)MODE) $$< $$@ ;\
rm -f $$(TOPDIR)/dirs-*.done ;\
fi
@ -399,7 +399,7 @@ $$(INSTALL_$(1)DIR):
$$(INSTALL) -d -o $$($(1)DIROWNER) -g $$($(1)DIRGROUP) -m $$($(1)DIRMODE) $$(INSTALL_$(1)DIR)
$$(INSTALL_$(1)DIR)/%: % | $$(INSTALL_$(1)DIR)
$$(INSTALL) -o $$($(1)OWNER) -g $$($(1)GROUP) -m $$($(1)MODE) $$< $$@
$$(INSTALL) -p -o $$($(1)OWNER) -g $$($(1)GROUP) -m $$($(1)MODE) $$< $$@
endef
#endef
@ -418,7 +418,7 @@ endif
$(INSTALLED_PROFILE_PATH_SCRIPT): $(TOPDIR)/profiledir.done
echo "if [ -z \"\$$PATH\" ]; then PATH=$(shell echo $(INSTALL_EXEDIR) | $(SED) -e s%^$(ENV_PREFIX)/%/%)" > path_script.sh
echo "else PATH=\$$PATH:$(shell echo $(INSTALL_EXEDIR) | $(SED) -e s%^$(ENV_PREFIX)/%/%); fi" >> path_script.sh
$(INSTALL) -o $(PROFILEOWNER) -g $(PROFILEGROUP) -m $(PROFILEMODE) path_script.sh $@
$(INSTALL) -p -o $(PROFILEOWNER) -g $(PROFILEGROUP) -m $(PROFILEMODE) path_script.sh $@
find:
@bash $(MOD_SCRIPT_DIR)/list-cvs-files.sh