[pacman-dev] [PATCH] really run scriptlet on pre_remove and post_remove

Roman Kyrylych roman.kyrylych at gmail.com
Thu Apr 5 12:11:45 EDT 2007


This fixes bug #6819.

diff -urpN pacman-lib.orig/lib/libalpm/remove.c pacman-lib/lib/libalpm/remove.c
--- pacman-lib.orig/lib/libalpm/remove.c	2007-03-22 10:22:48.000000000 +0200
+++ pacman-lib/lib/libalpm/remove.c	2007-04-05 19:00:54.000000000 +0300
@@ -284,10 +284,10 @@ int _alpm_remove_commit(pmtrans_t *trans
 			break;
 		}

-		snprintf(scriptlet, PATH_MAX, "%s%s-%s/install", db->path,
-						 pkgname, alpm_pkg_get_version(info));
 		/* get the name now so we can use it after package is removed */
 		pkgname = alpm_pkg_get_name(info);
+		snprintf(scriptlet, PATH_MAX, "%s%s-%s/install", db->path,
+						 pkgname, alpm_pkg_get_version(info));

 		if(trans->type != PM_TRANS_TYPE_UPGRADE) {
 			EVENT(trans, PM_TRANS_EVT_REMOVE_START, info, NULL);


Additional comments:
while digging in libalpm's add.c and remove.c I've found many inconsistencies,
I'll try to provide a patch when I'll get more time.

-- 
Roman Kyrylych (Роман Кирилич)


More information about the pacman-dev mailing list