diff --git a/.github/workflows/release-assets.yml b/.github/workflows/release-assets.yml index 89e2883b..2402d318 100644 --- a/.github/workflows/release-assets.yml +++ b/.github/workflows/release-assets.yml @@ -24,8 +24,8 @@ jobs: run: | echo "::set-output name=tarball::$(ls *.tar.gz)" echo "::set-output name=zip::$(ls *.zip)" - echo "::set-output name=suffix_unix::$(sed 's|^\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\)\.\(.*\)$|\1|' dist/VERSION)" - echo "::set-output name=suffix_dos::$(sed 's|^\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\)\.\(.*\)$|\1|' dist/VERSION | tr . _)" + echo "::set-output name=suffix_unix::$(sed 's|^\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\)\.\(.*\)$|\1|' dist/VERSION.txt)" + echo "::set-output name=suffix_dos::$(sed 's|^\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\)\.\(.*\)$|\1|' dist/VERSION.txt | tr . _)" - name: Create Release id: create_release uses: actions/create-release@v1 diff --git a/CMakeLists.txt b/CMakeLists.txt index a36c0ba8..0aad9f88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git" AND message(SEND_ERROR "Git command-line tool not found") endif() set(MDBX_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") -elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" AND +elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.c" AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.c++" AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" AND diff --git a/ChangeLog.md b/ChangeLog.md index 76a14165..89484d1b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -28,6 +28,10 @@ New features: - [Allow to predefine/override `MDBX_BUILD_TIMESTAMP` for builds reproducibility](https://github.com/erthink/libmdbx/issues/201). +Backward compatibility break: + + - Use file `VERSION.txt` for version information instead of `VERSION` to avoid collision with `#include `. + Fixes: - Fixed excess meta-pages checks in case `mdbx_chk` is called to check the DB for a specific meta page and thus could prevent switching to the selected meta page, even if the check passed without errors. diff --git a/GNUmakefile b/GNUmakefile index ca4ec5f1..573a0ebd 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -250,7 +250,7 @@ define uname2titer esac endef -DIST_EXTRA := LICENSE README.md CMakeLists.txt GNUmakefile Makefile ChangeLog.md VERSION config.h.in ntdll.def \ +DIST_EXTRA := LICENSE README.md CMakeLists.txt GNUmakefile Makefile ChangeLog.md VERSION.txt config.h.in ntdll.def \ $(addprefix man1/, $(MANPAGES)) cmake/compiler.cmake cmake/profile.cmake cmake/utils.cmake DIST_SRC := mdbx.h mdbx.h++ mdbx.c mdbx.c++ $(addsuffix .c, $(TOOLS)) @@ -532,9 +532,9 @@ dist/$(1): $(1) $(QUIET)mkdir -p $$(dir $$@) && sed -e '/^#> dist-cutoff-begin/,/^#< dist-cutoff-end/d' $$< > $$@ endef -$(foreach file,$(filter-out man1/% VERSION %.in ntdll.def,$(DIST_EXTRA)),$(eval $(call dist-extra-rule,$(file)))) +$(foreach file,$(filter-out man1/% VERSION.txt %.in ntdll.def,$(DIST_EXTRA)),$(eval $(call dist-extra-rule,$(file)))) -dist/VERSION: src/version.c +dist/VERSION.txt: src/version.c @echo ' MAKE $@' $(QUIET)mkdir -p dist/ && echo "$(MDBX_GIT_VERSION).$(MDBX_GIT_REVISION)" > $@ diff --git a/cmake/utils.cmake b/cmake/utils.cmake index daf4b39d..fcfcb5b6 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -173,7 +173,10 @@ macro(fetch_version name source_root_directory parent_scope) set(${name}_GIT_REVISION 0) # Try to get version from VERSION file - set(version_file "${source_root_directory}/VERSION") + set(version_file "${source_root_directory}/VERSION.txt") + if(NOT EXISTS "${version_file}") + set(version_file "${source_root_directory}/VERSION") + endif() if(EXISTS "${version_file}") file(STRINGS "${version_file}" ${name}_VERSION LIMIT_COUNT 1 LIMIT_INPUT 42) endif()