[Xorp-users] PATCH: Fix xif and .tgt compile on Fedora 12.

Ben Greear greearb at candelatech.com
Fri Mar 5 23:00:00 PST 2010


It seems that cpp changed behaviour in Fedora 12, and that exposed the
fragility of the xif and tgt syntax.

I changed it so that all functions and target statements must end with a semi-colon.

This lets the parser deal with whatever cpp outputs in Fedora 12 and shouldn't hurt
any other platform.

The patch is very large and boring, and in my xorp.ct tree.  I'm including a snippet
below to give an idea of what I did.  If anyone wants the full patch, please check
out my xorp.ct tree or ask me.

Thanks,
Ben

diff --git a/xrl/scripts/Xif/parse.py b/xrl/scripts/Xif/parse.py
index f51e1be..5b7e595 100644
--- a/xrl/scripts/Xif/parse.py
+++ b/xrl/scripts/Xif/parse.py
@@ -290,6 +290,14 @@ class XifParser:
                  line_buffer = line_buffer[0 : -1]
                  continue

+            # Must terminate with semi-colon
+            if line_buffer[-1] != ";":
+                #print "line_buffer doesn't end with semicolon, continuing: ", line_buffer
+                continue
+            else:
+                line_buffer = line_buffer[0 : -1]
+                #print "got line: ", line_buffer
+
              # Parse line
              while line_buffer != "":
                  # This strip() is paranoia

diff --git a/xrl/targets/finder.tgt b/xrl/targets/finder.tgt
index d573216..b71b764 100644
--- a/xrl/targets/finder.tgt
+++ b/xrl/targets/finder.tgt
@@ -6,4 +6,4 @@

  target finder implements       common/0.1,                             \
                                 finder/0.2,                             \
-                               finder_event_notifier/0.1
+                               finder_event_notifier/0.1;

diff --git a/xrl/interfaces/finder_client.xif b/xrl/interfaces/finder_client.xif
index 7614878..4f3493a 100644
--- a/xrl/interfaces/finder_client.xif
+++ b/xrl/interfaces/finder_client.xif
@@ -6,8 +6,9 @@
    */

  interface finder_client/0.2 {
+
         /** No op method used by finder to poll for liveness. */
-       hello
+       hello;

         /**
          * Remove Xrl from cache.  The client should remove currently
@@ -16,16 +17,16 @@ interface finder_client/0.2 {
          * information, though implementations may consult the Finder for
          * updated information before.
          */
-       remove_xrl_from_cache ? xrl:txt
+       remove_xrl_from_cache ? xrl:txt;

         /**
          * Remove all Xrls relating to target from cache.
          */
-       remove_xrls_for_target_from_cache ? target_name:txt
+       remove_xrls_for_target_from_cache ? target_name:txt;

         /**
          * Execute tunneled Xrl.  Permits finder to call methods on
          * clients through FinderClient.
          */
-        dispatch_tunneled_xrl ? xrl:txt -> xrl_error:u32 & xrl_error_note:txt
+        dispatch_tunneled_xrl ? xrl:txt -> xrl_error:u32 & xrl_error_note:txt;
  }

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-users mailing list