xbps-bin: fix installation of new packages with autoupdate.

--HG--
extra : convert_revision : 3195174fd64a10bb4fad3fc888a3693796bfb212
This commit is contained in:
Juan RP 2009-08-11 19:11:14 +02:00
parent 144caa8cb4
commit 9f95d9dd8c

View File

@ -44,7 +44,6 @@ struct transaction {
prop_dictionary_t dict; prop_dictionary_t dict;
prop_object_iterator_t iter; prop_object_iterator_t iter;
const char *originpkgname; const char *originpkgname;
const char *curpkgname;
int type; int type;
bool force; bool force;
bool update; bool update;
@ -308,7 +307,7 @@ exec_transaction(struct transaction *trans)
{ {
prop_dictionary_t instpkgd; prop_dictionary_t instpkgd;
prop_object_t obj; prop_object_t obj;
const char *pkgname, *version, *instver, *filename; const char *pkgname, *version, *instver, *filename, *tract;
int rv = 0; int rv = 0;
bool essential, isdep, autoinst; bool essential, isdep, autoinst;
pkg_state_t state = 0; 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_cstring_nocopy(obj, "version", &version);
prop_dictionary_get_bool(obj, "essential", &essential); prop_dictionary_get_bool(obj, "essential", &essential);
prop_dictionary_get_cstring_nocopy(obj, "filename", &filename); prop_dictionary_get_cstring_nocopy(obj, "filename", &filename);
prop_dictionary_get_cstring_nocopy(obj, "trans-action", &tract);
if ((trans->type == TRANS_ONE) && if ((trans->type == TRANS_ONE) &&
strcmp(trans->originpkgname, pkgname)) strcmp(trans->originpkgname, pkgname))
@ -364,9 +364,7 @@ exec_transaction(struct transaction *trans)
if (state == XBPS_PKG_STATE_UNPACKED) if (state == XBPS_PKG_STATE_UNPACKED)
continue; continue;
if ((trans->type == TRANS_ALL) || if (strcmp(tract, "update") == 0) {
(trans->update &&
strcmp(trans->curpkgname, pkgname) == 0)) {
instpkgd = xbps_find_pkg_installed_from_plist(pkgname); instpkgd = xbps_find_pkg_installed_from_plist(pkgname);
if (instpkgd == NULL) { if (instpkgd == NULL) {
printf("error: unable to find %s installed " printf("error: unable to find %s installed "