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

[Xen-changelog] [xen-unstable] tools: ocaml: remove non-posix-ism from sed script.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306255922 -3600
# Node ID b4e5983c62a2ca977fa980cacee49721c37e17a2
# Parent  c0d31d436dea134ea399653686df24dc12910aa1
tools: ocaml: remove non-posix-ism from sed script.

Christoph Egger reported than on NetBSD the build fails with

        Parsing tools/ocaml/libs/xl/../../../../tools/libxl/libxl.idl
        sed: 1: "1i(*\
          * AUTO-GENERATED ...": command i expects \ followed by test
        gmake[7]: Leaving directory `tools/ocaml/libs/xl'

The following was tested by Christoph on NetBSD and also with GNU-sed
with and without the --posix flag.

In addition when sed fails will still create the output file, which confuses
subsequent make invocations. Generate to a temporary file and move into place
only on success.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Christoph Egger <Christoph.Egger@xxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r c0d31d436dea -r b4e5983c62a2 tools/ocaml/libs/xl/Makefile
--- a/tools/ocaml/libs/xl/Makefile      Tue May 24 10:14:10 2011 +0100
+++ b/tools/ocaml/libs/xl/Makefile      Tue May 24 17:52:02 2011 +0100
@@ -17,29 +17,33 @@
 
 OCAML_LIBRARY = xl
 
-GENERATED_FILES += xl.ml xl.mli
+GENERATED_FILES += xl.ml xl.ml.tmp xl.mli xl.mli.tmp
 GENERATED_FILES += _libxl_types.ml.in _libxl_types.mli.in
 GENERATED_FILES += _libxl_types.inc
 
 all: $(INTF) $(LIBS)
 
 xl.ml: xl.ml.in _libxl_types.ml.in
-       $(Q)sed -e '1i(*\
+       $(Q)sed -e '1i\
+(*\
  * AUTO-GENERATED FILE DO NOT EDIT\
  * Generated from xl.ml.in and _libxl_types.ml.in\
  *)\
 ' \
            -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.ml.in' \
-         < xl.ml.in > xl.ml
+         < xl.ml.in > xl.ml.tmp
+       $(Q)mv xl.ml.tmp xl.ml
 
 xl.mli: xl.mli.in _libxl_types.mli.in
-       $(Q)sed -e '1i(*\
+       $(Q)sed -e '1i\
+(*\
  * AUTO-GENERATED FILE DO NOT EDIT\
  * Generated from xl.mli.in and _libxl_types.mli.in\
  *)\
 ' \
            -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.mli.in' \
-         < xl.mli.in > xl.mli
+         < xl.mli.in > xl.mli.tmp
+       $(Q)mv xl.mli.tmp xl.mli
 
 _libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py 
$(XEN_ROOT)/tools/libxl/libxl.idl \
                 $(XEN_ROOT)/tools/libxl/libxltypes.py

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.