xbps_register_pkg: remove 'automatic' boolean argument.

It should be provided in the proplib dictionary with key 'automatic-install'.
This fixes a regression not respecting the 'automatic-install' value stored
in regpkgdb.
This commit is contained in:
Juan RP
2011-04-11 14:42:06 +02:00
parent ad66fa2e3d
commit ef28101203
4 changed files with 19 additions and 15 deletions

View File

@@ -387,7 +387,7 @@ exec_transaction(struct transaction *trans)
prop_object_t obj;
const char *pkgname, *version, *pkgver, *instver, *filen, *tract;
int rv = 0;
bool update, preserve, autoinst;
bool update, preserve;
pkg_state_t state;
/*
@@ -484,12 +484,11 @@ exec_transaction(struct transaction *trans)
if ((strcmp(tract, "remove") == 0) ||
(strcmp(tract, "configure") == 0))
continue;
autoinst = preserve = false;
preserve = false;
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
prop_dictionary_get_cstring_nocopy(obj, "version", &version);
prop_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
prop_dictionary_get_cstring_nocopy(obj, "filename", &filen);
prop_dictionary_get_bool(obj, "automatic-install", &autoinst);
prop_dictionary_get_bool(obj, "preserve", &preserve);
/*
* If dependency is already unpacked skip this phase.
@@ -537,7 +536,7 @@ exec_transaction(struct transaction *trans)
/*
* Register binary package.
*/
if ((rv = xbps_register_pkg(obj, autoinst)) != 0) {
if ((rv = xbps_register_pkg(obj)) != 0) {
xbps_error_printf("xbps-bin: error registering %s "
"(%s)\n", pkgver, strerror(rv));
return rv;

View File

@@ -184,7 +184,7 @@ main(int argc, char **argv)
if (rv != 0)
exit(EXIT_FAILURE);
rv = xbps_register_pkg(dict, false);
rv = xbps_register_pkg(dict);
if (rv == EEXIST) {
printf("%s%s=> %s-%s already registered.%s\n", MSG_WARN,
in_chroot ? "[chroot] " : "", argv[1], argv[2],