Skip to content

openbsdpkg.upgrade: implement pkg.upgrade for OpenBSD #45145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2018

Conversation

jasperla
Copy link
Contributor

What does this PR do?

This allows to upgrade all packages, a single package or a selection of packages

Previous Behavior

pkg.upgrade was not supported.

New Behavior

# salt salt.localdomain pkg.upgrade name=libsodium
salt.localdomain:
    ----------
    libsodium:
        ----------
        new:
            1.0.16p0
        old:
            1.0.15

Full upgrade including error reporting:

# salt salt.localdomain pkg.upgrade
salt.localdomain:
    ERROR: Problem encountered upgrading packages. Additional info follows:

    changes:
        ----------
        nghttp2:
            ----------
            new:
                1.28.0
            old:
                1.27.0
    result:
        ----------
        pid:
            23339
        retcode:
            1
        stderr:
            Can't install python-2.7.14p0 because of libraries
            |library util.13.0 not found
        stdout:
            quirks-2.402 signed on 2017-12-19T15:56:16Z
            | /usr/lib/libutil.so.12.2 (system): bad major
            Direct dependencies for python-2.7.14p0->2.7.14p0 resolve to sqlite3-3.21.0 gettext-0.19.8.1p1 libffi-3.2.1p2 bzip2-1.0.6p8
            Full dependency tree is gettext-0.19.8.1p1 libffi-3.2.1p2 sqlite3-3.21.0 bzip2-1.0.6p8 libiconv-1.14p3
            Couldn't find updates for python-2.7.14p0

Tests written?

No

Commits signed with GPG?

Yes

Copy link
Contributor

@rallytime rallytime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @jasperla! I have one small comment here. This also needs some tests. :)

def upgrade_available(name):
'''
Check whether or not an upgrade is available for a given package

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some .. versionadded:: Fluorine tags to this function and the new function below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing!

@jasperla jasperla force-pushed the openbsdpkg/upgrade branch 2 times, most recently from 1f84cbe to 237549d Compare January 2, 2018 21:17
@jasperla
Copy link
Contributor Author

jasperla commented Jan 2, 2018

And now with patches too, though the coverage of openbsdpkg.py is currently a bit lacking. I'll submit a new PR later to improve the tests.

@jasperla jasperla force-pushed the openbsdpkg/upgrade branch 2 times, most recently from e8e97a0 to 09789fd Compare January 9, 2018 17:46
this allows to upgrade all packages, a single package or a selection of packages
@jasperla jasperla force-pushed the openbsdpkg/upgrade branch from 09789fd to 2a5c10c Compare January 9, 2018 18:35
@jasperla
Copy link
Contributor Author

jasperla commented Jan 9, 2018

@rallytime this is good to go now?

@rallytime rallytime merged commit 96113c0 into saltstack:develop Jan 9, 2018
@jasperla
Copy link
Contributor Author

Thanks @rallytime !

@jasperla jasperla deleted the openbsdpkg/upgrade branch January 10, 2018 08:39
@rallytime
Copy link
Contributor

@jasperla Of course! Thanks again for all of these great fixes and additions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants