From 3ad6393baf3a7c2d8182d871551ba8a24e950a4d Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Wed, 20 Apr 2005 19:39:41 +0000 Subject: bypass trans_prepare() if there is no target --- lib/libalpm/trans.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/libalpm') diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index c0eeb421..0a68a2bc 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -145,6 +145,11 @@ int trans_prepare(pmtrans_t *trans, PMList **data) /* Sanity checks */ ASSERT(trans != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); + /* If there's nothing to do, return without complaining */ + if(trans->packages == NULL) { + return(0); + } + switch(trans->type) { case PM_TRANS_TYPE_ADD: case PM_TRANS_TYPE_UPGRADE: -- cgit v1.2.3-70-g09d2