manifest_has_changed Function

public function manifest_has_changed(cached, manifest, verbosity, iunit) result(has_changed)

Check if two dependency configurations are different

Perform all checks The cache stores the canonical directory, so compare canonical forms A different feature set (or profile) means different macros and possibly different dependencies, so it is a different build of the same revision – the git checks above cannot see that. All checks passed! The two instances are equal

Arguments

Type IntentOptional Attributes Name
class(dependency_config_t), intent(in) :: cached

Two instances of the dependency configuration

class(dependency_config_t), intent(in) :: manifest

Two instances of the dependency configuration

integer, intent(in) :: verbosity

Log verbosity

integer, intent(in) :: iunit

Log verbosity

Return Value logical


Source Code

    logical function manifest_has_changed(cached, manifest, verbosity, iunit) result(has_changed)

        !> Two instances of the dependency configuration
        class(dependency_config_t), intent(in) :: cached, manifest

        !> Log verbosity
        integer, intent(in) :: verbosity, iunit

        has_changed = .true.

        !> Perform all checks
        if (allocated(cached%git).neqv.allocated(manifest%git)) then
            if (verbosity>1) write(iunit,out_fmt) "GIT presence has changed. "
            return
        endif
        if (allocated(cached%git)) then
            if (.not.git_matches_manifest(cached%git,manifest%git,verbosity,iunit)) return
        end if

        !> The cache stores the canonical directory, so compare canonical forms
        if (allocated(manifest%path) .and. allocated(cached%path)) then
            if (canon_path(cached%path) /= canon_path(manifest%path)) then
                if (verbosity>1) write(iunit,out_fmt) "PATH has changed: "//cached%path//" vs. "//manifest%path
                return
            end if
        end if

        !> A different feature set (or profile) means different macros and
        !> possibly different dependencies, so it is a different build of the
        !> same revision -- the git checks above cannot see that.
        if (allocated(cached%features).neqv.allocated(manifest%features)) then
            if (verbosity>1) write(iunit,out_fmt) "FEATURES presence has changed. "
            return
        endif
        if (allocated(cached%features)) then
            if (.not.(cached%features==manifest%features)) then
                if (verbosity>1) write(iunit,out_fmt) "FEATURES have changed. "
                return
            end if
        end if
        if (allocated(cached%profile).neqv.allocated(manifest%profile)) then
            if (verbosity>1) write(iunit,out_fmt) "PROFILE presence has changed. "
            return
        endif
        if (allocated(cached%profile)) then
            if (.not.(cached%profile==manifest%profile)) then
                if (verbosity>1) write(iunit,out_fmt) &
                    "PROFILE has changed: "//cached%profile//" vs. "//manifest%profile
                return
            end if
        end if

        !> All checks passed! The two instances are equal
        has_changed = .false.

    end function manifest_has_changed