Shell wildcard patterns can now be used in the PackagesOnHold option.
This commit is contained in:
parent
a77727887d
commit
58333419a0
3
NEWS
3
NEWS
@ -1,5 +1,8 @@
|
|||||||
xbps-0.18 (???):
|
xbps-0.18 (???):
|
||||||
|
|
||||||
|
* Shell wildcard patterns (fnmatch(3)) can now be used in the
|
||||||
|
PackagesOnHold configuration option.
|
||||||
|
|
||||||
* New utilities replacing xbps-bin(8) and xbps-repo(8):
|
* New utilities replacing xbps-bin(8) and xbps-repo(8):
|
||||||
|
|
||||||
- xbps-install(8): to install and update packages.
|
- xbps-install(8): to install and update packages.
|
||||||
|
@ -55,11 +55,10 @@ repositories = {
|
|||||||
# Packages on hold.
|
# Packages on hold.
|
||||||
#
|
#
|
||||||
# Packages that are put on hold won't be updated even if there is a
|
# Packages that are put on hold won't be updated even if there is a
|
||||||
# newer version in repository pool.
|
# newer version in repository pool. Package names and shell wildcards
|
||||||
|
# can be specified.
|
||||||
#
|
#
|
||||||
# This expects package names and separated by commas.
|
#PackagesOnHold = { "glibc-*" }
|
||||||
#
|
|
||||||
#PackagesOnHold = { glibc, xbps }
|
|
||||||
|
|
||||||
# Virtual packages.
|
# Virtual packages.
|
||||||
#
|
#
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <fnmatch.h>
|
||||||
|
|
||||||
#include "xbps_api_impl.h"
|
#include "xbps_api_impl.h"
|
||||||
|
|
||||||
@ -72,21 +73,11 @@ transaction_find_pkg(struct xbps_handle *xhp,
|
|||||||
|
|
||||||
assert(pkg != NULL);
|
assert(pkg != NULL);
|
||||||
|
|
||||||
if (action == TRANS_INSTALL) {
|
|
||||||
/* install */
|
|
||||||
reason = "install";
|
|
||||||
} else {
|
|
||||||
/* update */
|
|
||||||
if ((pkg_pkgdb = xbps_pkgdb_get_pkgd(xhp, pkg, false)) == NULL)
|
|
||||||
return ENODEV;
|
|
||||||
|
|
||||||
reason = "update";
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find out if the pkg has been found in repository pool.
|
* Find out if the pkg has been found in repository pool.
|
||||||
*/
|
*/
|
||||||
if (action == TRANS_INSTALL) {
|
if (action == TRANS_INSTALL) {
|
||||||
|
reason = "install";
|
||||||
if (exact) {
|
if (exact) {
|
||||||
pkg_repod = xbps_rpool_find_pkg_exact(xhp, pkg);
|
pkg_repod = xbps_rpool_find_pkg_exact(xhp, pkg);
|
||||||
if (pkg_repod == NULL) {
|
if (pkg_repod == NULL) {
|
||||||
@ -102,6 +93,10 @@ transaction_find_pkg(struct xbps_handle *xhp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if ((pkg_pkgdb = xbps_pkgdb_get_pkgd(xhp, pkg, false)) == NULL)
|
||||||
|
return ENODEV;
|
||||||
|
|
||||||
|
reason = "update";
|
||||||
pkg_repod = xbps_rpool_find_pkg(xhp, pkg, false, true);
|
pkg_repod = xbps_rpool_find_pkg(xhp, pkg, false, true);
|
||||||
if (pkg_repod == NULL) {
|
if (pkg_repod == NULL) {
|
||||||
/* not found */
|
/* not found */
|
||||||
@ -202,7 +197,7 @@ int
|
|||||||
xbps_transaction_update_packages(struct xbps_handle *xhp)
|
xbps_transaction_update_packages(struct xbps_handle *xhp)
|
||||||
{
|
{
|
||||||
prop_object_t obj;
|
prop_object_t obj;
|
||||||
const char *pkgname, *holdpkgname;
|
const char *pkgname, *holdpkg;
|
||||||
bool foundhold = false, newpkg_found = false;
|
bool foundhold = false, newpkg_found = false;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
size_t i, x;
|
size_t i, x;
|
||||||
@ -213,11 +208,13 @@ xbps_transaction_update_packages(struct xbps_handle *xhp)
|
|||||||
for (i = 0; i < prop_array_count(xhp->pkgdb); i++) {
|
for (i = 0; i < prop_array_count(xhp->pkgdb); i++) {
|
||||||
obj = prop_array_get(xhp->pkgdb, i);
|
obj = prop_array_get(xhp->pkgdb, i);
|
||||||
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
|
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
|
||||||
|
|
||||||
for (x = 0; x < cfg_size(xhp->cfg, "PackagesOnHold"); x++) {
|
for (x = 0; x < cfg_size(xhp->cfg, "PackagesOnHold"); x++) {
|
||||||
holdpkgname = cfg_getnstr(xhp->cfg, "PackagesOnHold", x);
|
holdpkg = cfg_getnstr(xhp->cfg, "PackagesOnHold", x);
|
||||||
if (strcmp(pkgname, holdpkgname) == 0) {
|
if ((strcmp(holdpkg, pkgname) == 0) ||
|
||||||
xbps_dbg_printf(xhp, "[rpool] package %s on hold, "
|
(fnmatch(holdpkg, pkgname, FNM_PERIOD) == 0)) {
|
||||||
"ignoring updates.\n", pkgname);
|
xbps_dbg_printf(xhp, "[rpool] package `%s' "
|
||||||
|
"on hold, ignoring updates.\n", pkgname);
|
||||||
foundhold = true;
|
foundhold = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user