apm_package_install_spec (public)
apm_package_install_spec version_id
Defined in packages/acs-tcl/tcl/apm-install-procs.tcl
Writes the XML-formatted specification for a package to disk, marking it in the database as the only installed version of the package. Creates the package directory if it doesn't already exist. Overwrites any existing specification file; or if none exists yet, creates $package_key/$package_key.info and adds this new file to apm_version_files in the database. Adds minimal directories.
- Parameters:
- version_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set spec [apm_generate_package_spec $version_id] apm_version_info $version_id db_1row package_version_info_select { select package_key, version_id from apm_package_version_info where version_id = :version_id } ns_log Debug "apm_package_install_spec: Checking existence of package directory." set root [acs_package_root_dir $package_key] if { ![ad_file exists $root] } { file mkdir $root # doesn't work under windows. its not very useful anyway. # file attributes $root -permissions [parameter::get -parameter InfoFilePermissionsMode -default 0755] } db_transaction { ns_log Debug "apm_package_install_spec: Determining path of .info file." set path "[acs_package_root_dir $package_key]/$package_key.info" ns_log Debug "apm_package_install_spec: Writing APM .info file to the database." db_dml apm_spec_file_register {} ns_log Debug "apm_package_install_spec: Writing .info file." set file [open $path "w"] puts -nonewline $file $spec close $file # create minimal directories foreach dir {www www/doc tcl tcl/test sql sql/postgresql sql/oracle} { set path "[acs_package_root_dir $package_key]/$dir" if { ![ad_file exists $path] } { file mkdir $path } } # Mark $version_id as the only installed version of the package. db_dml version_mark_installed {} } ns_log Debug "apm_package_install_spec: Done updating .info file."Generic XQL file: <fullquery name="apm_package_install_spec.package_version_info_select"> <querytext> select package_key, version_id from apm_package_version_info where version_id = :version_id </querytext> </fullquery> <fullquery name="apm_package_install_spec.apm_spec_file_register"> <querytext> update apm_package_types set spec_file_path = :path where package_key = :package_key </querytext> </fullquery>packages/acs-tcl/tcl/apm-install-procs.xql
PostgreSQL XQL file: <fullquery name="apm_package_install_spec.version_mark_installed"> <querytext> update apm_package_versions set installed_p = (version_id = :version_id) where package_key = :package_key </querytext> </fullquery>packages/acs-tcl/tcl/apm-install-procs-postgresql.xql
Oracle XQL file: <fullquery name="apm_package_install_spec.version_mark_installed"> <querytext> update apm_package_versions set installed_p = decode(version_id, :version_id, 't', 'f') where package_key = :package_key </querytext> </fullquery>packages/acs-tcl/tcl/apm-install-procs-oracle.xql