lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master f34b2f8 4/5: Replace 'cp' with 'install' for


From: Greg Chicares
Subject: [lmi-commits] [lmi] master f34b2f8 4/5: Replace 'cp' with 'install' for test prerequisites
Date: Sat, 13 Jun 2020 17:37:02 -0400 (EDT)

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

    Replace 'cp' with 'install' for test prerequisites
    
    Formerly, the '--preserve' option had been used with 'cp' merely out of
    habit, even though no attributes of these files needed preservation.
    Now, 'install' is used instead, with mode 0664 (rather than the more
    conventional 0644, for the same reason that umask is 0002).
    
    Losing '--update' is an unfortunate though minor pessimization, but
    'install -C' does not seem to be clearly documented. The coreutils
    manual's "install-invocation" chapter warns that it "could result in
    redundant copies or attributes that are not reset to the correct
    defaults" unless "--user, --group and --mode" are specified, but
    specifying those three extra options in order to use '--compare' safely
    seems excessive. For now, '-c' (a lowercase option that's ignored) is
    used where '--update' had been used previously and '-C' might now be
    appropriate.
---
 nychthemeral_test.sh |  4 ++--
 test_schemata.sh     | 10 +++++-----
 workhorse.make       |  6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/nychthemeral_test.sh b/nychthemeral_test.sh
index 2bf2841..55feba3 100755
--- a/nychthemeral_test.sh
+++ b/nychthemeral_test.sh
@@ -203,8 +203,8 @@ cd "$throwaway_dir"
 
 # Copy these files hither because the emission tests write some
 # output files to the input file's directory.
-cp /opt/lmi/src/lmi/sample.ill .
-cp /opt/lmi/src/lmi/sample.cns .
+install -m 0664 /opt/lmi/src/lmi/sample.ill .
+install -m 0664 /opt/lmi/src/lmi/sample.cns .
 
 printf '\n# test all valid emission types\n\n'
 
diff --git a/test_schemata.sh b/test_schemata.sh
index 69ec98f..d3ac216 100755
--- a/test_schemata.sh
+++ b/test_schemata.sh
@@ -39,11 +39,11 @@ jar_dir=/opt/lmi/third_party/rng
 
 # Data for testing.
 
-cp --preserve "$srcdir"/sample.cns "$srcdir"/sample.ill .
+install -m 0664 "$srcdir"/sample.cns "$srcdir"/sample.ill .
 
 # XSL template to sort cell subelements.
 
-cp --preserve "$srcdir"/sort_cell_subelements.xsl .
+install -m 0664 "$srcdir"/sort_cell_subelements.xsl .
 
 echo "  Test cell-subelement sorting."
 
@@ -62,7 +62,7 @@ diff --unified=0 sample.ill sorted.ill
 #
 # Only RNC is to be edited; XSD and RNG are generated from it.
 
-cp --preserve "$srcdir"/types.rnc "$srcdir"/cell.rnc 
"$srcdir"/multiple_cell_document.rnc "$srcdir"/single_cell_document.rnc .
+install -m 0664 "$srcdir"/types.rnc "$srcdir"/cell.rnc 
"$srcdir"/multiple_cell_document.rnc "$srcdir"/single_cell_document.rnc .
 
 echo "  Test RNC files with 'jing'."
 
@@ -78,7 +78,7 @@ java -jar $jar_dir/jing.jar -c single_cell_document.rnc   
sample.ill
 # XSD, generated from RNG, is stored in the repository because it's
 # widely used.
 
-cp --preserve "$srcdir"/types.xsd "$srcdir"/cell.xsd 
"$srcdir"/multiple_cell_document.xsd "$srcdir"/single_cell_document.xsd .
+install -m 0664 "$srcdir"/types.xsd "$srcdir"/cell.xsd 
"$srcdir"/multiple_cell_document.xsd "$srcdir"/single_cell_document.xsd .
 
 echo "  Test XSD files with 'jing'."
 
@@ -218,7 +218,7 @@ echo "  Regenerate XSD files as they should appear in the 
repository."
 # 'cell.xsd', which lacks <xs:complexType name="cell_element">, so
 # process 'multiple' before 'single'.
 
-cp --preserve "$srcdir"/types_*.rnc "$srcdir"/cell_*.rnc 
"$srcdir"/multiple_cell_document_*.rnc "$srcdir"/single_cell_document_*.rnc .
+install -m 0664 "$srcdir"/types_*.rnc "$srcdir"/cell_*.rnc 
"$srcdir"/multiple_cell_document_*.rnc "$srcdir"/single_cell_document_*.rnc .
 
 java -jar $jar_dir/trang.jar multiple_cell_document.rnc    
multiple_cell_document.xsd
 java -jar $jar_dir/trang.jar single_cell_document.rnc      
single_cell_document.xsd
diff --git a/workhorse.make b/workhorse.make
index bfef423..34f63b1 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -1215,10 +1215,10 @@ eraseme.policy:
 # Test data.
 
 sample.cns: $(srcdir)/sample.cns
-       $(CP) --preserve --update $< .
+       $(INSTALL) -c -m 0664 $< .
 
 sample.ill: $(srcdir)/sample.ill
-       $(CP) --preserve --update $< .
+       $(INSTALL) -c -m 0664 $< .
 
 test_data := \
   sample.cns \
@@ -1235,7 +1235,7 @@ test_data := \
 # local copies are provided for as needed.
 
 configurable_settings.xml:
-       @$(CP) --preserve --update $(datadir)/$@ .
+       @$(INSTALL) -c -m 0664 $(datadir)/$@ .
 
 
################################################################################
 



reply via email to

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