Bug 252125 - ports-mgmt/pkg 1.16 wrong exit code on removing non-existent package
Summary: ports-mgmt/pkg 1.16 wrong exit code on removing non-existent package
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-25 06:57 UTC by vladimir-csp
Modified: 2021-01-15 04:11 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (pkg)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vladimir-csp 2020-12-25 06:57:45 UTC
Hello.
This change is unexpected and breaks automated workflows, since before 1.16 exit code 65 could be treated as success for package removal.

    host1# pkg -v
    1.15.10
    test-ansible-11# pkg remove nonexistent
    No packages matched for pattern 'nonexistent'
    
    Checking integrity... done (0 conflicting)
    1 packages requested for removal: 0 locked, 1 missing
    host1# echo $?
    65


    host2# pkg -v
    1.16.0
    host2# pkg remove nonexistent
    No packages matched for pattern 'nonexistent'
    
    Checking integrity... done (0 conflicting)
    1 packages requested for removal: 0 locked, 1 missing
    host2# echo $?
    1
Comment 1 Baptiste Daroussin freebsd_committer 2020-12-26 15:52:58 UTC
you script was working by accident exit 65 was representing data error, pkg got rid of sysexits because of that reason: sysexits is incomplete.
I would like to hear more about your automated workflow, if you are using something standard or not and see who we can really make that use case work.
Comment 2 Pavel Merdin 2021-01-14 23:12:32 UTC
I've opened bug #252560 with a similar issue. That is actually breaking chef automation, because the exit code is 1 as well now. 
It does not look like it's a good idea to break compatibility with previous versions, at least I don't possibly anticipate any reason to do so.