xbps_register_pkg: if automatic-install obj is there, don't overwrite its value.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091224003242-9twye4isotebbips
This commit is contained in:
Juan RP 2009-12-24 01:32:42 +01:00
parent 53adf2779b
commit 4be79d4535

View File

@ -38,6 +38,7 @@ xbps_register_pkg(prop_dictionary_t pkgrd, bool automatic)
const char *pkgname, *version, *desc, *pkgver; const char *pkgname, *version, *desc, *pkgver;
char *plist; char *plist;
int rv = 0; int rv = 0;
bool autoinst = false;
plist = xbps_xasprintf("%s/%s/%s", xbps_get_rootdir(), plist = xbps_xasprintf("%s/%s/%s", xbps_get_rootdir(),
XBPS_META_PATH, XBPS_REGPKGDB); XBPS_META_PATH, XBPS_REGPKGDB);
@ -85,11 +86,14 @@ xbps_register_pkg(prop_dictionary_t pkgrd, bool automatic)
rv = errno; rv = errno;
goto out; goto out;
} }
if (!prop_dictionary_set_bool(pkgd, if (!prop_dictionary_get_bool(pkgd,
"automatic-install", automatic)) { "automatic-install", &autoinst)) {
prop_object_release(pkgd); if (!prop_dictionary_set_bool(pkgd,
rv = errno; "automatic-install", automatic)) {
goto out; prop_object_release(pkgd);
rv = errno;
goto out;
}
} }
/* /*