apm_get_package_files (public)

 apm_get_package_files [ -include_data_model_files ] [ -all ] \
    [ -all_db_types ] -package_key package_key \
    [ -package_path package_path ] [ -file_types file_types ]

Defined in packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl

Returns all files, or files of a certain types, belonging to an APM package. Ignores files based on proc apm_include_file_p and determines file type of files with proc apm_guess_file_type. Only returns file with no db type or a db type matching that of the system, unless '-all' is specified.

Goes directly to the filesystem to find files instead of using a file listing in the package info file or the database.

Switches:
-include_data_model_files (optional, boolean)
-all (optional, boolean)
When specified, return all files in the package, regardless of their file or database type.
-all_db_types (optional, boolean)
-package_key (required)
The key of the package to return file paths for
-package_path (optional)
The full path of the root directory of the package. Defaults to acs_package_root_dir.
-file_types (optional)
The type of files to return. If not provided files of all types recognized by the APM are returned.
Returns:
The paths, relative to the root dir of the package, of matching files.
Author:
Peter Marklund
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm_tarballs apm_tarballs (test acs-tcl) apm_get_package_files apm_get_package_files test_apm_tarballs->apm_get_package_files test_files__check_upgrade_ordering files__check_upgrade_ordering (test acs-tcl) test_files__check_upgrade_ordering->apm_get_package_files test_files__check_xql_files files__check_xql_files (test acs-tcl) test_files__check_xql_files->apm_get_package_files test_files__page_contracts files__page_contracts (test acs-tcl) test_files__page_contracts->apm_get_package_files test_files__tcl_file_syntax_errors files__tcl_file_syntax_errors (test acs-tcl) test_files__tcl_file_syntax_errors->apm_get_package_files acs_package_root_dir acs_package_root_dir (public) apm_get_package_files->acs_package_root_dir ad_find_all_files ad_find_all_files (public) apm_get_package_files->ad_find_all_files apm_guess_db_type apm_guess_db_type (public) apm_get_package_files->apm_guess_db_type apm_guess_file_type apm_guess_file_type (public) apm_get_package_files->apm_guess_file_type api_add_calling_info_to_procdoc api_add_calling_info_to_procdoc (private) api_add_calling_info_to_procdoc->apm_get_package_files apm::metrics_internal apm::metrics_internal (private) apm::metrics_internal->apm_get_package_files apm_bootstrap_load_libraries apm_bootstrap_load_libraries (private) apm_bootstrap_load_libraries->apm_get_package_files apm_build_repository apm_build_repository (private) apm_build_repository->apm_get_package_files apm_data_model_scripts_find apm_data_model_scripts_find (public) apm_data_model_scripts_find->apm_get_package_files

Testcases:
get_package_files, apm_tarballs, files__tcl_file_syntax_errors, files__check_upgrade_ordering, files__check_xql_files, files__trailing_whitespace, files__page_contracts
Source code:
    if { $package_path eq "" } {
        set package_path [acs_package_root_dir $package_key]
    }

    if {$all_p} {
        set file_function ""
    } else {
        set file_function [expr {$include_data_model_files_p
                                 ? "apm_include_data_model_file_p"
                                 : "apm_include_file_p"}]
    }
    set files [lsort [ad_find_all_files -check_file_func $file_function $package_path]]
    # We don't assume db_type proc is defined yet
    set system_db_type [nsv_get ad_database_type .]

    set matching_files [list]
    foreach file $files {
        set rel_path [string range $file [string length $package_path]+1 end]
        set file_type [apm_guess_file_type $package_key $rel_path]
        set file_db_type [apm_guess_db_type $package_key $rel_path]

        set type_match_p [expr {$file_types eq "" || $file_type in $file_types}]

        if { $all_p || $all_db_types_p } {
            set db_match_p 1
        } else {
            set db_match_p [expr {$file_db_type eq "" || $file_db_type eq $system_db_type}]
        }

        if { $type_match_p && $db_match_p } {
            lappend matching_files $rel_path
        }
    }

    return $matching_files
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: