| Branch: | Tag: | Revision:

root / autotools / convert-constants @ cefd4a4a

History | View | Annotate | Download (10.7 kB)

# Date Author Comment
9b773665 11/30/2012 03:54 pm Iustin Pop

Enable equivalence checks of opcode list

This patch enhances the opcode list checks - instead of spawning a
Python interpreter to display the opcode list, we export it statically
in Constants.hs via a slight convert-constants change.

Furthermore, since we now have opcode parity, we enable full opcode...

9ba02574 11/20/2012 11:25 am Iustin Pop

Add custom code for CV_E* constants to convert-constants

Currently, the cluster verify errors are defined as follows:


This means there's no standalone name for the string "ECLUSTER_FOO",
which makes it hard to derive automatically a type for this union in...

d5cc16d7 10/11/2012 01:53 pm Iustin Pop

Enable conversion of errors constants

These will be needed for the serialisation of errors.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

9eeb0aa5 09/18/2012 06:11 pm Michael Hanselmann

Use autoconf-based paths from Haskell instead of constants

Future changes will change Path.hs to use an environment variable.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

8c957eb3 09/03/2012 04:45 pm Iustin Pop

Extend convert-constants support for dicts

This enhances convert-constants to not flatten dicts completely, but
also generate a so-called association list for them.

This allows either direct use of the 'lookup' function, or (for
performance) conversion to Data.Map and optimised lookup later....

806aa124 09/03/2012 03:13 pm Iustin Pop

Enhance convert-constants list generation

While looking at the hypervisor types in Constants.hs, I saw that the
'hyperTypes' list is using strings instead of names. This is due to
the fact that we require the entire elements in the list to be
identified (homogeneous lists), but the string "xen-pvm" is declared...

31d1d442 08/28/2012 06:00 pm Iustin Pop

convert-constants: also export constants

Since these will be needed for Haskell's implementation of query2.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

09dc9a02 05/07/2012 11:19 am Iustin Pop

Implement support for multi-module export

This add support for exporting constants from multiple modules (as
opposed to hard-coding constants), and also makes the output more
readable by skipping things we know for sure we don't want to convert
(as opposed to things we would like to but don't know how to...

79a04823 05/07/2012 11:19 am Iustin Pop

Implement reverse mapping of values to names

This adds a bit of dumb mapping of values to names, while trying to be
safe. This is the best we can do without resorting to parsing or
interpreting ASTs.

The difference in the output is:

-- | Converted from Python list or set ADMINST_ALL...
26fce8df 01/13/2012 03:16 pm Iustin Pop

Add support for RE patterns to convert constants

This is a trivial conversion.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

cf57f778 01/13/2012 03:16 pm Iustin Pop

Add support for lists/frozensets in convert-constants

Unfortunately, we only support lists of simple types, and not even
lists of tuples. If we actually needed those, it would be possible to
implement them, with a bit more complexity in the converter.

Signed-off-by: Iustin Pop <>...

2325bfcf 01/13/2012 03:16 pm Iustin Pop

Add support for tuples in convert-constants

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

df41d855 01/13/2012 03:16 pm Iustin Pop

More improvements to convert-constants

This prepares for tuple and other conversions.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

8751c041 01/13/2012 03:16 pm Iustin Pop

Improve convert-constants to handle dictionaries

The two main drawbacks for convert-constants are the fact that it
can't handle sets/frozensets (mainly due to the fact that I don't know
how useful this would be to the Haskell code) and that it cannot
export dictionaries....

606e71d3 07/13/2011 01:00 pm Iustin Pop

Fix some issues in htools apidoc generation

First, auto-generated files were not processed if HsColour thus the
'source' link in Haddock documentation was dangling.

Second, we document the original Python constant name in the
Ganeti.Constants source, so that it's easily retrievable (as opposed...

d99d1e36 05/24/2011 06:22 pm Iustin Pop

Implement conversion of Python constants to Haskell

With the merge of the repositories, we can now auto-generate the code
for Haskell constants from the Python code.

Currently this only handles the basic types (strings and
integers). Handling containers such as lists and dictionaries is only...