apm_version_load_status (public)

 apm_version_load_status version_id

Defined in packages/acs-tcl/tcl/apm-procs.tcl

If a version needs to be reloaded (i.e., a -procs.tcl has changed or been added since the version was loaded), returns "needs_reload". If the version has never been loaded, returns "never_loaded". If the version is up-to-date, returns "up_to_date".

Parameters:
version_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-admin/www/apm/index.tcl packages/acs-admin/ www/apm/index.tcl apm_version_load_status apm_version_load_status packages/acs-admin/www/apm/index.tcl->apm_version_load_status acs_package_root_dir acs_package_root_dir (public) apm_version_load_status->acs_package_root_dir ad_file ad_file (public) apm_version_load_status->ad_file apm_get_package_files apm_get_package_files (public) apm_version_load_status->apm_get_package_files apm_load_tests_p apm_load_tests_p (public) apm_version_load_status->apm_load_tests_p apm_package_key_from_version_id apm_package_key_from_version_id (public) apm_version_load_status->apm_package_key_from_version_id

Testcases:
No testcase defined.
Source code:
    # See if the version was ever loaded.
    if { ![apm_package_version_enabled_p $version_id] } {
        return "never_loaded"
    }

    set package_key [apm_package_key_from_version_id $version_id]
    set procs_types [list tcl_procs]
    if { [apm_load_tests_p] } {
        lappend procs_types test_procs
    }
    foreach file [apm_get_package_files -package_key $package_key -file_types $procs_types] {
        # If $file has never been loaded, i.e., it has been added to the version
        # since the version was initially loaded, return needs_reload.
        if { ![nsv_exists apm_library_mtime "packages/$package_key/$file"] } {
            return "needs_reload"
        }

        set full_path "[acs_package_root_dir $package_key]/$file"
        # If $file had a different mtime when it was last loaded, return
        # needs_reload. (If the file should exist but doesn't, just skip it.)
        if { [ad_file exists $full_path]
             &&  [ad_file mtime $full_path] ne [nsv_get apm_library_mtime "packages/$package_key/$file"]
         } {
            return "needs_reload"
        }
    }

    foreach file [apm_get_package_files -package_key $package_key -file_types "query_file"] {
        # If $file has never been loaded, i.e., it has been added to the version
        # since the version was initially loaded, return needs_reload.
        if { ![nsv_exists apm_library_mtime "packages/$package_key/$file"] } {
            return "needs_reload"
        }

        set full_path "[acs_package_root_dir $package_key]/$file"
        # If $file had a different mtime when it was last loaded, return
        # needs_reload. (If the file should exist but doesn't, just skip it.)
        if { [ad_file exists $full_path]
             && [ad_file mtime $full_path] ne [nsv_get apm_library_mtime "packages/$package_key/$file"]
         } {
            return "needs_reload"
        }
    }

    return "up_to_date"
Generic XQL file:
packages/acs-tcl/tcl/apm-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/apm-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/apm-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: