Skip to content

Commit 5f2cde3

Browse files
committed
lib: packages to be configured don't need to be in the repos
a package that is pulled into the transaction to be configured doesn't need to be found in the repository pool.
1 parent 0387711 commit 5f2cde3

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

lib/transaction_pkg_deps.c

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,28 @@ repo_deps(struct xbps_handle *xhp,
318318
break;
319319
}
320320
}
321+
if (ttype == XBPS_TRANS_UPDATE || ttype == XBPS_TRANS_CONFIGURE) {
322+
/*
323+
* If the package is already installed preserve the installation mode,
324+
* which is not automatic if automatic-install is not set.
325+
*/
326+
bool pkgd_auto = false;
327+
xbps_dictionary_get_bool(curpkgd, "automatic-install", &pkgd_auto);
328+
autoinst = pkgd_auto;
329+
}
330+
if (ttype == XBPS_TRANS_CONFIGURE) {
331+
if (!xbps_transaction_pkg_type_set(curpkgd, ttype)) {
332+
rv = EINVAL;
333+
xbps_dbg_printf("xbps_transaction_pkg_type_set failed for `%s': %s\n", reqpkg, strerror(rv));
334+
break;
335+
}
336+
if (!xbps_transaction_store(xhp, pkgs, curpkgd, autoinst)) {
337+
rv = EINVAL;
338+
xbps_dbg_printf("xbps_transaction_store failed for `%s': %s\n", reqpkg, strerror(rv));
339+
break;
340+
}
341+
continue;
342+
}
321343
/*
322344
* Pass 4: find required dependency in repository pool.
323345
* If dependency does not match add pkg into the missing
@@ -433,15 +455,6 @@ repo_deps(struct xbps_handle *xhp,
433455
} else if (xbps_dictionary_get(curpkgd, "hold")) {
434456
ttype = XBPS_TRANS_HOLD;
435457
}
436-
if (ttype == XBPS_TRANS_UPDATE || ttype == XBPS_TRANS_CONFIGURE) {
437-
/*
438-
* If the package is already installed preserve the installation mode,
439-
* which is not automatic if automatic-install is not set.
440-
*/
441-
bool pkgd_auto = false;
442-
xbps_dictionary_get_bool(curpkgd, "automatic-install", &pkgd_auto);
443-
autoinst = pkgd_auto;
444-
}
445458
/*
446459
* All deps were processed, store pkg in transaction.
447460
*/

0 commit comments

Comments
 (0)