From 27be34c09bfe14ab0b4b2c96092ae0b60ca16555 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Tue, 7 Mar 2006 18:17:03 +0000 Subject: added a NOSCRIPLET flag to transactions (patch from VMiklos ) --- lib/libalpm/add.c | 6 +++--- lib/libalpm/alpm.h | 2 +- lib/libalpm/remove.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 2cd88bc6..80117731 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -319,7 +319,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) } /* pre_upgrade scriptlet */ - if(info->scriptlet) { + if(info->scriptlet && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) { _alpm_runscriptlet(handle->root, info->data, "pre_upgrade", info->version, oldpkg ? oldpkg->version : NULL); } @@ -359,7 +359,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) _alpm_log(PM_LOG_FLOW1, "adding package %s-%s", info->name, info->version); /* pre_install scriptlet */ - if(info->scriptlet) { + if(info->scriptlet && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) { _alpm_runscriptlet(handle->root, info->data, "pre_install", info->version, NULL); } } else { @@ -668,7 +668,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) } /* run the post-install script if it exists */ - if(info->scriptlet) { + if(info->scriptlet && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) { snprintf(pm_install, PATH_MAX, "%s%s/%s/%s-%s/install", handle->root, handle->dbpath, db->treename, info->name, info->version); if(pmo_upgrade) { _alpm_runscriptlet(handle->root, pm_install, "post_upgrade", info->version, oldpkg ? oldpkg->version : NULL); diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 18a1712b..134d40b7 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -218,7 +218,7 @@ enum { #define PM_TRANS_FLAG_NODEPS 0x040 #define PM_TRANS_FLAG_ALLDEPS 0x080 #define PM_TRANS_FLAG_NOCONFLICTS 0x100 -#define PM_TRANS_FLAG_NOSCRIPLET 0x200 +#define PM_TRANS_FLAG_NOSCRIPTLET 0x200 /* Transaction Events */ enum { diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index fd040e38..f8afa3a1 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -153,7 +153,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db) _alpm_log(PM_LOG_FLOW1, "removing package %s-%s", info->name, info->version); /* run the pre-remove scriptlet if it exists */ - if(info->scriptlet) { + if(info->scriptlet && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) { snprintf(pm_install, PATH_MAX, "%s/%s-%s/install", db->path, info->name, info->version); _alpm_runscriptlet(handle->root, pm_install, "pre_remove", info->version, NULL); } @@ -235,7 +235,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db) if(trans->type != PM_TRANS_TYPE_UPGRADE) { /* run the post-remove script if it exists */ - if(info->scriptlet) { + if(info->scriptlet && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) { char pm_install[PATH_MAX]; snprintf(pm_install, PATH_MAX, "%s/%s-%s/install", db->path, info->name, info->version); _alpm_runscriptlet(handle->root, pm_install, "post_remove", info->version, NULL); -- cgit v1.2.3-70-g09d2