lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 7e5e193 5/5: Replace non-recursive 'cp' with


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 7e5e193 5/5: Replace non-recursive 'cp' with 'install'
Date: Sat, 13 Jun 2020 17:37:03 -0400 (EDT)

branch: master
commit 7e5e193c1f7a58b20051cbace2ad3daa26df52f5
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Replace non-recursive 'cp' with 'install'
    
    As in the last commit, '-c' is used to mark possible future '-C' use.
    
    In the first 'GNUmakefile' hunk, 'install' replaces the combination of
    'cp' and 'chmod'. The '--archive' flag for 'cp' there was specified for
    no reason other than that in implies '--preserve', which makes these
    files executable; 'install -m 0775' accomplishes the same thing.
---
 GNUmakefile    |  5 ++---
 objects.make   |  2 +-
 workhorse.make | 26 +++++++++++++-------------
 3 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index e44313c..a35ffdf 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -238,8 +238,7 @@ $(build_dir): $(gpl_files)
        +@[ -d $(locallibdir)     ] || $(MKDIR) --parents $(locallibdir)
        +@[ -d $(localincludedir) ] || $(MKDIR) --parents $(localincludedir)
        +@for z in $(compiler_runtime_files); do \
-           $(CP) --archive --update $$z $(localbindir) ; \
-           $(CHMOD) -R g=u $(localbindir)/`basename $$z` ; \
+           $(INSTALL) -c -m 0775 -c $$z $(localbindir) ; \
          done;
        +@$(MAKETARGET)
 
@@ -422,7 +421,7 @@ TEST_CODING_RULES := $(build_dir)/test_coding_rules$(EXEEXT)
 .PHONY: custom_tools
 custom_tools:
        @$(MAKE) test_coding_rules$(EXEEXT)
-       @$(CP) --preserve --update $(TEST_CODING_RULES) $(localbindir)
+       @$(INSTALL) -c -m 0775 $(TEST_CODING_RULES) $(localbindir)
 
 
################################################################################
 
diff --git a/objects.make b/objects.make
index 0b7e613..908c51d 100644
--- a/objects.make
+++ b/objects.make
@@ -1099,7 +1099,7 @@ elapsed_time$(EXEEXT): \
 # Copy this binary to the local bin directory, so that it's available
 # for 'authenticity_test' and 'system_command_test'.
 # MD5 !! Obviate this by rewriting those unit tests.
-lmi_md5sum$(EXEEXT): POST_LINK_COMMAND = $(CP) --preserve $@ $(localbindir)
+lmi_md5sum$(EXEEXT): POST_LINK_COMMAND = $(INSTALL) -m 0775 $@ $(localbindir)
 lmi_md5sum$(EXEEXT): \
   $(boost_filesystem_objects) \
   $(main_auxiliary_common_objects) \
diff --git a/workhorse.make b/workhorse.make
index 34f63b1..904de3b 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -1009,8 +1009,10 @@ lmi_msw_res.o: lmi.ico
 
 # Install.
 #
-# Architecture-independent files are copied with 'cp --update'.
-# Architecture-dependent files are copied without '--update'.
+# Architecture-independent files are installed with '-c'.
+# Architecture-dependent files are installed without '-c'.
+# Of course, '-c' is ignored; it flags situations where '-C'
+# might be useful.
 
 data_files := \
   $(wildcard $(addprefix $(srcdir)/,*.ico *.png *.xml *.xrc *.xsd *.xsl)) \
@@ -1030,9 +1032,9 @@ install: $(default_targets)
        +@[ -d $(datadir)        ] || $(MKDIR) --parents $(datadir)
        +@[ -d $(test_dir)       ] || $(MKDIR) --parents $(test_dir)
        +@[ -d $(touchstone_dir) ] || $(MKDIR) --parents $(touchstone_dir)
-       @$(CP) --preserve $(installable_binaries) $(bindir)
-       @$(CP) --preserve --update $(data_files) $(datadir)
-       @$(CP) --preserve --update $(help_files) $(datadir)
+       @$(INSTALL) -m 0775 $(installable_binaries) $(bindir)
+       @$(INSTALL) -c -m 0664 $(data_files) $(datadir)
+       @$(INSTALL) -c -m 0664 $(help_files) $(datadir)
        @datadir=$(datadir) srcdir=$(srcdir) $(srcdir)/mst_to_xst.sh
 ifeq (,$(USE_SO_ATTRIBUTES))
        @cd $(datadir); $(PERFORM) $(bindir)/product_files$(EXEEXT)
@@ -1176,15 +1178,13 @@ fardel: install
        @$(MAKE) --file=$(this_makefile) --directory=$(fardel_dir) wrap_fardel
        @$(ECHO) "Created '$(fardel_name)' archive in '$(fardel_root)'."
 
-# $(CP) is used without '--update' so that custom extra files can
-# replace defaults regardless of their datestamps.
-
 .PHONY: wrap_fardel
 wrap_fardel:
-       @$(CP) $(datadir)/configurable_settings.xml .
-       @$(CP) $(datadir)/company_logo.png .
-       @$(CP) $(datadir)/group_quote_banner.png .
-       @$(CP) --preserve $(fardel_binaries) $(fardel_files) .
+       @$(INSTALL) -m 0664 $(datadir)/configurable_settings.xml .
+       @$(INSTALL) -m 0664 $(datadir)/company_logo.png .
+       @$(INSTALL) -m 0664 $(datadir)/group_quote_banner.png .
+       @$(INSTALL) -m 0775 $(fardel_binaries) .
+       @$(INSTALL) -m 0664 $(fardel_files) .
        @$(fardel_date_script)
        @$(MD5SUM) --binary $(fardel_checksummed_files) >validated.md5
        @$(PERFORM) $(bindir)/generate_passkey > passkey
@@ -1455,7 +1455,7 @@ system_test: $(datadir)/configurable_settings.xml 
$(touchstone_md5sums) install
          && $(MAKE) --file=$(this_makefile) --directory=$(test_dir) $$testdecks
        @$(SORT) --output=$(system_test_analysis) $(system_test_analysis)
        @$(SORT) --key=2  --output=$(system_test_md5sums) $(system_test_md5sums)
-       @$(CP) --preserve --update $(system_test_md5sums) 
$(system_test_md5sums2)
+       @$(INSTALL) -c -m 0664 $(system_test_md5sums) $(system_test_md5sums2)
        @-< $(system_test_analysis) $(SED) \
          -e '/rel err.*e-0*1[5-9]/d' \
          -e '/abs.*0\.00.*rel/d' \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]