Make it possible to overwrite the "automatic-install" pkg object via xbps_init().
Two new booleans were added to struct xbps_handle: install_reason_{auto,manual}. The backend is able to force auto or manual installation for a package (and dependencies that were installed/updated) by setting to true any of those booleans. Bump XBPS_RELVER.
This commit is contained in:
@@ -49,7 +49,6 @@ xbps_register_pkg(prop_dictionary_t pkgrd, bool automatic)
|
||||
const char *pkgname, *version, *desc, *pkgver;
|
||||
char *plist;
|
||||
int rv = 0;
|
||||
bool autoinst = false;
|
||||
|
||||
xhp = xbps_handle_get();
|
||||
plist = xbps_xasprintf("%s/%s/%s", xhp->rootdir,
|
||||
@@ -93,14 +92,15 @@ xbps_register_pkg(prop_dictionary_t pkgrd, bool automatic)
|
||||
rv = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (!prop_dictionary_get_bool(pkgd,
|
||||
"automatic-install", &autoinst)) {
|
||||
if (!prop_dictionary_set_bool(pkgd,
|
||||
"automatic-install", automatic)) {
|
||||
prop_object_release(pkgd);
|
||||
rv = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (xhp->install_reason_auto)
|
||||
automatic = true;
|
||||
else if (xhp->install_reason_manual)
|
||||
automatic = false;
|
||||
if (!prop_dictionary_set_bool(pkgd, "automatic-install",
|
||||
automatic)) {
|
||||
prop_object_release(pkgd);
|
||||
rv = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (provides) {
|
||||
if (!prop_dictionary_set(pkgd, "provides", provides)) {
|
||||
|
Reference in New Issue
Block a user