]> git.e2factory.org Git - e2factory.git/commitdiff
replace builtin syntax list and syntax file by buildconfig.SYNTAX table
authorGordon Hecker <gh@emlix.com>
Wed, 27 May 2009 12:01:40 +0000 (14:01 +0200)
committerGordon Hecker <gh@emlix.com>
Wed, 27 May 2009 12:01:40 +0000 (14:01 +0200)
syntax compatibility is maintained in a single place in make.vars new

Signed-off-by: Gordon Hecker <gh@emlix.com>
Makefile
generic/e2lib.lua
local/e2tool.lua
make.vars
scripts/genscript.sh
syntax [deleted file]

index ca7922e48c9a0bc0e7269b6384adcddafc524cf2..c8f851a33638e74170f1a05a169be3274118cc65 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -50,13 +50,15 @@ buildconfig.lua: Makefile make.vars
        @echo 'SYSCONFDIR="$(SYSCONFDIR)"' >>$@
        @echo 'E2="$(E2)"' >>$@
        @echo 'LUA="$(LUA)"' >>$@
-       @echo 'E2_SYNTAX="$(E2_SYNTAX)"' >>$@
        @echo 'MAJOR="$(MAJOR)"' >>$@
        @echo 'MINOR="$(MINOR)"' >>$@
        @echo 'PATCHLEVEL="$(PATCHLEVEL)"' >>$@
        @echo 'EXTRAVERSION="$(EXTRAVERSION)"' >>$@
        @echo 'VERSION="$(VERSION)"' >>$@
        @echo 'VERSIONSTRING="$(VERSIONSTRING)"' >>$@
+       @echo 'SYNTAX={' >>$@
+       @for x in $(SYNTAX) ; do echo " \"$$x\"," ; done >>$@
+       @echo '}' >>$@
 
 all: e2commit buildconfig.lua
        $(MAKE) -C lua
index 5066034abd678ff0ae498843b420298685ec497e..aecc5202feaa088898c9a4e29daced7cdb0f595a 100644 (file)
@@ -80,7 +80,7 @@ e2lib = {
   default_e2 = {
     local_branch = "master",
     local_tag = "^",
-    local_syntax = buildconfig.E2_SYNTAX,
+    local_syntax = buildconfig.SYNTAX[1],
   },
   local_e2_branch = nil,
   local_e2_tag = nil,
index b15284fdbcaa881b4d16fd0da715a3a2d177375d..49355423a4293b4f704c53472e13226baa87e816 100644 (file)
 
 e2tool = e2lib.module("e2tool")
 
--- store supported config_syntax versions here, the newest one must be listed
--- first, to maintain correct error messages
-
-local config_syntax_compat = {
-       buildconfig.E2_SYNTAX,  -- keep this one, it holds the current syntax.
-       "2_2_0",
-}
-
 -- Information gathering and inquiry
 --
 --   e2tool.collect_project_info([PATH]) -> INFO
@@ -287,7 +279,7 @@ function e2tool.collect_project_info(path)
   end
 
   -- check for configuration compatibility
-  info.config_syntax_compat = config_syntax_compat
+  info.config_syntax_compat = buildconfig.SYNTAX
   info.config_syntax_file = ".e2/syntax"
   rc, re = e2tool.check_config_syntax_compat(info)
   if not rc then
index 6923aad941a964f28738d6ea4e82f355ffff6036..67359e11c2631ed3d69337d390a3d0828aa2fe53 100644 (file)
--- a/make.vars
+++ b/make.vars
@@ -20,12 +20,14 @@ else
   VERSIONSTRING = $(COMMIT)
 endif
 
+# list the latest one first
+SYNTAX = 2_3_0 2_2_0
+
 DETECT_TOOL = $(TOPLEVEL)/scripts/detect_tool
 
 PROJECTDIR ?= $(shell cd $(TOPLEVEL);scripts/e2-locate-project-root 2>/dev/null)
-E2_SYNTAX = $(shell cat $(TOPLEVEL)/syntax)
 E2DATA = /mnt/e2data
-export E2DATA PROJECTDIR E2_SYNTAX
+export E2DATA PROJECTDIR
 
 DESTDIR =
 PREFIX = /usr/local
index a98b6515a5282341688df7e74fc6a579be8b7bb0..84cb74082462dbca25075221f3acb3acea146a9a 100755 (executable)
@@ -6,7 +6,6 @@ function die() {
 }
 
 set -e
-test -n "$E2_SYNTAX" || die "E2_SYNTAX not set"
 test -n "$PREFIX" || die "PREFIX not set"
 test -n "$BINDIR" || die "BINDIR not set"
 test -n "$LIBDIR" || die "LIBDIR not set"
@@ -24,8 +23,7 @@ test -n "$CHROOT_TOOL" || die "CHROOT_TOOL not set"
 test -n "$TAR_TOOL" || die "TAR_TOOL not set"
 test -n "$CHOWN_TOOL" || die "CHOWN_TOOL not set"
 test -n "$RM_TOOL" || die "RM_TOOL not set"
-sed -e s/"@E2_SYNTAX@"/"$E2_SYNTAX"/g \
-    -e s,"@E2_E2DATA@","$E2DATA",g \
+sed -e s,"@E2_E2DATA@","$E2DATA",g \
     -e s,"@LIBDIR@","$LIBDIR",g \
     -e s,"@LIBEXECDIR@","$LIBEXECDIR",g \
     -e s,"@BINDIR@","$BINDIR",g \
diff --git a/syntax b/syntax
deleted file mode 100644 (file)
index 7855f8a..0000000
--- a/syntax
+++ /dev/null
@@ -1 +0,0 @@
-2_3_0