Bug 200399 - ports-mgmt/pkg version 1.5.2: pkg upgrade -n offers interactive prompt and breaks downstream tools
Summary: ports-mgmt/pkg version 1.5.2: pkg upgrade -n offers interactive prompt and br...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-22 22:18 UTC by Jeffrey Baitis
Modified: 2015-05-29 21:09 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Baitis 2015-05-22 22:18:50 UTC
This appears to have surfaced after the new SAT solver was introduced.

See https://bugs.freenas.org/issues/9835 for downstream bug affecting PC-BSD users system update which relies upon pkg.

Here's an example invocation:

baitisj@raid:/usr/local/tmp$ pkg --version
1.5.2

baitisj@raid:/usr/local/tmp$ pkg upgrade -n
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
pkg: Cannot solve problem using SAT solver:
upgrade rule: upgrade local libreoffice-4.3.6 to remote libreoffice-4.3.7
cannot install package libreoffice, remove it from request? [Y/n]:
Comment 1 Jeffrey Baitis 2015-05-22 22:43:47 UTC
I've verified that this bug exists in pkg 1.5.99.2-d13232d built from git snapshot today
Comment 2 Bryan Drewery freebsd_committer freebsd_triage 2015-05-23 00:06:56 UTC
Something like this would ensure nothing like this happens. Defaulting to no.

diff --git a/src/utils.c b/src/utils.c
index 8d4fac8..6b1769a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -123,6 +123,9 @@ vquery_yesno(bool deft, const char *msg, va_list ap)
        if (quiet)
                return (yes || default_yes || r);

+       if (dry_run)
+               return (false);
+
        /* Do not query user if we have specified yes flag */
        if (yes)
                return (true);
Comment 3 Jeffrey Baitis 2015-05-23 00:47:08 UTC
The above patch to utils.c caused failure in travis CI with:
 tests/frontend/php-pr.sh:pkg_phpextensions  ->  failed: atf-check failed
Comment 4 Jeffrey Baitis 2015-05-29 21:09:19 UTC
-gitlogs/#pkgng- pkg/master 29a933b Baptiste Daroussin: Merge pull request #1256 from baitisj/master...