util::resources::can_install_locally (public)

 util::resources::can_install_locally -resource_info resource_info \
    [ -version_dir version_dir ]

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

Check, whether the operating system's permissions allow us to install in the configured directories.

Switches:
-resource_info
(required)
a dict containing at least resourceDir
-version_dir
(optional)
an optional directory, under the resource directory
Author:
Gustaf Neumann

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-tcl/lib/check-installed.tcl packages/acs-tcl/ lib/check-installed.tcl util::resources::can_install_locally util::resources::can_install_locally packages/acs-tcl/lib/check-installed.tcl->util::resources::can_install_locally util::resources::download util::resources::download (public) util::resources::download->util::resources::can_install_locally ad_file ad_file (public) util::resources::can_install_locally->ad_file util::resources::version_dir util::resources::version_dir (public) util::resources::can_install_locally->util::resources::version_dir

Testcases:
No testcase defined.
Source code:
        set can_install 1
        set version_dir [version_dir  -version_dir $version_dir  -resource_info $resource_info]

        set resource_dir [dict get $resource_info resourceDir]

        if {![ad_file isdirectory $resource_dir]} {
            try {
                file mkdir $resource_dir
            } on error {errorMsg} {
                set can_install 0
            }
        }
        if {$can_install && $version_dir ne ""} {
            set path $resource_dir/$version_dir
            if {![ad_file isdirectory $path]} {
                try {
                    file mkdir $path
                    #
                    # We check on the version-dir, if the package is
                    # installed, therefore, don't create an empty one.
                    #
                    file delete $path
                } on error {errorMsg} {
                    set can_install 0
                }
            } else {
                set can_install [ad_file writable $path]
            }
        }
        return $can_install
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

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