Skip to content

Commit

Permalink
Add support for errata keyword, tag 2.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Sep 6, 2019
1 parent e581ab8 commit b66f09d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 2.9.1
* Add support for `errata` keyword as post-release.

## 2.9.0
* Modernized CMake code, added support for CMake export mechanism, so
it's now super easy to use libversion from CMake
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)

# meta
project(libversion VERSION 2.8.2)
project(libversion VERSION 2.9.1)

set(PKGCONFIGDIR lib/pkgconfig CACHE STRING "directory where to install pkg-config files")
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly")
Expand Down
2 changes: 2 additions & 0 deletions libversion/compare.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ static version_component_t parse_alpha(const char** str, int* outflags, int flag
*outflags = ALPHAFLAG_POSTRELEASE;
else if (cur - *str == 2 && mymemcasecmp(*str, "pl", 2) == 0) /* patchlevel */
*outflags = ALPHAFLAG_POSTRELEASE;
else if (cur - *str == 6 && mymemcasecmp(*str, "errata", 2) == 0)
*outflags = ALPHAFLAG_POSTRELEASE;
else if (flags & VERSIONFLAG_P_IS_PATCH && cur - *str == 1 && (**str == 'p' || **str == 'P'))
*outflags = ALPHAFLAG_POSTRELEASE;

Expand Down
4 changes: 4 additions & 0 deletions tests/compare_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ int main() {
errors += version_test_symmetrical("1.0pl1", "1.0", 1);
errors += version_test_symmetrical("1.0pl1", "1.1", -1);

errors += version_test_symmetrical("1.0errata1", "0.9", 1);
errors += version_test_symmetrical("1.0errata1", "1.0", 1);
errors += version_test_symmetrical("1.0errata1", "1.1", -1);

fprintf(stderr, "\nTest group: p is patch flag\n");
errors += version_test_symmetrical_flags("1.0p1", "1.0p1", 0, 0, 0);
errors += version_test_symmetrical_flags("1.0p1", "1.0p1", VERSIONFLAG_P_IS_PATCH, VERSIONFLAG_P_IS_PATCH, 0);
Expand Down

0 comments on commit b66f09d

Please sign in to comment.