Commit fec1fac1 authored by Jose A. Lopes's avatar Jose A. Lopes

Rename 'Constants.hs' to 'PyConstants.hs'

Rename the generated 'Constants.hs' module, which contains the Haskell
constants generated from Python, to 'PyConstants.hs' in order to
eliminate duplicated constants in Haskell, a problem introduced by the
Haskell to Python constant generation, and to circumvent a problem
with import/export of Haskell modules.  Add a new module named
'Constants.hs' which imports 'PyConstants.hs' and exports its names.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent d34c79b6
......@@ -136,7 +136,7 @@
/src/rpc-test
# automatically-built Haskell files
/src/Ganeti/Constants.hs
/src/Ganeti/Curl/Internal.hs
/src/Ganeti/PyConstants.hs
/src/Ganeti/Version.hs
/test/hs/Test/Ganeti/TestImports.hs
......@@ -586,6 +586,7 @@ HS_LIB_SRCS = \
src/Ganeti/Confd/Utils.hs \
src/Ganeti/Config.hs \
src/Ganeti/ConfigReader.hs \
src/Ganeti/Constants.hs \
src/Ganeti/Cpu/LoadParser.hs \
src/Ganeti/Cpu/Types.hs \
src/Ganeti/Curl/Multi.hs \
......@@ -721,7 +722,7 @@ HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
HS_BUILT_SRCS = \
test/hs/Test/Ganeti/TestImports.hs \
src/Ganeti/Constants.hs \
src/Ganeti/PyConstants.hs \
src/Ganeti/Curl/Internal.hs \
src/Ganeti/Version.hs
HS_BUILT_SRCS_IN = \
......@@ -1610,7 +1611,7 @@ src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
sed -e "s/%ver%/$$VCSVER/" < $< > $@
src/Ganeti/Constants.hs: src/Ganeti/Constants.hs.in \
src/Ganeti/PyConstants.hs: src/Ganeti/PyConstants.hs.in \
lib/constants.py lib/_autoconf.py lib/luxi.py lib/errors.py \
lib/jstore.py $(RUN_IN_TEMPDIR) \
$(CONVERT_CONSTANTS) $(built_base_sources) \
......@@ -1736,7 +1737,7 @@ lib/_vcsversion.py: Makefile vcs-version | stamp-directories
echo "VCS_VERSION = '$$VCSVER'"; \
} > $@
lib/opcodes.py: Makefile src/hs2py src/Ganeti/Constants.hs \
lib/opcodes.py: Makefile src/hs2py src/Ganeti/PyConstants.hs \
lib/opcodes.py.in_before lib/opcodes.py.in_after \
| stamp-directories
cat $(abs_top_srcdir)/lib/opcodes.py.in_before > $@
......
{-| Ganeti constants.
This module reexports the Haskell constants generated from Python.
-}
{-
Copyright (C) 2013 Google Inc.
This program 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 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
-}
module Ganeti.Constants (module Ganeti.PyConstants) where
import Ganeti.PyConstants
......@@ -2,13 +2,13 @@
These are duplicated from the Python code. Note that this file is
autogenerated using @autotools/convert_constants@ script with a header
from @Constants.hs.in@.
from @PyConstants.hs.in@.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
Copyright (C) 2013 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -27,4 +27,4 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-}
module Ganeti.Constants where
module Ganeti.PyConstants where
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment