[fcm] 09/16: New upstream 2015.12.0

Alastair McKinstry mckinstry at moszumanska.debian.org
Tue Nov 1 12:16:28 UTC 2016


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository fcm.

commit 4bccb1e3f6e48ca7b0f483cde7611121ef439a27
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Sat Jan 16 17:57:39 2016 +0000

    New upstream 2015.12.0
---
 CHANGES.md                                         | 13 ++++
 doc/etc/fcm-version.js                             |  2 +-
 doc/user_guide/annex_cfg.html                      |  7 +-
 doc/user_guide/command_ref.html                    | 66 +++++++++++++++++
 doc/user_guide/make.html                           | 24 ++++++
 lib/FCM/Admin/System.pm                            | 63 ++++++++--------
 lib/FCM/CLI/fcm-test-battery.pod                   | 53 +++++++++++---
 lib/FCM/System/Make/Build.pm                       | 85 +++++++++++++++-------
 sbin/post-commit-bg                                | 28 +++++--
 t/fcm-install-svn-hook/00-basic.t                  | 24 +++++-
 t/fcm-install-svn-hook/00-basic/commit-conf-2.out  |  2 +-
 ...-conf-2.out => commit-conf-site-override-2.out} |  2 +-
 ...mmit-conf.out => commit-conf-site-override.out} |  2 +-
 t/fcm-install-svn-hook/00-basic/commit-conf.out    |  2 +-
 t/fcm-make/50-build-target-dep.t                   | 46 ++++++++++++
 t/fcm-make/50-build-target-dep/fcm-make.cfg        |  4 +
 t/fcm-make/50-build-target-dep/src/greet.f90       |  7 ++
 t/fcm-make/50-build-target-dep/src/greet_world.f90 |  3 +
 t/fcm-make/51-build-target-no-dep.t                | 59 +++++++++++++++
 t/fcm-make/51-build-target-no-dep/fcm-make.cfg     |  7 ++
 t/fcm-make/51-build-target-no-dep/src/greet.f90    |  4 +
 .../51-build-target-no-dep/src/greet_mod.f90       |  3 +
 .../51-build-target-no-dep/src/greet_world.f90     |  3 +
 .../51-build-target-no-dep/src2/hello_mod.f90      |  6 ++
 t/svn-hooks/03-post-commit-bg.t                    | 39 +++++++++-
 t/svn-hooks/test_header_more                       |  1 +
 26 files changed, 466 insertions(+), 89 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index e80c993..93fa553 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -5,6 +5,19 @@ for a full listing of issues for each release.
 
 --------------------------------------------------------------------------------
 
