* $Id$
*
* Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2011, MinGW Project
+ * Copyright (C) 2011, 2012, MinGW Project
*
*
* Implementation of the primary package removal methods.
* package which has been identified as "installed"...
*/
const char *tarname = ref->GetPropVal( tarname_key, value_unknown );
- DEBUG_INVOKE_IF( DEBUGLEVEL & DEBUG_TRACE_INIT,
+ DEBUG_INVOKE_IF( DEBUG_REQUEST( DEBUG_TRACE_INIT ),
dmh_printf( "%s: selected for %s\n",
(tarname = ref->GetPropVal( tarname_key, value_unknown )),
(current->flags & ACTION_INSTALL) ? "upgrade" : "removal"
{
/* ...and then, having confirmed its validity...
*/
- DEBUG_INVOKE_IF( DEBUGLEVEL & DEBUG_TRACE_INIT,
+ DEBUG_INVOKE_IF( DEBUG_REQUEST( DEBUG_TRACE_INIT ),
dmh_printf( "%s: marked for %s\n",
ref->GetPropVal( tarname_key, value_unknown ),
(current->flags & ACTION_INSTALL) ? "upgrade" : "removal"
char fullpath[ mkpath( NULL, sysroot, pathname, NULL ) ];
mkpath( fullpath, sysroot, pathname, NULL );
- DEBUG_INVOKE_IF( DEBUGLEVEL & DEBUG_TRACE_TRANSACTIONS,
+ DEBUG_INVOKE_IF( DEBUG_REQUEST( DEBUG_TRACE_TRANSACTIONS ),
dmh_printf( " %s: rmdir\n", fullpath )
);
char filepath[ mkpath( NULL, sysroot, pathname, NULL ) ];
mkpath( filepath, sysroot, pathname, NULL );
- DEBUG_INVOKE_IF( DEBUGLEVEL & DEBUG_TRACE_TRANSACTIONS,
+ DEBUG_INVOKE_IF( DEBUG_REQUEST( DEBUG_TRACE_TRANSACTIONS ),
dmh_printf( " %s: unlink file\n", filepath )
);
const char *tarname = pkg->GetPropVal( tarname_key, value_unknown );
pkgXmlNode *sysroot = sysroot_lookup( pkg, tarname );
+ /* If the package we are about to remove has an associated
+ * pre-remove script, now is the time to invoke it...
+ */
+ pkg->InvokeScript( "pre-remove" );
+
+ /* ...before we proceed to removal of actual package content.
+ */
dmh_printf( " removing %s %s\n", pkg->GetName(), tarname );
/* Removal of virtual (meta) packages is comparitively simple;
sysroot->SetAttribute( modified_key, value_yes );
}
}
+ /* After package removal has been completed, we invoke any
+ * post-remove script which may be associated with the package.
+ */
+ pkg->InvokeScript( "post-remove" );
}
else if( (pkg != NULL) && current->HasAttribute( ACTION_DOWNLOAD ) )
{