From 067687ce28fa7a2869f94fe6adab5cdf74c278d3 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 6 Feb 2016 09:03:54 +0100 Subject: [PATCH] libxbps: ignore updates for pkgs with held deps. Close #143 --- NEWS | 3 +++ lib/repo_pkgdeps.c | 6 +++++- tests/xbps/libxbps/shell/update_hold.sh | 3 +-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index c44b8668..125e357d 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.52 (???): + * libxbps: ignore updates for packages that have held dependencies. + Fixes #143. See https://github.com/voidlinux/xbps/issues/143 + * xbps-install(1): in dry-run mode, do not stop after processing a package that is already up-to-date. Fixes #145. See https://github.com/voidlinux/xbps/issues/145 diff --git a/lib/repo_pkgdeps.c b/lib/repo_pkgdeps.c index 6d09f713..ba9c537f 100644 --- a/lib/repo_pkgdeps.c +++ b/lib/repo_pkgdeps.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008-2014 Juan Romero Pardines. + * Copyright (c) 2008-2016 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -280,6 +280,10 @@ find_repo_deps(struct xbps_handle *xhp, break; } } + if (xbps_dictionary_get(curpkgd, "hold")) { + xbps_dbg_printf(xhp, "%s on hold state! ignoring package.\n", curpkg); + continue; + } /* * Pass 4: find required dependency in repository pool. * If dependency does not match add pkg into the missing diff --git a/tests/xbps/libxbps/shell/update_hold.sh b/tests/xbps/libxbps/shell/update_hold.sh index cf546b15..5d07e9f6 100644 --- a/tests/xbps/libxbps/shell/update_hold.sh +++ b/tests/xbps/libxbps/shell/update_hold.sh @@ -44,7 +44,6 @@ update_pkg_with_held_dep_head() { } update_pkg_with_held_dep_body() { - atf_expect_death "Known bug: see https://github.com/voidlinux/xbps/issues/143" mkdir -p some_repo pkginst pkgheld pkgdep-21_1 pkgdep-22_1 touch pkginst/pi00 touch pkgheld/ph00 @@ -102,7 +101,7 @@ update_pkg_with_held_dep_body() { xbps-rindex -d -a pkgdep-22*.xbps atf_check_equal $? 0 - xbps-install -r root -C empty.conf --repository=$PWD -d -y pkginst >&2 + xbps-install -r root -C empty.conf --repository=$PWD -d -yv pkginst atf_check_equal $? 0 }