From a68ad1b57a8be9fe117bb8dcaa6a23aba9da1af5 Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Wed, 27 May 2009 14:01:40 +0200 Subject: [PATCH] replace builtin syntax list and syntax file by buildconfig.SYNTAX table syntax compatibility is maintained in a single place in make.vars new Signed-off-by: Gordon Hecker --- Makefile | 4 +++- generic/e2lib.lua | 2 +- local/e2tool.lua | 10 +--------- make.vars | 6 ++++-- scripts/genscript.sh | 4 +--- syntax | 1 - 6 files changed, 10 insertions(+), 17 deletions(-) delete mode 100644 syntax diff --git a/Makefile b/Makefile index ca7922e..c8f851a 100644 --- 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 diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 5066034..aecc520 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -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, diff --git a/local/e2tool.lua b/local/e2tool.lua index b15284f..4935542 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -32,14 +32,6 @@ 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 diff --git a/make.vars b/make.vars index 6923aad..67359e1 100644 --- 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 diff --git a/scripts/genscript.sh b/scripts/genscript.sh index a98b651..84cb740 100755 --- a/scripts/genscript.sh +++ b/scripts/genscript.sh @@ -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 index 7855f8a..0000000 --- a/syntax +++ /dev/null @@ -1 +0,0 @@ -2_3_0 -- 2.39.5