+## 2015.12.0 (2015-12-09)
+
+FCM release 31. Minor update.
+
+### Noteworthy Changes
+
+[#214](https://github.com/metomi/fcm/pull/214):
+fcm make: `build.prop` declarations: modifiers such as `dep.include`, `dep.o`,
+`no-dep.include` and `no-dep.o` are now supported with namespaces that are
+target names.
+
+--------------------------------------------------------------------------------
+
 ## 2015.11.0 (2015-11-17)
 
 FCM release 30. Minor update.
diff --git a/doc/etc/fcm-version.js b/doc/etc/fcm-version.js
index 025f4f2..b2e0097 100644
--- a/doc/etc/fcm-version.js
+++ b/doc/etc/fcm-version.js
@@ -1 +1 @@
-FCM.VERSION="2015.11.0";
+FCM.VERSION="2015.12.0";
diff --git a/doc/user_guide/annex_cfg.html b/doc/user_guide/annex_cfg.html
index c51c0ee..f78b808 100644
--- a/doc/user_guide/annex_cfg.html
+++ b/doc/user_guide/annex_cfg.html
@@ -1138,7 +1138,9 @@ build.prop{fc.libs}[myprog.exe] = netcdf grib
 
     <dt id="make.build.prop.dep.f.module">dep.f.module</dt>
 
-    <dd>Specifies a list of manual Fortran module dependencies.</dd>
+    <dd>Specifies a list of manual Fortran module dependencies. Note: This
+    modifier does not work if the name-space is specified using a target
+    name.</dd>
 
     <dt id="make.build.prop.dep.include">dep.include</dt>
 
@@ -1317,7 +1319,8 @@ build.prop{fc.libs}[myprog.exe] = netcdf grib
 
     <dd>Switches off a list of automatic Fortran module dependencies. If the
     value is a <samp>*</samp>, switches off all automatic Fortran module
-    dependencies.</dd>
+    dependencies. Note: This modifier does not work if the name-space is
+    specified using a target name.</dd>
 
     <dt id="make.build.prop.no-dep.include">no-dep.include</dt>
 
diff --git a/doc/user_guide/command_ref.html b/doc/user_guide/command_ref.html
index e778862..e360040 100644
--- a/doc/user_guide/command_ref.html
+++ b/doc/user_guide/command_ref.html
@@ -1812,6 +1812,72 @@ browser = konqueror
     </dd>
   </dl>
 
+  <h2 id="fcm-test-battery">fcm test-battery</h2>
+
+  <dl>
+    <dt>Usage</dt>
+
+    <dd><code>fcm test-battery [...]</code></dd>
+
+    <dt>Description</dt>
+
+    <dd>
+      <p>Run FCM self tests.</p>
+
+      <p>Change directory to the FCM source tree, and runs this shell
+      commmand:</p>
+
+      <pre>
+exec prove -j "${NPROC:-9}" -s -r "${@:-t}"
+</pre>
+
+      <p>where <var>NPROC</var> is the number of processors on your computer.
+      You can override the <a
+      href="http://perldoc.perl.org/prove.html">prove</a> command line by
+      specifying extra arguments. E.g. If you do not want to run the full test
+      suite, you can specify the names of individual test files or their
+      containing directories as extra arguments. For example:</p>
+
+      <p>Run the full test suite with the default options.</p>
+
+      <pre>
+fcm test-battery
+</pre>
+
+      <p>Run the full test suite with 12 processes.</p>
+
+      <pre>
+fcm test-battery -j 12
+</pre>
+
+      <p>Run only tests under <code>t/fcm-make/</code> with 12 processes.</p>
+
+      <pre>
+fcm test-battery -j 12 t/fcm-make
+</pre>
+
+      <p>Run only <code>t/fcm-make/10-log.t</code> in verbose mode.</p>
+
+      <pre>
+fcm test-battery -v t/fcm-make/10-log.t
+</pre>
+    </dd>
+
+    <dt>Environment Variables</dt>
+
+    <dd>
+      <dt>TEST_PROJECT</dt>
+
+      <dd>If this is set, run CM tests using a project sub-hierarchy in the test
+      repositories.</dd>
+
+      <dt>TEST_REMOTE_HOST</dt>
+
+      <dd>If this is set, run CM tests using an auto-generated Subversion server
+      on the host specified.</dd>
+    </dd>
+  </dl>
+
   <h2 id="fcm-update">fcm update</h2>
 
   <dl>
diff --git a/doc/user_guide/make.html b/doc/user_guide/make.html
index bc1403b..e01af33 100644
--- a/doc/user_guide/make.html
+++ b/doc/user_guide/make.html
@@ -1670,6 +1670,30 @@ build.prop{fc.flags}[sausage.o] = -O4
 build.prop{fc.flags}[src/food/sausage.f90] = -O4
 </pre>
 
+  <p>This works with most property modifiers, even for dependency related
+  modifiers such as <code>no-dep.o</code>. E.g.:</p>
+
+  <pre>
+build.prop{no-dep.include}[sausage.o] = enum.f90
+build.prop{include-paths}[sausage.o] = /path/to/additives
+</pre>
+  
+  <p>However, the following will not work:</p>
+
+  <pre>
+build.prop{no-dep.f.module}[sausage.o] = pork
+</pre>
+
+  <p>This is because an object file target is never dependent on a Fortran
+  module by its name. The following will work, however:</p>
+
+  <pre>
+build.prop{no-dep.include}[sausage.o] = pork.mod
+build.prop{no-dep.o}[sausage.mod] = pork.o
+# would be the same as:
+build.prop{no-dep.f.module}[src/food/sausage.f90] = pork
+</pre>
+
   <h3 id="build.target-source-fortran">Build Targets from Source Files: Fortran
   Specifics</h3>
 
diff --git a/lib/FCM/Admin/System.pm b/lib/FCM/Admin/System.pm
index 177ceb2..cd83788 100644
--- a/lib/FCM/Admin/System.pm
+++ b/lib/FCM/Admin/System.pm
@@ -634,6 +634,7 @@ sub install_svn_hook {
         map {sprintf("%s=%s\n", @{$_});}
         grep {$_->[1];} (
             ['FCM_HOME', $CONFIG->get_fcm_home()],
+            ['FCM_SITE_HOME', $CONFIG->get_fcm_site_home()],
             ['FCM_SVN_HOOK_ADMIN_EMAIL', $CONFIG->get_admin_email()],
             ['FCM_SVN_HOOK_COMMIT_DUMP_DIR', $CONFIG->get_svn_dump_dir()],
             ['FCM_SVN_HOOK_NOTIFICATION_FROM', $CONFIG->get_notification_from()],
@@ -643,8 +644,11 @@ sub install_svn_hook {
             ['TZ', 'UTC'],
         )
     );
-    my %can_clean;
-    my %norm_path_of = ();
+    my %path_of = ();
+    # Search for hook scripts:
+    # * default sets
+    # * selected items from top of repository, e.g. svnperms.conf
+    # * site overrides
     _get_files_from(
         catfile($CONFIG->get_fcm_home(), 'etc', 'svn-hooks'),
         sub {
@@ -652,51 +656,44 @@ sub install_svn_hook {
             if (index($base_name, q{.}) == 0 || -d $path) {
                 return;
             }
-            $norm_path_of{$base_name} = $path;
-            $can_clean{$base_name} = $path;
+            $path_of{$base_name} = $path;
         },
     );
-    # Install hook scripts and associated files
-    for my $key (sort keys(%norm_path_of)) {
-        my $hook_source = $norm_path_of{$key};
-        my $hook_dest = catfile($project->get_svn_live_hook_path(), $key);
-        run_copy($hook_source, $hook_dest);
-    }
-    # Install hook configurations from repository root, e.g. svnperms.conf
     for my $line (qx{svnlook tree -N $project_path}) {
         chomp($line);
-        my ($name) = $line =~ qr{\A\s*(.*)\z}msx;
-        if (grep {$_ eq $name} @SVN_REPOS_ROOT_HOOK_ITEMS) {
-            my $dest = catfile($project->get_svn_live_hook_path(), $name);
-            $RUNNER->run(
-                "install $dest <- ^/$name",
-                sub {
-                    my $source = "file://$project_path/$name";
-                    !system(qw{svn export -q --force}, $source, $dest)
-                        || die("\n");
-                    chmod((stat($dest))[2] | S_IRGRP | S_IROTH, $dest);
-                },
-            );
-            $can_clean{$name} = "^/$name";
+        my ($base_name) = $line =~ qr{\A\s*(.*)\z}msx;
+        if (grep {$_ eq $base_name} @SVN_REPOS_ROOT_HOOK_ITEMS) {
+            $path_of{$base_name} = "^/$base_name";
         }
     }
-    my %more_path_of = ();
     _get_files_from(
-        catfile($CONFIG->get_fcm_site_home(), 'svn-hooks', $project->get_name()),
+        catfile(
+            $CONFIG->get_fcm_site_home(), 'svn-hooks', $project->get_name(),
+        ),
         sub {
             my ($base_name, $path) = @_;
             if (index($base_name, q{.}) == 0 || -d $path) {
                 return;
             }
-            $more_path_of{$base_name} = $path;
-            $can_clean{$base_name} = $path;
+            $path_of{$base_name} = $path;
         },
     );
     # Install hook scripts and associated files
-    for my $key (sort keys(%more_path_of)) {
-        my $hook_source = $more_path_of{$key};
-        my $hook_dest = catfile($project->get_svn_live_hook_path(), $key);
-        if (!-e $hook_dest || compare($hook_source, $hook_dest)) {
+    for my $base_name (sort keys(%path_of)) {
+        my $hook_source = $path_of{$base_name};
+        my $hook_dest = catfile($project->get_svn_live_hook_path(), $base_name);
+        if (index($hook_source, '^/') == 0) {
+            $RUNNER->run(
+                "install $hook_dest <- $hook_source",
+                sub {
+                    my $source = "file://$project_path/$base_name";
+                    !system(qw{svn export -q --force}, $source, $hook_dest)
+                        || die("\n");
+                    chmod((stat($hook_dest))[2] | S_IRGRP | S_IROTH, $hook_dest);
+                },
+            );
+        }
+        else {
             run_copy($hook_source, $hook_dest);
         }
     }
@@ -704,7 +701,7 @@ sub install_svn_hook {
     if ($clean_mode) {
         my $hook_path = $project->get_svn_live_hook_path();
         for my $path (sort glob(catfile($hook_path, q{*}))) {
-            if (!exists($can_clean{basename($path)})) {
+            if (!exists($path_of{basename($path)})) {
                 run_rmtree($path);
             }
         }
diff --git a/lib/FCM/CLI/fcm-test-battery.pod b/lib/FCM/CLI/fcm-test-battery.pod
index ce7ae8f..e62a62f 100644
--- a/lib/FCM/CLI/fcm-test-battery.pod
+++ b/lib/FCM/CLI/fcm-test-battery.pod
@@ -1,25 +1,56 @@
 =head1 NAME
 
-fcm test-battery (self-tests)
+fcm test-battery
 
 =head1 SYNOPSIS
 
-Invokes the FCM self-tests.
+Run FCM self tests.
 
-    fcm test-battery [PROVE_ARGS]
+    fcm test-battery [...]
+
+=head1 ARGUMENTS
+
+Change directory to the FCM source tree, and runs this shell commmand:
+
+    exec prove -j "${NPROC:-9}" -s -r "${@:-t}"
+
+where NPROC is the number of processors on your computer. You can override the
+L<prove|prove> command line by specifying extra arguments. E.g. If you do not
+want to run the full test suite, you can specify the names of individual test
+files or their containing directories as extra arguments. For example:
+
+Run the full test suite with the default options.
+
+    fcm test-battery
+
+Run the full test suite with 12 processes.
+
+    fcm test-battery -j 12
+
+Run only tests under C<t/fcm-make/> with 12 processes.
+
+    fcm test-battery -j 12 t/fcm-make
+
+Run only C<t/fcm-make/10-log.t> in verbose mode.
+
+    fcm test-battery -v t/fcm-make/10-log.t
+
+=head1 OPTIONS
+
+Environment variables:
 
 =over 4
 
-=item 1. If an environment TEST_REMOTE_HOST is set, run CM tests using an
- auto-generated Subversion server on $TEST_REMOTE_HOST.
+=item TEST_PROJECT
 
-=item 2. If an environment variable TEST_PROJECT is set, run CM tests using a
- project sub-hierarchy in the test repositories.
+If this is set, run CM tests using a project sub-hierarchy in the test
+repositories.
 
-=head1 ARGUMENTS
+=item TEST_REMOTE_HOST
+
+If this is set, run CM tests using an auto-generated Subversion server on the
+host specified.
 
-PROVE_ARGS specifies override arguments for the 'prove' command. This is run
-from within the t/ subdirectory at the top of FCM's source tree.
-If not specified, the prove command will be run as 'prove -j 9 -r -s -f'.
+=back
 
 =cut
diff --git a/lib/FCM/System/Make/Build.pm b/lib/FCM/System/Make/Build.pm
index 201474b..27f6ada 100644
--- a/lib/FCM/System/Make/Build.pm
+++ b/lib/FCM/System/Make/Build.pm
@@ -888,7 +888,6 @@ sub _targets_from_sources {
         }
     }
     # Determine the targets for each source
-    #my %target_ns_list_of;
     SOURCE:
     while (my ($ns, $source) = each(%{$ctx->get_source_of()})) {
         my $type = $source->get_type();
@@ -972,33 +971,67 @@ sub _targets_from_sources {
             }
         }
     }
-    # Adds categorised name-space dependencies.
-    TARGET:
+
+    my %CTX_PROP_OF = %{$ctx->get_prop_of()};
     for my $target (@{$targets_ref}) {
-        if (!exists($target->get_info_of()->{'deps'})) {
-            next TARGET;
+        my $key = $target->get_key();
+        # Adds categorised name-space dependencies.
+        if (exists($target->get_info_of()->{'deps'})) {
+            CATEGORY:
+            while (my ($cat, $deps_in_ns_ref) = each(%deps_in_ns_in_cat_of)) {
+                if (!exists($target->get_info_of()->{'deps'}{$cat})) {
+                    next CATEGORY;
+                }
+                my $cfg_key = 'ns-dep.' . $cat;
+                my @ns_list = map {$_ eq q{/} ? q{} : $_}
+                    _props($attrib_ref, $cfg_key, $ctx, $target->get_ns());
+                for my $ns (@ns_list) {
+                    if (exists($deps_in_ns_ref->{$ns})) {
+                        push(
+                            @{$target->get_deps()},
+                            (   map  {[$_, $cat]}
+                                grep {$_ ne $key}
+                                @{$deps_in_ns_ref->{$ns}}
+                            ),
+                        );
+                    }
+                    else {
+                        # This will be reported later as missing dependency
+                        push(@{$target->get_deps()}, [$ns, $cat, 'ns-dep']);
+                    }
+                }
+            }
         }
-        CATEGORY:
-        while (my ($cat, $deps_in_ns_ref) = each(%deps_in_ns_in_cat_of)) {
-            if (!exists($target->get_info_of()->{'deps'}{$cat})) {
-                next CATEGORY;
+        # Remove target dependencies, if necessary
+        my @deps;
+        DEP:
+        for my $dep (@{$target->get_deps()}) {
+            my ($dep_key, $dep_type) = @{$dep};
+            my $cfg_key = 'no-dep.' . $dep_type;
+            if (    !exists($CTX_PROP_OF{$cfg_key})
+                ||  !exists($CTX_PROP_OF{$cfg_key}->get_ctx_of()->{$key})
+            ) {
+                push(@deps, $dep);
+                next DEP;
             }
-            my $name = 'ns-dep.' . $cat;
-            my @ns_list = map {$_ eq q{/} ? q{} : $_}
-                _props($attrib_ref, $name, $ctx, $target->get_ns());
-            for my $ns (@ns_list) {
-                if (exists($deps_in_ns_ref->{$ns})) {
-                    push(
-                        @{$target->get_deps()},
-                        (   map  {[$_, $cat]}
-                            grep {$_ ne $target->get_key()}
-                            @{$deps_in_ns_ref->{$ns}}
-                        ),
-                    );
-                }
-                else {
-                    # This will be reported later as missing dependency
-                    push(@{$target->get_deps()}, [$ns, $cat, 'ns-dep']);
+            my @no_dep_keys = shellwords(
+                $CTX_PROP_OF{$cfg_key}->get_ctx_of()->{$key}->get_value());
+            if (!grep {$_ eq $dep_key} @no_dep_keys) {
+                push(@deps, $dep);
+                next DEP;
+            }
+        }
+        $target->set_deps(\@deps);
+        # Add target dependencies, if necessary
+        for my $dep_type (keys(%{$target->get_dep_policy_of()})) {
+            my $cfg_key = 'dep.' . $dep_type;
+            if (    exists($CTX_PROP_OF{$cfg_key})
+                &&  exists($CTX_PROP_OF{$cfg_key}->get_ctx_of()->{$key})
+            ) {
+                my @dep_keys = shellwords(
+                    $CTX_PROP_OF{$cfg_key}->get_ctx_of()->{$key}->get_value());
+                for my $dep_key (@dep_keys) {
+                    push(@{$target->get_deps()}, [$dep_key, $dep_type]);
                 }
             }
         }
@@ -1015,11 +1048,11 @@ sub _targets_props_assign {
         = map {$_ => 1} _props($attrib_ref, 'no-inherit-target-category', $ctx);
     my %CTX_PROP_OF = %{$ctx->get_prop_of()};
     for my $target (@{$targets_ref}) {
+        my $key = $target->get_key();
         # Properties
         my $FILE_TYPE_UTIL
             = $attrib_ref->{file_type_util_of}->{$target->get_type()};
         my $task = $FILE_TYPE_UTIL->task_of()->{$target->get_task()};
-        my $key = $target->get_key();
         if ($task->can('prop_of')) {
             my %prop_of = %{$task->prop_of($target)};
             while (my $name = each(%prop_of)) {
diff --git a/sbin/post-commit-bg b/sbin/post-commit-bg
index 1a248dc..425b06f 100755
--- a/sbin/post-commit-bg
+++ b/sbin/post-commit-bg
@@ -44,6 +44,8 @@
 #   6. E-mails the host user account on error.
 #
 # ENVIRONMENT VARIABLES
+#   FCM_SITE_HOME
+#     The root location of site configuration.
 #   FCM_SVN_HOOK_COMMIT_DUMP_DIR
 #     The path to dump commit deltas. Generate a commit delta if specified.
 #   FCM_SVN_HOOK_TRAC_ROOT_DIR
@@ -119,17 +121,27 @@ main() {
     fi
 
     # Install commit.conf and svnperms.conf, if necessary
+    local NAME=$(basename "${REPOS}")
+    if [[ -n "${FCM_SVN_HOOK_REPOS_SUFFIX:-}" ]]; then
+        NAME="${NAME%${FCM_SVN_HOOK_REPOS_SUFFIX}}"
+    fi
     local CHANGED=$(svnlook changed -r "${REV}" "${REPOS}")
-    local NAME=
-    for NAME in 'commit.conf' 'svnperms.conf'; do
-        if grep -q "^....${NAME}\$" <<<"${CHANGED}"; then
+    local FILE=
+    for FILE in 'commit.conf' 'svnperms.conf'; do
+        # Ignore if there is a site override
+        if [[ -n "${FCM_SITE_HOME:-}" \
+            && -e "${FCM_SITE_HOME:-}/svn-hooks/${NAME}/${FILE}" ]]
+        then
+            continue
+        fi
+        if grep -q "^....${FILE}\$" <<<"${CHANGED}"; then
             # Don't specify revision, so always look at latest.
-            if svnlook filesize "${REPOS}" "${NAME}" >/dev/null 2>&1; then
-                echo "svnlook cat ${REPOS} ${NAME} >${REPOS}/hooks/${NAME}"
-                svnlook cat "${REPOS}" "${NAME}" >"${REPOS}/hooks/${NAME}"
+            if svnlook filesize "${REPOS}" "${FILE}" >/dev/null 2>&1; then
+                echo "svnlook cat ${REPOS} ${FILE} >${REPOS}/hooks/${FILE}"
+                svnlook cat "${REPOS}" "${FILE}" >"${REPOS}/hooks/${FILE}"
             else
-                echo "rm -f ${REPOS}/hooks/${NAME}"
-                rm -f "${REPOS}/hooks/${NAME}"
+                echo "rm -f ${REPOS}/hooks/${FILE}"
+                rm -f "${REPOS}/hooks/${FILE}"
             fi
         fi
     done
diff --git a/t/fcm-install-svn-hook/00-basic.t b/t/fcm-install-svn-hook/00-basic.t
index 0f61d0f..ae5dc0d 100755
--- a/t/fcm-install-svn-hook/00-basic.t
+++ b/t/fcm-install-svn-hook/00-basic.t
@@ -25,13 +25,14 @@
 if ! which svnadmin 1>/dev/null 2>/dev/null; then
     skip_all 'svnadmin not available'
 fi
-tests 149
+tests 173
 #-------------------------------------------------------------------------------
 FCM_REAL_HOME=$(readlink -f "$FCM_HOME")
 TODAY=$(date -u +%Y%m%d)
 mkdir -p conf/
 export FCM_CONF_PATH="$PWD/conf"
 cat >conf/admin.cfg <<__CONF__
+fcm_site_home=$PWD
 svn_group=
 svn_live_dir=$PWD/svn-repos
 svn_project_suffix=
@@ -39,6 +40,7 @@ __CONF__
 cat >hooks-env <<__CONF__
 [default]
 FCM_HOME=$FCM_REAL_HOME
+FCM_SITE_HOME=$PWD
 FCM_SVN_HOOK_ADMIN_EMAIL=$USER
 FCM_SVN_HOOK_COMMIT_DUMP_DIR=/var/svn/dumps
 FCM_SVN_HOOK_TRAC_ROOT_DIR=/srv/trac
@@ -128,7 +130,7 @@ TEST_KEY="$TEST_KEY_BASE-svnperms.conf"
 mkdir -p 'svn-import'
 echo '[foo]' >'svn-import/svnperms.conf'
 NAME='svnperms-conf' run_tests
-file_cmp "$TEST_KEY-ls-svnperms.conf" \
+file_cmp "$TEST_KEY-cmp" \
     'svn-repos/foo/hooks/svnperms.conf' 'svn-import/svnperms.conf'
 
 # New install, single repository, with commit.conf
@@ -138,7 +140,23 @@ TEST_KEY="$TEST_KEY_BASE-commit.conf"
     echo 'verify-branch-owner'
 } >'svn-import/commit.conf'
 NAME='commit-conf' run_tests
-file_cmp "$TEST_KEY-ls-svnperms.conf" \
+file_cmp "$TEST_KEY-cmp" \
     'svn-repos/foo/hooks/commit.conf' 'svn-import/commit.conf'
+
+# New install, single repository, with commit.conf and site override
+TEST_KEY="$TEST_KEY_BASE-commit.conf-site-override"
+{
+    echo 'notify-branch-owner'
+    echo 'verify-branch-owner'
+} >'svn-import/commit.conf'
+mkdir -p 'svn-hooks/foo'
+{
+    echo '# This is the override'
+    echo '# It is actually empty'
+} >'svn-hooks/foo/commit.conf'
+NAME='commit-conf-site-override' run_tests
+file_cmp "$TEST_KEY-cmp" \
+    'svn-repos/foo/hooks/commit.conf' 'svn-hooks/foo/commit.conf'
+rm -fr 'svn-hooks'
 #-------------------------------------------------------------------------------
 exit
diff --git a/t/fcm-install-svn-hook/00-basic/commit-conf-2.out b/t/fcm-install-svn-hook/00-basic/commit-conf-2.out
index 351fbf7..2d5e65a 100644
--- a/t/fcm-install-svn-hook/00-basic/commit-conf-2.out
+++ b/t/fcm-install-svn-hook/00-basic/commit-conf-2.out
@@ -1,6 +1,6 @@
+YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/commit.conf <- ^/commit.conf
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/post-commit to PWD/svn-repos/foo/hooks/post-commit
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/post-revprop-change to PWD/svn-repos/foo/hooks/post-revprop-change
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/pre-commit to PWD/svn-repos/foo/hooks/pre-commit
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/pre-revprop-change to PWD/svn-repos/foo/hooks/pre-revprop-change
-YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/commit.conf <- ^/commit.conf
 YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/svnperms.conf <- ^/svnperms.conf
diff --git a/t/fcm-install-svn-hook/00-basic/commit-conf-2.out b/t/fcm-install-svn-hook/00-basic/commit-conf-site-override-2.out
similarity index 84%
copy from t/fcm-install-svn-hook/00-basic/commit-conf-2.out
copy to t/fcm-install-svn-hook/00-basic/commit-conf-site-override-2.out
index 351fbf7..7b1ec66 100644
--- a/t/fcm-install-svn-hook/00-basic/commit-conf-2.out
+++ b/t/fcm-install-svn-hook/00-basic/commit-conf-site-override-2.out
@@ -1,6 +1,6 @@
+YYYY-mm-ddTHH:MM:SSZ: copy PWD/svn-hooks/foo/commit.conf to PWD/svn-repos/foo/hooks/commit.conf
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/post-commit to PWD/svn-repos/foo/hooks/post-commit
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/post-revprop-change to PWD/svn-repos/foo/hooks/post-revprop-change
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/pre-commit to PWD/svn-repos/foo/hooks/pre-commit
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/pre-revprop-change to PWD/svn-repos/foo/hooks/pre-revprop-change
-YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/commit.conf <- ^/commit.conf
 YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/svnperms.conf <- ^/svnperms.conf
diff --git a/t/fcm-install-svn-hook/00-basic/commit-conf.out b/t/fcm-install-svn-hook/00-basic/commit-conf-site-override.out
similarity index 91%
copy from t/fcm-install-svn-hook/00-basic/commit-conf.out
copy to t/fcm-install-svn-hook/00-basic/commit-conf-site-override.out
index 04c55a1..7c8eebb 100644
--- a/t/fcm-install-svn-hook/00-basic/commit-conf.out
+++ b/t/fcm-install-svn-hook/00-basic/commit-conf-site-override.out
@@ -1,8 +1,8 @@
+YYYY-mm-ddTHH:MM:SSZ: copy PWD/svn-hooks/foo/commit.conf to PWD/svn-repos/foo/hooks/commit.conf
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/post-commit to PWD/svn-repos/foo/hooks/post-commit
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/post-revprop-change to PWD/svn-repos/foo/hooks/post-revprop-change
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/pre-commit to PWD/svn-repos/foo/hooks/pre-commit
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/pre-revprop-change to PWD/svn-repos/foo/hooks/pre-revprop-change
-YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/commit.conf <- ^/commit.conf
 YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/svnperms.conf <- ^/svnperms.conf
 YYYY-mm-ddTHH:MM:SSZ: creating symlink: post-commit.log.TODAY -> PWD/svn-repos/foo/log/post-commit.log
 YYYY-mm-ddTHH:MM:SSZ: creating symlink: post-revprop-change.log.TODAY -> PWD/svn-repos/foo/log/post-revprop-change.log
diff --git a/t/fcm-install-svn-hook/00-basic/commit-conf.out b/t/fcm-install-svn-hook/00-basic/commit-conf.out
index 04c55a1..1b514f7 100644
--- a/t/fcm-install-svn-hook/00-basic/commit-conf.out
+++ b/t/fcm-install-svn-hook/00-basic/commit-conf.out
@@ -1,8 +1,8 @@
+YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/commit.conf <- ^/commit.conf
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/post-commit to PWD/svn-repos/foo/hooks/post-commit
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/post-revprop-change to PWD/svn-repos/foo/hooks/post-revprop-change
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/pre-commit to PWD/svn-repos/foo/hooks/pre-commit
 YYYY-mm-ddTHH:MM:SSZ: copy FCM_REAL_HOME/etc/svn-hooks/pre-revprop-change to PWD/svn-repos/foo/hooks/pre-revprop-change
-YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/commit.conf <- ^/commit.conf
 YYYY-mm-ddTHH:MM:SSZ: install PWD/svn-repos/foo/hooks/svnperms.conf <- ^/svnperms.conf
 YYYY-mm-ddTHH:MM:SSZ: creating symlink: post-commit.log.TODAY -> PWD/svn-repos/foo/log/post-commit.log
 YYYY-mm-ddTHH:MM:SSZ: creating symlink: post-revprop-change.log.TODAY -> PWD/svn-repos/foo/log/post-revprop-change.log
diff --git a/t/fcm-make/50-build-target-dep.t b/t/fcm-make/50-build-target-dep.t
new file mode 100755
index 0000000..58c2e56
--- /dev/null
+++ b/t/fcm-make/50-build-target-dep.t
@@ -0,0 +1,46 @@
+#!/bin/bash
+#-------------------------------------------------------------------------------
+# (C) British Crown Copyright 2006-15 Met Office.
+#
+# This file is part of FCM, tools for managing and building source code.
+#
+# FCM is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# FCM is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with FCM. If not, see <http://www.gnu.org/licenses/>.
+#-------------------------------------------------------------------------------
+# Test build.prop{dep.o}[target], etc.
+#-------------------------------------------------------------------------------
+. "$(dirname "$0")/test_header"
+tests 7
+#-------------------------------------------------------------------------------
+cp -r "${TEST_SOURCE_DIR}/${TEST_KEY_BASE}/"* '.'
+#-------------------------------------------------------------------------------
+TEST_KEY="${TEST_KEY_BASE}"
+
+run_fail "${TEST_KEY}-1" fcm make
+run_pass "${TEST_KEY}-1-log-grep" \
+    grep -F '[FAIL] ! greet.bin           : update task failed' 'fcm-make.log'
+
+# Explicitly add dependency to target
+run_pass "${TEST_KEY}-2" fcm make 'build.prop{dep.o}[greet.bin]=greet_world.o'
+grep '^\[info\] target ' 'fcm-make.log' >"${TEST_KEY}.target.log"
+file_cmp "${TEST_KEY}-2.target.log" "${TEST_KEY}.target.log" <<'__LOG__'
+[info] target greet.bin
+[info] target  - greet.o
+[info] target  - greet_world.o
+__LOG__
+
+run_pass "${TEST_KEY}.greet" "${PWD}/build/bin/greet.bin"
+file_cmp "${TEST_KEY}.greet.out" "${TEST_KEY}.greet.out" <<<'Greet World'
+file_cmp "${TEST_KEY}.greet.err" "${TEST_KEY}.greet.err" <'/dev/null'
+#-------------------------------------------------------------------------------
+exit 0
diff --git a/t/fcm-make/50-build-target-dep/fcm-make.cfg b/t/fcm-make/50-build-target-dep/fcm-make.cfg
new file mode 100644
index 0000000..333d0de
--- /dev/null
+++ b/t/fcm-make/50-build-target-dep/fcm-make.cfg
@@ -0,0 +1,4 @@
+steps=build
+build.source=$HERE/src
+build.target{task}=link
+build.prop{file-ext.bin}=.bin
diff --git a/t/fcm-make/50-build-target-dep/src/greet.f90 b/t/fcm-make/50-build-target-dep/src/greet.f90
new file mode 100644
index 0000000..3418351
--- /dev/null
+++ b/t/fcm-make/50-build-target-dep/src/greet.f90
@@ -0,0 +1,7 @@
+program greet
+interface
+subroutine greet_world()
+end subroutine greet_world
+end interface
+call greet_world()
+end program greet
diff --git a/t/fcm-make/50-build-target-dep/src/greet_world.f90 b/t/fcm-make/50-build-target-dep/src/greet_world.f90
new file mode 100644
index 0000000..d6ca365
--- /dev/null
+++ b/t/fcm-make/50-build-target-dep/src/greet_world.f90
@@ -0,0 +1,3 @@
+subroutine greet_world()
+write(*, '(a)') 'Greet World'
+end subroutine greet_world
diff --git a/t/fcm-make/51-build-target-no-dep.t b/t/fcm-make/51-build-target-no-dep.t
new file mode 100755
index 0000000..59ed70f
--- /dev/null
+++ b/t/fcm-make/51-build-target-no-dep.t
@@ -0,0 +1,59 @@
+#!/bin/bash
+#-------------------------------------------------------------------------------
+# (C) British Crown Copyright 2006-15 Met Office.
+#
+# This file is part of FCM, tools for managing and building source code.
+#
+# FCM is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# FCM is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with FCM. If not, see <http://www.gnu.org/licenses/>.
+#-------------------------------------------------------------------------------
+# Test build.prop{dep.o}[target], etc.
+#-------------------------------------------------------------------------------
+. "$(dirname "$0")/test_header"
+tests 7
+#-------------------------------------------------------------------------------
+cp -r "${TEST_SOURCE_DIR}/${TEST_KEY_BASE}/"* '.'
+#-------------------------------------------------------------------------------
+TEST_KEY="${TEST_KEY_BASE}"
+
+run_fail "${TEST_KEY}-1" fcm make
+sed -n '/bad or missing/p; /required by/p' 'fcm-make.log' >'fcm-make.log.edited'
+file_cmp "${TEST_KEY}-1-log-edited" 'fcm-make.log.edited' <<'__LOG__'
+[FAIL] hello_mod.mod: bad or missing dependency (type=1.include)
+[FAIL]     required by: greet_mod.o
+[FAIL]     required by: greet_mod.mod
+[FAIL]     required by: greet.o
+[FAIL]     required by: greet.bin
+__LOG__
+
+# Remove dependency from target
+mkdir 'hello'
+(cd 'hello'; gfortran -c '../src2/hello_mod.f90')
+(cd 'hello'; ar rs 'libhello.a' 'hello_mod.o' 2>'/dev/null')
+run_pass "${TEST_KEY}-2" fcm make \
+    'build.prop{no-dep.include}[greet_mod.o]=hello_mod.mod' \
+    'build.prop{no-dep.o}[greet_mod.mod]=hello_mod.o'
+grep '^\[info\] target ' 'fcm-make.log' >"${TEST_KEY}.target.log"
+file_cmp "${TEST_KEY}-2.target.log" "${TEST_KEY}.target.log" <<'__LOG__'
+[info] target greet.bin
+[info] target  - greet.o
+[info] target  -  - greet_mod.mod
+[info] target  -  -  - greet_mod.o
+[info] target  - greet_mod.o
+__LOG__
+
+run_pass "${TEST_KEY}.greet" "${PWD}/build/bin/greet.bin"
+file_cmp "${TEST_KEY}.greet.out" "${TEST_KEY}.greet.out" <<<'Greet world!'
+file_cmp "${TEST_KEY}.greet.err" "${TEST_KEY}.greet.err" <'/dev/null'
+#-------------------------------------------------------------------------------
+exit 0
diff --git a/t/fcm-make/51-build-target-no-dep/fcm-make.cfg b/t/fcm-make/51-build-target-no-dep/fcm-make.cfg
new file mode 100644
index 0000000..244e79e
--- /dev/null
+++ b/t/fcm-make/51-build-target-no-dep/fcm-make.cfg
@@ -0,0 +1,7 @@
+steps=build
+build.source=$HERE/src
+build.target{task}=link
+build.prop{file-ext.bin}=.bin
+build.prop{fc.include-paths} = $HERE/hello
+build.prop{fc.lib-paths} = $HERE/hello
+build.prop{fc.libs} = hello
diff --git a/t/fcm-make/51-build-target-no-dep/src/greet.f90 b/t/fcm-make/51-build-target-no-dep/src/greet.f90
new file mode 100644
index 0000000..a62f84f
--- /dev/null
+++ b/t/fcm-make/51-build-target-no-dep/src/greet.f90
@@ -0,0 +1,4 @@
+program greet
+use greet_mod, only: greet_world
+call greet_world()
+end program greet
diff --git a/t/fcm-make/51-build-target-no-dep/src/greet_mod.f90 b/t/fcm-make/51-build-target-no-dep/src/greet_mod.f90
new file mode 100644
index 0000000..71d0bda
--- /dev/null
+++ b/t/fcm-make/51-build-target-no-dep/src/greet_mod.f90
@@ -0,0 +1,3 @@
+module greet_mod
+use hello_mod, only: greet_world
+end module greet_mod
diff --git a/t/fcm-make/51-build-target-no-dep/src/greet_world.f90 b/t/fcm-make/51-build-target-no-dep/src/greet_world.f90
new file mode 100644
index 0000000..d6ca365
--- /dev/null
+++ b/t/fcm-make/51-build-target-no-dep/src/greet_world.f90
@@ -0,0 +1,3 @@
+subroutine greet_world()
+write(*, '(a)') 'Greet World'
+end subroutine greet_world
diff --git a/t/fcm-make/51-build-target-no-dep/src2/hello_mod.f90 b/t/fcm-make/51-build-target-no-dep/src2/hello_mod.f90
new file mode 100644
index 0000000..5948578
--- /dev/null
+++ b/t/fcm-make/51-build-target-no-dep/src2/hello_mod.f90
@@ -0,0 +1,6 @@
+module hello_mod
+contains
+subroutine greet_world()
+write(*, '(a)') 'Greet world!'
+end subroutine greet_world
+end module hello_mod
diff --git a/t/svn-hooks/03-post-commit-bg.t b/t/svn-hooks/03-post-commit-bg.t
index 444add0..829bd9e 100755
--- a/t/svn-hooks/03-post-commit-bg.t
+++ b/t/svn-hooks/03-post-commit-bg.t
@@ -38,7 +38,7 @@ test_tidy() {
         'mail.out'
 }
 #-------------------------------------------------------------------------------
-tests 40
+tests 44
 #-------------------------------------------------------------------------------
 cp -p "$FCM_HOME/etc/svn-hooks/post-commit" "$REPOS_PATH/hooks/"
 sed -i "/set -eu/a\
@@ -76,6 +76,43 @@ run_fail "$TEST_KEY.mail.out" test -e mail.out
 #-------------------------------------------------------------------------------
 # Install and remove commit.conf, svnperms.conf
 for NAME in 'commit.conf' 'svnperms.conf'; do
+    TEST_KEY="$TEST_KEY_BASE-no-add-${NAME}"
+    test_tidy
+    # (Use "svnperms.conf" syntax. Doesn't matter for the purpose of this test.)
+    cat >"${NAME}" <<'__CONF__'
+[foo]
+.*=*(add,remove,update)
+__CONF__
+    mkdir -p "svn-hooks/foo"
+    cat >"svn-hooks/foo/${NAME}" <<'__CONF__'
+# This is the site override
+[foo]
+.*=*(add,remove,update)
+__CONF__
+    cp -p "svn-hooks/foo/${NAME}" "$REPOS_PATH/hooks/${NAME}"
+    svn import --no-auth-cache -q -m"${TEST_KEY}" "${NAME}" \
+        "${REPOS_URL}/${NAME}"
+    REV="$(<'rev')"
+    poll 10 grep -q '^RET_CODE=' "$REPOS_PATH/log/post-commit.log"
+    date2datefmt "$REPOS_PATH/log/post-commit.log" \
+        | sed '/^trac-admin/d; s/^\(REV_FILE_SIZE=\).*\( #\)/\1???\2/' \
+        >"$TEST_KEY.log"
+    file_cmp "$TEST_KEY.log" "$TEST_KEY.log" <<__LOG__
+YYYY-mm-ddTHH:MM:SSZ+ $REV by $USER
+svnadmin dump -r$REV --incremental --deltas $REPOS_PATH | gzip \\
+    | (dd 'conv=fsync' "of=$PWD/svn-dumps/foo-$REV-tmp.gz" 2>/dev/null)
+* Dumped revision $REV.
+mv "$PWD/svn-dumps/foo-$REV-tmp.gz" "$PWD/svn-dumps/foo-$REV.gz"
+REV_FILE_SIZE=??? # <1MB
+RET_CODE=0
+__LOG__
+    file_cmp "${TEST_KEY}.conf" \
+        "svn-hooks/foo/${NAME}" "$REPOS_PATH/hooks/${NAME}"
+    rm -fr 'svn-hooks'
+
+    test_tidy
+    svn delete --no-auth-cache -q -m"Delete ${TEST_KEY}" "${REPOS_URL}/${NAME}"
+
     TEST_KEY="$TEST_KEY_BASE-add-${NAME}"
     test_tidy
     # (Use "svnperms.conf" syntax. Doesn't matter for the purpose of this test.)
diff --git a/t/svn-hooks/test_header_more b/t/svn-hooks/test_header_more
index 3399a79..e1c7225 100644
--- a/t/svn-hooks/test_header_more
+++ b/t/svn-hooks/test_header_more
@@ -110,6 +110,7 @@ HOOK_PATH="$PWD/bin:$HOOK_PATH"
 cat >"$REPOS_PATH/conf/hooks-env" <<__CONF__
 [default]
 FCM_HOME=$FCM_HOME
+FCM_SITE_HOME=$PWD
 FCM_SVN_HOOK_ADMIN_EMAIL=${FCM_SVN_HOOK_ADMIN_EMAIL:-}
 FCM_SVN_HOOK_COMMIT_DUMP_DIR=$PWD/svn-dumps
 FCM_SVN_HOOK_NOTIFICATION_FROM=notifications at localhost

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/fcm.git



More information about the debian-science-commits mailing list