Skip to content

Commit f8c7282

Browse files
committed
fix logic
1 parent a10bddb commit f8c7282

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

src/fpm/manifest/dependency.f90

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -242,38 +242,31 @@ subroutine new_dependencies(deps, table, root, meta, error)
242242
!> Parse all meta- and non-metapackage dependencies
243243
do idep = 1, size(list)
244244

245+
! Check if this is a standard dependency node
245246
call get_value(table, list(idep)%key, node, stat=stat)
246-
if (stat /= toml_stat%success) then
247-
call syntax_error(error, "Dependency "//list(idep)%key//" must be a table entry")
248-
exit
249-
end if
250-
251-
! Try to parse as a standard dependency
252-
call new_dependency(all_deps(idep), node, root, error)
253-
254-
is_standard_dependency: if (.not.allocated(error)) then
255-
256-
! If a valid git/local config is found, use it always
257-
is_meta(idep) = .false.
247+
is_standard_dependency: if (stat /= toml_stat%success) then
258248

259-
elseif (metapackages_allowed .and. is_meta_package(list(idep)%key)) then
260-
261-
!> Metapackage name: Check if this is a valid metapackage request
249+
! See if it can be a valid metapackage name
262250
call new_meta_request(meta_request, list(idep)%key, table, error=error)
263251

264252
!> Neither a standard dep nor a metapackage
265-
if (allocated(error)) return
253+
if (allocated(error)) then
254+
call syntax_error(error, "Dependency "//list(idep)%key//" is not a valid metapackage or a table entry")
255+
return
256+
endif
266257

267258
!> Valid meta dependency
268259
is_meta(idep) = .true.
269260

270261
else
271262

272-
!> Not a standard dependency and not a metapackage: dump an error
273-
call syntax_error(error, "Dependency "//list(idep)%key//" cannot be parsed. Check input format")
274-
return
263+
! Parse as a standard dependency
264+
is_meta(idep) = .false.
265+
266+
call new_dependency(all_deps(idep), node, root, error)
267+
if (allocated(error)) return
275268

276-
endif is_standard_dependency
269+
end if is_standard_dependency
277270

278271
end do
279272

src/fpm/manifest/meta.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ subroutine new_meta_request(self, key, table, meta_allowed, error)
147147
do i=1,size(keys)
148148

149149
! Skip standard dependencies
150-
if (.not.meta_allowed(i)) cycle
150+
if (.not.allow_meta(i)) cycle
151151

152152
if (keys(i)%key==key) then
153153
call get_value(table, key, value)

0 commit comments

Comments
 (0)