Index: openacs-4/packages/acs-kernel/sql/oracle/apm-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/apm-create.sql,v diff -u -r1.52 -r1.53 --- openacs-4/packages/acs-kernel/sql/oracle/apm-create.sql 31 Mar 2010 00:46:16 -0000 1.52 +++ openacs-4/packages/acs-kernel/sql/oracle/apm-create.sql 31 Mar 2010 01:21:00 -0000 1.53 @@ -1098,6 +1098,11 @@ package_id in apm_packages.package_id%TYPE ) return apm_packages.package_id%TYPE; + function is_child ( + parent_package_key in apm_packages.package_key%TYPE, + child_package_key in apm_packages.package_key%TYPE + ) return char; + end apm_package; / show errors @@ -2055,6 +2060,35 @@ return -1; end parent_id; + function is_child ( + parent_package_key in apm_packages.package_key%TYPE, + child_package_key in apm_packages.package_key%TYPE + ) return char + is + begin + + if parent_package_key = child_package_key then + return 't'; + end if; + + for row in + (select apd.service_uri + from apm_package_versions apv, apm_package_dependencies apd + where apd.version_id = apv.version_id + and apv.enabled_p = 't' + and apd.dependency_type in ('embeds', 'extends') + and apv.package_key = child_package_key) + loop + if row.service_uri = parent_package_key or + is_child(parent_package_key, row.service_uri) = 't' then + return 't'; + end if; + end loop; + + return 'f'; + end is_child; + + end apm_package; / show errors Index: openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.6.0d7-5.6.0d8.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.6.0d7-5.6.0d8.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.6.0d7-5.6.0d8.sql 31 Mar 2010 00:46:16 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.6.0d7-5.6.0d8.sql 31 Mar 2010 01:21:00 -0000 1.2 @@ -243,6 +243,35 @@ return -1; end parent_id; + function is_child ( + parent_package_key in apm_packages.package_key%TYPE, + child_package_key in apm_packages.package_key%TYPE + ) return char + is + begin + + if parent_package_key = child_package_key then + return 't'; + end if; + + for row in + (select apd.service_uri + from apm_package_versions apv, apm_package_dependencies apd + where apd.version_id = apv.version_id + and apv.enabled_p = 't' + and apd.dependency_type in ('embeds', 'extends') + and apv.package_key = child_package_key) + loop + if row.service_uri = parent_package_key or + is_child(parent_package_key, row.service_uri) = 't' then + return 't'; + end if; + end loop; + + return 'f'; + end is_child; + + end apm_package; / show errors Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs-oracle.xql,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs-oracle.xql 31 Mar 2010 00:46:16 -0000 1.18 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs-oracle.xql 31 Mar 2010 01:21:00 -0000 1.19 @@ -290,7 +290,7 @@ begin :1 := apm.parameter_p( - package_key => :descendent_package_key, + package_key => :new_package_key, parameter_name => :parameter_name); end;