lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] odd/guess_config 3475525: Import 'config.guess'


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/guess_config 3475525: Import 'config.guess'
Date: Tue, 24 Sep 2019 20:01:23 -0400 (EDT)

branch: odd/guess_config
commit 3475525aeb0caa482a3796e64b2ec69b0e429d8e
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Import 'config.guess'
    
    It would seem much better to use the script installed as part of
    autotools, but that has no canonical location--it differs even
    among GNU/Linux distributions--so instead this advice is taken:
      www.gnu.org/software/gettext/manual/html_node/config_002eguess.html
    | You need to add the GNU config.guess and config.sub files to your
    | distribution. Normally, config.guess and config.sub are put at the
    | top level of a distribution.
    except that 'config.sub' is omitted as unnecessary.
---
 config.guess          |   1 +
 test_coding_rules.cpp | 163 +++++++++++++++++++++++++++-----------------------
 2 files changed, 89 insertions(+), 75 deletions(-)

diff --git a/config.guess b/config.guess
new file mode 120000
index 0000000..7c53173
--- /dev/null
+++ b/config.guess
@@ -0,0 +1 @@
+/usr/share/automake-1.16/config.guess
\ No newline at end of file
diff --git a/test_coding_rules.cpp b/test_coding_rules.cpp
index 7e2d050..a9bd432 100644
--- a/test_coding_rules.cpp
+++ b/test_coding_rules.cpp
@@ -57,21 +57,22 @@ enum enum_phylum
     ,e_cxx_header = 1 <<  3
     ,e_cxx_source = 1 <<  4
     ,e_ephemeral  = 1 <<  5
-    ,e_expungible = 1 <<  6
-    ,e_gpl        = 1 <<  7
-    ,e_html       = 1 <<  8
-    ,e_log        = 1 <<  9
-    ,e_make       = 1 << 10
-    ,e_md5        = 1 << 11
-    ,e_mustache   = 1 << 12
-    ,e_patch      = 1 << 13
-    ,e_rates      = 1 << 14
-    ,e_relax_ng   = 1 << 15
-    ,e_script     = 1 << 16
-    ,e_synopsis   = 1 << 17
-    ,e_touchstone = 1 << 18
-    ,e_xml_input  = 1 << 19
-    ,e_xml_other  = 1 << 20
+    ,e_exempt     = 1 <<  6
+    ,e_expungible = 1 <<  7
+    ,e_gpl        = 1 <<  8
+    ,e_html       = 1 <<  9
+    ,e_log        = 1 << 10
+    ,e_make       = 1 << 11
+    ,e_md5        = 1 << 12
+    ,e_mustache   = 1 << 13
+    ,e_patch      = 1 << 14
+    ,e_rates      = 1 << 15
+    ,e_relax_ng   = 1 << 16
+    ,e_script     = 1 << 17
+    ,e_synopsis   = 1 << 18
+    ,e_touchstone = 1 << 19
+    ,e_xml_input  = 1 << 20
+    ,e_xml_other  = 1 << 21
     };
 
 enum enum_kingdom
@@ -158,62 +159,63 @@ file::file(std::string const& file_path)
     // Sort each sublist by enumerator, but keep 'e_ephemeral' last.
     phylum_ =
         // extension() tests are simplest
