Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl,v diff -u -r1.109.2.9 -r1.109.2.10 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 2 Jan 2016 00:46:27 -0000 1.109.2.9 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 13 Jun 2016 17:15:04 -0000 1.109.2.10 @@ -1144,13 +1144,13 @@ package_key } { - Deinstall a package from the system. Will unmount and uninstantiate + De-install a package from the system. Will unmount and uninstantiate package instances, invoke any before-uninstall callback, source any provided sql drop scripts, remove message keys, and delete the package from the APM tables. } { - set version_id [apm_version_id_from_package_key $package_key] + set version_id [apm_version_id_from_package_key -all $package_key] # Unmount all instances of this package with the Tcl API that # invokes before-unmount callbacks Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -r1.95.2.5 -r1.95.2.6 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 2 Jan 2016 00:46:28 -0000 1.95.2.5 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 13 Jun 2016 17:15:04 -0000 1.95.2.6 @@ -1294,13 +1294,22 @@ # package_key -> version_id # -ad_proc -public apm_version_id_from_package_key { package_key } { - Return the id of the enabled version of the given package_key. +ad_proc -public apm_version_id_from_package_key { + {-all:boolean} + package_key +} { + Return the id of the (per default enabled) version of the given package_key. If no such version id can be found, returns the empty string. + @param all when specified, return the the enabled or disabled version_id of the package_key. + @param package_key @author Peter Marklund } { - return [db_string get_id {} -default ""] + if {$all_p} { + return [db_string get_id {} -default ""] + } else { + return [db_string get_enabled_id {} -default ""] + } } # Index: openacs-4/packages/acs-tcl/tcl/apm-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.xql,v diff -u -r1.28.8.2 -r1.28.8.3 --- openacs-4/packages/acs-tcl/tcl/apm-procs.xql 2 Jan 2016 01:20:51 -0000 1.28.8.2 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.xql 13 Jun 2016 17:15:04 -0000 1.28.8.3 @@ -186,14 +186,22 @@ - + select version_id from apm_enabled_package_versions where package_key = :package_key + + + select version_id + from apm_package_versions + where package_key = :package_key + + + select package_id