lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] git commit: Allow .cfp clash between source and include dir
Date Sun, 16 Feb 2014 23:59:53 GMT
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master a130e81ee -> 95d2a7c7d


Allow .cfp clash between source and include dir


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/95d2a7c7
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/95d2a7c7
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/95d2a7c7

Branch: refs/heads/master
Commit: 95d2a7c7d0777e62643cd9eb235db38ae7c67869
Parents: a130e81
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Mon Feb 17 00:57:35 2014 +0100
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Feb 17 00:57:35 2014 +0100

----------------------------------------------------------------------
 compiler/src/CFCHierarchy.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/95d2a7c7/compiler/src/CFCHierarchy.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCHierarchy.c b/compiler/src/CFCHierarchy.c
index e059546..682638a 100644
--- a/compiler/src/CFCHierarchy.c
+++ b/compiler/src/CFCHierarchy.c
@@ -227,11 +227,20 @@ S_parse_parcel_files(const char *path, void *arg) {
     if (path_len > 4 && (strcmp((path + path_len - 4), ".cfp") == 0)) {
         CFCParcel *parcel = CFCParcel_new_from_file(path,
                                                     context->is_included);
-        CFCParcel *existing = CFCParcel_fetch(CFCParcel_get_name(parcel));
+        const char *name = CFCParcel_get_name(parcel);
+        CFCParcel *existing = CFCParcel_fetch(name);
         if (existing) {
             if (!CFCParcel_equals(parcel, existing)) {
-                CFCUtil_die("Incompatible parcel '%s' already registered",
-                            CFCParcel_get_name(parcel));
+                if (context->is_included && !CFCParcel_included(existing)) {
+                    // Allow clash between source and include dirs.
+                    CFCUtil_warn("Warning: Parcel %s from source dir takes "
+                                 "precedence over parcel from include dir",
+                                 name);
+                }
+                else {
+                    CFCUtil_die("Incompatible parcel '%s' already registered",
+                                CFCParcel_get_name(parcel));
+                }
             }
         }
         else {


Mime
View raw message