Skip to content

Commit 0c35749

Browse files
authored
Implement version string comparison (#186)
- allow semantic version matching
1 parent 90ddc6f commit 0c35749

File tree

4 files changed

+811
-1
lines changed

4 files changed

+811
-1
lines changed

fpm/src/fpm/manifest/package.f90

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module fpm_manifest_package
3535
use fpm_error, only : error_t, fatal_error, syntax_error
3636
use fpm_toml, only : toml_table, toml_array, toml_key, toml_stat, get_value, &
3737
& len
38+
use fpm_versioning, only : version_t, new_version
3839
implicit none
3940
private
4041

@@ -47,6 +48,9 @@ module fpm_manifest_package
4748
!> Name of the package
4849
character(len=:), allocatable :: name
4950

51+
!> Package version
52+
type(version_t) :: version
53+
5054
!> Library meta data
5155
type(library_t), allocatable :: library
5256

@@ -87,6 +91,7 @@ subroutine new_package(self, table, error)
8791

8892
type(toml_table), pointer :: child, node
8993
type(toml_array), pointer :: children
94+
character(len=:), allocatable :: version
9095
integer :: ii, nn, stat
9196

9297
call check(table, error)
@@ -98,6 +103,10 @@ subroutine new_package(self, table, error)
98103
return
99104
end if
100105

106+
call get_value(table, "version", version, "0")
107+
call new_version(self%version, version, error)
108+
if (allocated(error)) return
109+
101110
call get_value(table, "dependencies", child, requested=.false.)
102111
if (associated(child)) then
103112
call new_dependencies(self%dependency, child, error)

0 commit comments

Comments
 (0)