From 9f95d9dd8c5ad80e5c8d9a0d146b89a1b105d35c Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 11 Aug 2009 19:11:14 +0200 Subject: [PATCH] xbps-bin: fix installation of new packages with autoupdate. --HG-- extra : convert_revision : 3195174fd64a10bb4fad3fc888a3693796bfb212 --- bin/xbps-bin/install.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/xbps-bin/install.c b/bin/xbps-bin/install.c index 2687e205390..a8c6e7add34 100644 --- a/bin/xbps-bin/install.c +++ b/bin/xbps-bin/install.c @@ -44,7 +44,6 @@ struct transaction { prop_dictionary_t dict; prop_object_iterator_t iter; const char *originpkgname; - const char *curpkgname; int type; bool force; bool update; @@ -308,7 +307,7 @@ exec_transaction(struct transaction *trans) { prop_dictionary_t instpkgd; prop_object_t obj; - const char *pkgname, *version, *instver, *filename; + const char *pkgname, *version, *instver, *filename, *tract; int rv = 0; bool essential, isdep, autoinst; pkg_state_t state = 0; @@ -349,6 +348,7 @@ exec_transaction(struct transaction *trans) prop_dictionary_get_cstring_nocopy(obj, "version", &version); prop_dictionary_get_bool(obj, "essential", &essential); prop_dictionary_get_cstring_nocopy(obj, "filename", &filename); + prop_dictionary_get_cstring_nocopy(obj, "trans-action", &tract); if ((trans->type == TRANS_ONE) && strcmp(trans->originpkgname, pkgname)) @@ -364,9 +364,7 @@ exec_transaction(struct transaction *trans) if (state == XBPS_PKG_STATE_UNPACKED) continue; - if ((trans->type == TRANS_ALL) || - (trans->update && - strcmp(trans->curpkgname, pkgname) == 0)) { + if (strcmp(tract, "update") == 0) { instpkgd = xbps_find_pkg_installed_from_plist(pkgname); if (instpkgd == NULL) { printf("error: unable to find %s installed "