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):
- 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_filesXQL Not present: Generic, PostgreSQL, Oracle