Fix and improve when there are missing deps in the transaction dictionary.

This commit is contained in:
Juan RP
2010-11-23 23:17:04 +01:00
parent 99f3d846de
commit d2be842ce5
5 changed files with 23 additions and 11 deletions

View File

@ -113,6 +113,7 @@ add_missing_reqdep(prop_dictionary_t trans_dict, const char *reqpkg)
prop_object_t obj;
size_t idx = 0;
bool add_pkgdep, pkgfound, update_pkgdep;
int rv = 0;
assert(trans_dict != NULL);
assert(reqpkg != NULL);
@ -148,6 +149,12 @@ add_missing_reqdep(prop_dictionary_t trans_dict, const char *reqpkg)
}
if (strcmp(pkgnamedep, curpkgnamedep) == 0) {
pkgfound = true;
if (strcmp(curver, pkgver) == 0) {
free(curpkgnamedep);
free(pkgnamedep);
rv = EEXIST;
goto out;
}
/*
* if new dependency version is greater than current
* one, store it.
@ -158,6 +165,7 @@ add_missing_reqdep(prop_dictionary_t trans_dict, const char *reqpkg)
add_pkgdep = false;
free(curpkgnamedep);
free(pkgnamedep);
rv = EEXIST;
goto out;
}
update_pkgdep = true;
@ -180,7 +188,7 @@ out:
return errno;
}
return 0;
return rv;
}
static int