-          ".ico"        == extension() ? e_binary
-        : ".ini"        == extension() ? e_binary
-        : ".png"        == extension() ? e_binary
-        : ".txt"        == extension() ? e_binary
-        : ".xpm"        == extension() ? e_binary
-        : ".h"          == extension() ? e_c_header
-        : ".c"          == extension() ? e_c_source
-        : ".hpp"        == extension() ? e_cxx_header
-        : ".cpp"        == extension() ? e_cxx_source
-        : ".tpp"        == extension() ? e_cxx_source
-        : ".xpp"        == extension() ? e_cxx_source
-        : ".bak"        == extension() ? e_expungible
-        : ".html"       == extension() ? e_html
-        : ".make"       == extension() ? e_make
-        : ".md5sums"    == extension() ? e_md5
-        : ".mst"        == extension() ? e_mustache
-        : ".patch"      == extension() ? e_patch
-        : ".rates"      == extension() ? e_rates
-        : ".rnc"        == extension() ? e_relax_ng
-        : ".ac"         == extension() ? e_script
-        : ".bat"        == extension() ? e_script
-        : ".m4"         == extension() ? e_script
-        : ".ps1"        == extension() ? e_script
-        : ".rc"         == extension() ? e_script
-        : ".sed"        == extension() ? e_script
-        : ".sh"         == extension() ? e_script
-        : ".touchstone" == extension() ? e_touchstone
-        : ".cns"        == extension() ? e_xml_input
-        : ".ill"        == extension() ? e_xml_input
-        : ".gpt"        == extension() ? e_xml_input
-        : ".mec"        == extension() ? e_xml_input
-        : ".inix"       == extension() ? e_xml_input
-        : ".database"   == extension() ? e_xml_other
-        : ".funds"      == extension() ? e_xml_other
-        : ".policy"     == extension() ? e_xml_other
-        : ".rounding"   == extension() ? e_xml_other
-        : ".strata"     == extension() ? e_xml_other
-        : ".xml"        == extension() ? e_xml_other
-        : ".xrc"        == extension() ? e_xml_other
-        : ".xsd"        == extension() ? e_xml_other
-        : ".xsl"        == extension() ? e_xml_other
+          ".ico"        == extension()   ? e_binary
+        : ".ini"        == extension()   ? e_binary
+        : ".png"        == extension()   ? e_binary
+        : ".txt"        == extension()   ? e_binary
+        : ".xpm"        == extension()   ? e_binary
+        : ".h"          == extension()   ? e_c_header
+        : ".c"          == extension()   ? e_c_source
+        : ".hpp"        == extension()   ? e_cxx_header
+        : ".cpp"        == extension()   ? e_cxx_source
+        : ".tpp"        == extension()   ? e_cxx_source
+        : ".xpp"        == extension()   ? e_cxx_source
+        : ".bak"        == extension()   ? e_expungible
+        : ".html"       == extension()   ? e_html
+        : ".make"       == extension()   ? e_make
+        : ".md5sums"    == extension()   ? e_md5
+        : ".mst"        == extension()   ? e_mustache
+        : ".patch"      == extension()   ? e_patch
+        : ".rates"      == extension()   ? e_rates
+        : ".rnc"        == extension()   ? e_relax_ng
+        : ".ac"         == extension()   ? e_script
+        : ".bat"        == extension()   ? e_script
+        : ".m4"         == extension()   ? e_script
+        : ".ps1"        == extension()   ? e_script
+        : ".rc"         == extension()   ? e_script
+        : ".sed"        == extension()   ? e_script
+        : ".sh"         == extension()   ? e_script
+        : ".touchstone" == extension()   ? e_touchstone
+        : ".cns"        == extension()   ? e_xml_input
+        : ".ill"        == extension()   ? e_xml_input
+        : ".gpt"        == extension()   ? e_xml_input
+        : ".mec"        == extension()   ? e_xml_input
+        : ".inix"       == extension()   ? e_xml_input
+        : ".database"   == extension()   ? e_xml_other
+        : ".funds"      == extension()   ? e_xml_other
+        : ".policy"     == extension()   ? e_xml_other
+        : ".rounding"   == extension()   ? e_xml_other
+        : ".strata"     == extension()   ? e_xml_other
+        : ".xml"        == extension()   ? e_xml_other
+        : ".xrc"        == extension()   ? e_xml_other
+        : ".xsd"        == extension()   ? e_xml_other
+        : ".xsl"        == extension()   ? e_xml_other
         // phyloanalyze() tests inspect only file name
