xbps now autoupdates itself exclusively if there's an update.
That was added for 0.21, but for some reason that I cannot remember it was disabled a bit later... looks like it's useful to have.
This commit is contained in:
parent
ea0f1731e3
commit
83ade39960
@ -227,23 +227,36 @@ trans_find_pkg(struct xbps_handle *xhp, const char *pkg, bool reinstall,
|
|||||||
int
|
int
|
||||||
xbps_transaction_update_packages(struct xbps_handle *xhp)
|
xbps_transaction_update_packages(struct xbps_handle *xhp)
|
||||||
{
|
{
|
||||||
|
xbps_dictionary_t pkgd;
|
||||||
xbps_object_t obj;
|
xbps_object_t obj;
|
||||||
xbps_object_iterator_t iter;
|
xbps_object_iterator_t iter;
|
||||||
bool newpkg_found = false;
|
const char *pkgver;
|
||||||
|
char *pkgname;
|
||||||
|
bool hold, newpkg_found = false;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
|
||||||
if ((rv = xbps_pkgdb_init(xhp)) != 0)
|
if ((rv = xbps_pkgdb_init(xhp)) != 0)
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if there's a new update for XBPS before starting
|
||||||
|
* a full system upgrade.
|
||||||
|
*/
|
||||||
|
if ((pkgd = xbps_pkgdb_get_pkg(xhp, "xbps")) ||
|
||||||
|
(pkgd = xbps_pkgdb_get_virtualpkg(xhp, "xbps"))) {
|
||||||
|
xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
|
||||||
|
pkgname = xbps_pkg_name(pkgver);
|
||||||
|
assert(pkgname);
|
||||||
|
rv = trans_find_pkg(xhp, pkgname, false, false);
|
||||||
|
free(pkgname);
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
iter = xbps_dictionary_iterator(xhp->pkgdb);
|
iter = xbps_dictionary_iterator(xhp->pkgdb);
|
||||||
assert(iter);
|
assert(iter);
|
||||||
|
|
||||||
while ((obj = xbps_object_iterator_next(iter))) {
|
while ((obj = xbps_object_iterator_next(iter))) {
|
||||||
xbps_dictionary_t pkgd;
|
hold = false;
|
||||||
const char *pkgver;
|
|
||||||
char *pkgname;
|
|
||||||
bool hold = false;
|
|
||||||
|
|
||||||
pkgd = xbps_dictionary_get_keysym(xhp->pkgdb, obj);
|
pkgd = xbps_dictionary_get_keysym(xhp->pkgdb, obj);
|
||||||
xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
|
xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
|
||||||
xbps_dictionary_get_bool(pkgd, "hold", &hold);
|
xbps_dictionary_get_bool(pkgd, "hold", &hold);
|
||||||
|
Loading…
Reference in New Issue
Block a user