apm_package_deinstall (public)

 apm_package_deinstall [ -callback callback ] package_key

Defined in packages/acs-tcl/tcl/apm-install-procs.tcl

Deinstalls a package from the filesystem.

Switches:
-callback (optional, defaults to "apm_dummy_callback")
Parameters:
package_key (required)
The package to be deinstaleled.

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-admin/www/apm/package-deinstall.tcl packages/acs-admin/ www/apm/package-deinstall.tcl apm_package_deinstall apm_package_deinstall packages/acs-admin/www/apm/package-deinstall.tcl->apm_package_deinstall ad_conn ad_conn (public) apm_package_deinstall->ad_conn apm_callback_and_log apm_callback_and_log (public) apm_package_deinstall->apm_callback_and_log apm_package_registered_p apm_package_registered_p (public) apm_package_deinstall->apm_package_registered_p apm_workspace_dir apm_workspace_dir (public) apm_package_deinstall->apm_workspace_dir db_dml db_dml (public) apm_package_deinstall->db_dml

Testcases:
No testcase defined.
Source code:
    if {![apm_package_registered_p $package_key]} {
        apm_callback_and_log $callback "This package is not installed.  Done."
        return 0
    }

    # Obtain the portion of the email address before the at sign. We'll use this in the name of
    # the backup directory for the package.
    regsub {@.+} [party::email -party_id [ad_conn user_id]] "" my_email_name

    set backup_dir "[apm_workspace_dir]/$package_key-removed-$my_email_name-[ns_fmttime [ns_time] {%Y%m%d-%H:%M:%S}]"

    apm_callback_and_log $callback "
    <li>Moving <tt>packages/$package_key</tt> to $backup_dir... "

    if { [catch { file rename -- "$::acs::rootdir/packages/$package_key" $backup_dir } error] } {
        apm_callback_and_log $callback "<font color=red>[ns_quotehtml $error]</font>"
    } else {
        apm_callback_and_log $callback "moved."
    }

    db_dml apm_uninstall_record {
        update apm_package_versions
        set    installed_p = 'f', enabled_p = 'f'
        where package_key = :package_key
    }

    apm_callback_and_log $callback "<li>Package marked as deinstalled.
    "
    return 1
Generic XQL file:
<fullquery name="apm_package_deinstall.apm_uninstall_record">
    <querytext>
      
	update apm_package_versions
	set    installed_p = 'f', enabled_p = 'f'
	where package_key = :package_key
    
      </querytext>
</fullquery>
packages/acs-tcl/tcl/apm-install-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/apm-install-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/apm-install-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: