util::resources::is_installed_locally (public)

 util::resources::is_installed_locally -resource_info resource_info \
    [ -version_segment version_segment ]

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

Check, if the required resource files are installed locally. When there should not be a version_segment segment used, provide an empty one via resource_info.

Switches:
-resource_info (required)
a dict containing resourceDir, cssFiles, jsFiles, and extraFiles
-version_segment (optional)
an optional directory, under the resource directory
Author:
Gustaf Neumann

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-admin/www/posture-overview.tcl packages/acs-admin/ www/posture-overview.tcl util::resources::is_installed_locally util::resources::is_installed_locally packages/acs-admin/www/posture-overview.tcl->util::resources::is_installed_locally packages/acs-tcl/lib/check-installed.tcl packages/acs-tcl/ lib/check-installed.tcl packages/acs-tcl/lib/check-installed.tcl->util::resources::is_installed_locally ad_file ad_file (public) util::resources::is_installed_locally->ad_file util::resources::version_segment util::resources::version_segment (public) util::resources::is_installed_locally->util::resources::version_segment

Testcases:
No testcase defined.
Source code:
        if {$version_segment eq ""} {
            set version_segment [::util::resources::version_segment -resource_info $resource_info]
        }

        set installed 1
        set resource_dir [dict get $resource_info resourceDir]
        #ns_log notice "check downloadURLs <[dict exists $resource_info downloadURLs]> // [lsort [dict keys $resource_info]]"

        set downloadFiles {}
        if {[dict exists $resource_info downloadURLs]} {
           # ns_log notice "we have downloadURLs <[dict get $resource_info downloadURLs]>"
            foreach url [dict get $resource_info downloadURLs] {
                lappend downloadFiles [ad_file tail $url]
            }
        }
        set files [concat  [dict get $resource_info cssFiles]  [dict get $resource_info jsFiles]  [dict get $resource_info extraFiles]  $downloadFiles  ]
        #ns_log notice "check files <$files>"

        foreach file $files {
            if {$version_segment eq ""} {
                set path $resource_dir/$file
            } else {
                set path $resource_dir/$version_segment/$file
            }
            #ns_log notice "... check $path -> [ad_file readable $path]"
            if {![ad_file readable $path]} {
                ns_log notice "... check $path -> [ad_file readable $path]"
                set installed 0
                break
            }
        }
        return $installed
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

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