Skip to content

Smart rejects upgrade specific package #10

@niamster

Description

@niamster
# smart query packagegroup-apps
...
packagegroup-apps-1.0-r1.24.4@all
packagegroup-apps-1.0-r1.35.6.0@all
# smart query packagegroup-apps --installed
...
packagegroup-apps-1.0-r1.24.4@all
# smart upgrade
...
No interesting upgrades available.

The problem is that smart is rejecting the changeset by weight.
For a given changeset the calculated weight is 1.99, while empty changeset has weight 0.

Changeset

{packagegroup-apps-1.0-r1.35.6.0@all: INSTALL, kb-events-1.0-r2.4@cortexa7hf_neon_vfpv4: INSTALL, python3-msgpack-0.4.7-r0@cortexa7hf_neon_vfpv4: INSTALL, logrotate-3.9.1-r0.1@cortexa7hf_neon_vfpv4: INSTALL, hfsprogs-332.25-r0.0@cortexa7hf_neon_vfpv4: INSTALL, python-flask-0.10.1-r0@cortexa7hf_neon_vfpv4: INSTALL, python-fasteners-0.14.1-r0.0@cortexa7hf_neon_vfpv4: INSTALL, logrotate-cfg-1.0-r4@cortexa7hf_neon_vfpv4: INSTALL, python-markupsafe-0.23-r0@cortexa7hf_neon_vfpv4: INSTALL, python-gevent-1.2.1-r0.0@cortexa7hf_neon_vfpv4: INSTALL, python-werkzeug-0.11.5-r0@cortexa7hf_neon_vfpv4: INSTALL, python-itsdangerous-0.24-r0@cortexa7hf_neon_vfpv4: INSTALL, uwsgi-2.0.14-r1.0@cortexa7hf_neon_vfpv4: INSTALL, python-chacha-1+git81ee4df1020e64a93abe5fbea6b9c9dd8dc3e934-0.0@cortexa7hf_neon_vfpv4: INSTALL, python-greenlet-0.4.12-r0.0@cortexa7hf_neon_vfpv4: INSTALL, glibc-binary-localedata-en-us-2.23-r0@cortexa7hf_neon_vfpv4: INSTALL, python-pycparser-2.14-r0@cortexa7hf_neon_vfpv4: INSTALL, python-monotonic-1.0-r0@cortexa7hf_neon_vfpv4: INSTALL, python-jinja2-2.8-r0@cortexa7hf_neon_vfpv4: INSTALL, python-six-1.10.0-r0@cortexa7hf_neon_vfpv4: INSTALL, led-blink-ext-1.0-r3@cortexa7hf_neon_vfpv4: INSTALL, vlog-fix-1.0-r3@cortexa7hf_neon_vfpv4: INSTALL, share-1.0+gitrzzz-r6.2@cortexa7hf_neon_vfpv4: INSTALL, lastlog-kpanic-1.0-r3@cortexa7hf_neon_vfpv4: INSTALL, python3-pyzmq-16.0.2-r0@cortexa7hf_neon_vfpv4: INSTALL, libexpat1-2.1.0-r0@cortexa7hf_neon_vfpv4: INSTALL, libbsd0-0.8.2-r0@cortexa7hf_neon_vfpv4: INSTALL, nginx-1.8.1-r1.0@cortexa7hf_neon_vfpv4: INSTALL, root-env-cfg-1.0-r1@cortexa7hf_neon_vfpv4: INSTALL, monit-5.20.0-r3.0@cortexa7hf_neon_vfpv4: INSTALL, python-natsort-5.0.2-r0.0@cortexa7hf_neon_vfpv4: INSTALL, zip-3.0-r2@cortexa7hf_neon_vfpv4: INSTALL, python-cffi-1.5.2-r0@cortexa7hf_neon_vfpv4: INSTALL, locale-base-en-us-2.23-r0@cortexa7hf_neon_vfpv4: INSTALL, packagegroup-apps-1.0-r1.24.4@all: REMOVE}

The fix below did the trick but I'm not 100% confident it's the most correct way to fix the issue:

diff --git a/smart/transaction.py b/smart/transaction.py
index 4b90cb7..d7d8526 100644
--- a/smart/transaction.py
+++ b/smart/transaction.py
@@ -1014,7 +1014,7 @@ class Transaction(object):
             else:
                 lockedstate[pkg] = lk
                 csweight = getweight(cs)
-                if csweight < weight:
+                if csweight < weight or len(changeset) == 0:
                     weight = csweight
                     changeset.setState(cs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions