apm_scan_packages (public)

 apm_scan_packages [ -callback callback ] [ -new ] [ path ]

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

Scans a directory for unregistered package specification files.

Switches:
-callback (optional, defaults to "apm_dummy_callback")
-new (optional, boolean)
Parameters:
path (optional)
Returns:
A list of unregistered .info files that can be parsed for further information.

Partial Call Graph (max 5 caller/called nodes):
%3 ad_core_docs_uninstalled_packages_internal ad_core_docs_uninstalled_packages_internal (private) apm_scan_packages apm_scan_packages ad_core_docs_uninstalled_packages_internal->apm_scan_packages apm_build_repository apm_build_repository (private) apm_build_repository->apm_scan_packages apm_get_package_repository apm_get_package_repository (public) apm_get_package_repository->apm_scan_packages packages/acs-admin/www/apm/packages-install.tcl packages/acs-admin/ www/apm/packages-install.tcl packages/acs-admin/www/apm/packages-install.tcl->apm_scan_packages packages/acs-tcl/lib/build-repository.tcl packages/acs-tcl/ lib/build-repository.tcl packages/acs-tcl/lib/build-repository.tcl->apm_scan_packages ad_file ad_file (public) apm_scan_packages->ad_file apm_callback_and_log apm_callback_and_log (public) apm_scan_packages->apm_callback_and_log apm_ignore_file_p apm_ignore_file_p (public) apm_scan_packages->apm_ignore_file_p apm_package_info_file_path apm_package_info_file_path (public) apm_scan_packages->apm_package_info_file_path apm_package_installed_p apm_package_installed_p (public) apm_scan_packages->apm_package_installed_p

Testcases:
No testcase defined.
Source code:

    if { $path eq "" } {
        set path [apm_workspace_install_dir]
    }

    ### Scan for all unregistered .info files.

    ns_log Notice "apm_scan_packages: Scanning for new unregistered packages..."
    set new_spec_files [list]
    # Loop through all directories in the /packages directory, searching each for a
    # .info file.
    foreach dir [lsort [glob -nocomplain "$path/*"]] {
        set package_key [ad_file tail $dir]
        if { ![ad_file isdirectory $dir] } {
            continue
        }
        if { [apm_ignore_file_p $dir] } {
            apm_callback_and_log $callback "Skipping the directory \"$package_key\"."
            continue
        }

        # At this point, we should have a directory that is equivalent to a package_key.
        if { [apm_package_installed_p $package_key] } {
            if {$new_p} {
                continue
            }
        }

        # Locate the .info file for this package.
        if { [catch { set info_file [apm_package_info_file_path -path $path $package_key] } error] } {
            apm_callback_and_log -severity Warning $callback "Unable to locate specification file for package $package_key: $error"
            continue
        }
        # We found the .info file.
        lappend new_spec_files $info_file
    }

    if { [llength $new_spec_files] == 0 } {
        ns_log Notice "apm_scan_packages: No new packages found in $path"
    }
    return $new_spec_files
Generic XQL file:
packages/acs-tcl/tcl/apm-install-procs.xql

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

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

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