-        : phyloanalyze("^ChangeLog-")  ? e_binary
-        : phyloanalyze("^tags$")       ? e_expungible
-        : phyloanalyze("^COPYING$")    ? e_gpl
-        : phyloanalyze("^quoted_gpl")  ? e_gpl
-        : phyloanalyze("Log$")         ? e_log
-        : phyloanalyze("GNUmakefile$") ? e_make
-        : phyloanalyze("^Makefile")    ? e_make
-        : phyloanalyze("^md5sums$")    ? e_md5
-        : phyloanalyze("^INSTALL$")    ? e_synopsis
-        : phyloanalyze("^README")      ? e_synopsis
+        : phyloanalyze("^ChangeLog-")    ? e_binary
+        : phyloanalyze("^config.guess$") ? e_exempt
+        : phyloanalyze("^tags$")         ? e_expungible
+        : phyloanalyze("^COPYING$")      ? e_gpl
+        : phyloanalyze("^quoted_gpl")    ? e_gpl
+        : phyloanalyze("Log$")           ? e_log
+        : phyloanalyze("GNUmakefile$")   ? e_make
+        : phyloanalyze("^Makefile")      ? e_make
+        : phyloanalyze("^md5sums$")      ? e_md5
+        : phyloanalyze("^INSTALL$")      ? e_synopsis
+        : phyloanalyze("^README")        ? e_synopsis
         // test file contents only if necessary
-        : begins_with(data(), "#!")    ? e_script
+        : begins_with(data(), "#!")      ? e_script
         // keep this last
-        : phyloanalyze("^eraseme")     ? e_ephemeral
+        : phyloanalyze("^eraseme")       ? e_ephemeral
         : throw std::runtime_error("File is unexpectedly uncategorizable.")
         ;
 
@@ -351,7 +353,8 @@ void assay_whitespace(file const& f)
         }
 
     if
-        (   !f.is_of_phylum(e_gpl)
+        (   !f.is_of_phylum(e_exempt)
+        &&  !f.is_of_phylum(e_gpl)
         &&  !f.is_of_phylum(e_make)
         &&  !f.is_of_phylum(e_patch)
         &&  !f.is_of_phylum(e_script)
@@ -368,7 +371,8 @@ void assay_whitespace(file const& f)
         }
 
     if
-        (   !f.is_of_phylum(e_gpl)
+        (   !f.is_of_phylum(e_exempt)
+        &&  !f.is_of_phylum(e_gpl)
         &&  !f.is_of_phylum(e_touchstone)
         &&  contains(f.data(), "\n\n\n")
         )
@@ -483,7 +487,8 @@ void check_config_hpp(file const& f)
 void check_copyright(file const& f)
 {
     if
-        (   f.is_of_phylum(e_gpl)
+        (   f.is_of_phylum(e_exempt)
+        ||  f.is_of_phylum(e_gpl)
         ||  f.is_of_phylum(e_md5)
         ||  f.is_of_phylum(e_patch)
         ||  f.is_of_phylum(e_touchstone)
@@ -665,7 +670,10 @@ void check_cxx(file const& f)
 
 void check_defect_markers(file const& f)
 {
-    if(f.phyloanalyze("^test_coding_rules_test.sh$"))
+    if
+        (   f.is_of_phylum(e_exempt)
+        ||  f.phyloanalyze("^test_coding_rules_test.sh$")
+        )
         {
         return;
         }
@@ -855,7 +863,8 @@ void check_logs(file const& f)
 void check_preamble(file const& f)
 {
     if
-        (   f.is_of_phylum(e_gpl)
+        (   f.is_of_phylum(e_exempt)
+        ||  f.is_of_phylum(e_gpl)
         ||  f.is_of_phylum(e_md5)
         ||  f.is_of_phylum(e_patch)
         ||  f.is_of_phylum(e_rates)
@@ -1005,7 +1014,10 @@ void check_reserved_names(file const& f)
         return;
         }
 
-    if(f.is_of_phylum(e_log))
+    if
+        (   f.is_of_phylum(e_exempt)
+        ||  f.is_of_phylum(e_log)
+        )
         {
         return;
         }
@@ -1033,7 +1045,8 @@ void check_reserved_names(file const& f)
 void enforce_taboos(file const& f)
 {
     if
-        (   f.phyloanalyze("test_coding_rules")
+        (   f.is_of_phylum(e_exempt)
+        ||  f.phyloanalyze("test_coding_rules")
         ||  f.phyloanalyze("^md5sums$")
         )
         {



reply via email to

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