From 82dc27d51925c3fe6bd3a96864b88f7c4273e958 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 12 Dec 2008 09:19:29 +0000 Subject: - fix scriptlet failing: adapt to librpm4.6, rpmtsSetRootDir(ts, "") is forbidden --- NEWS | 3 +++ URPM.xs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ce06a19..c9b5ba5 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +- fix scriptlet failing: + adapt to librpm4.6, rpmtsSetRootDir(ts, "") is forbidden + Version 3.21 - 9 December 2008, by Pascal "Pixel" Rigaux - adapt to librpm4.6 diff --git a/URPM.xs b/URPM.xs index 281c729..13fa296 100644 --- a/URPM.xs +++ b/URPM.xs @@ -2815,7 +2815,7 @@ Pkg_set_rflags(pkg, ...) MODULE = URPM PACKAGE = URPM::DB PREFIX = Db_ URPM::DB -Db_open(prefix="", write_perm=0) +Db_open(prefix=NULL, write_perm=0) char *prefix int write_perm PREINIT: @@ -2825,7 +2825,7 @@ Db_open(prefix="", write_perm=0) db = malloc(sizeof(struct s_Transaction)); db->count = 1; db->ts = rpmtsCreate(); - rpmtsSetRootDir(db->ts, prefix); + rpmtsSetRootDir(db->ts, prefix && prefix[0] ? prefix : NULL); if (rpmtsOpenDB(db->ts, write_perm ? O_RDWR | O_CREAT : O_RDONLY) == 0) { RETVAL = db; } else { -- cgit v1.2.1