@@ -159,9 +159,11 @@ module fpm_dependency
159
159
! > Write dependency tree to TOML data structure
160
160
procedure , private :: dump_to_toml
161
161
! > Update dependency tree
162
- generic :: update = > update_dependency
162
+ generic :: update = > update_dependency,update_tree
163
163
! > Update a list of dependencies
164
164
procedure , private :: update_dependency
165
+ ! > Update all dependencies in the tree
166
+ procedure , private :: update_tree
165
167
end type dependency_tree_t
166
168
167
169
! > Common output format for writing to the command line
@@ -382,7 +384,7 @@ subroutine add_dependency(self, dependency, error)
382
384
383
385
! > Ensure an update is requested whenever the dependency has changed
384
386
if (needs_update) then
385
- write (self% unit, out_fmt) " Update needed :" , dependency% name
387
+ write (self% unit, out_fmt) " Dependency change detected :" , dependency% name
386
388
call new_dependency_node(self% dep(id), dependency, update= .true. )
387
389
endif
388
390
@@ -442,6 +444,23 @@ subroutine update_dependency(self, name, error)
442
444
443
445
end subroutine update_dependency
444
446
447
+ ! > Update whole dependency tree
448
+ subroutine update_tree (self , error )
449
+ ! > Instance of the dependency tree
450
+ class(dependency_tree_t), intent (inout ) :: self
451
+ ! > Error handling
452
+ type (error_t), allocatable , intent (out ) :: error
453
+
454
+ integer :: i
455
+
456
+ ! Update dependencies where needed
457
+ do i = 1 , self% ndep
458
+ call self% update(self% dep(i)% name,error)
459
+ if (allocated (error)) return
460
+ end do
461
+
462
+ end subroutine update_tree
463
+
445
464
! > Resolve all dependencies in the tree
446
465
subroutine resolve_dependencies (self , root , error )
447
466
! > Instance of the dependency tree
0 commit comments