Skip to content
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

zypp: ensure locked packages are neither installed, updated, removed, nor downloaded #557

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rodrigopedra
Copy link
Contributor

On my previous PR #543 I proposed a change to not list locked packages as being able to be updated.

Which is fine, as one would not expect a locked package to be listed as being able to be to updated.

But locked packages could still be installed by PackageKit. For example, zypper by default install recommended packages, as can be seen on this configuration file, from their official repository:

https://github.com/openSUSE/zypper/blob/7a03e8594bb8dbf2af68decc4427d5244f68f46c/zypper.conf#L70-L82

So when a locked package is listed in the recommended listing for another package, it ends up being resolved by the backend, and then installed.

I tracked every occurrence where libzypp API was used to mark a package to be installed, updated, or removed, and added a guard to ignore locked packages.

For example, if you look into the function backend_remove_packages_thread, the guard was added before calling item.status ().setToBeUninstalled() or any other manual status change.

// Added guard here ...
if (zypp_package_is_locked(solvable))
    continue;

PoolItem item(solvable);
if (solvable.isSystem ()) {
    // ... to prevent this
    item.status ().setToBeUninstalled (ResStatus::USER);
    items.push_back (item);
} else {
    item.status ().resetTransact (ResStatus::USER);
}

In addition I also added a guard to skip locked packages from being downloaded.

@rodrigopedra
Copy link
Contributor Author

@bmwiedemann this PR is a follow up of patch bmwiedemann/openSUSE@7d61442 proposed by OpenSUSE OBS user dimstar.

If you, or him, can review this I would really appreciate.

I didn't find dimstar's github handle to tag him instead.

@bmwiedemann
Copy link

@DimStar77 ; could also be interesting to @mlandres

@DimStar77
Copy link
Collaborator

@bmwiedemann this PR is a follow up of patch bmwiedemann/openSUSE@7d61442 proposed by OpenSUSE OBS user dimstar.

If you, or him, can review this I would really appreciate.

I didn't find dimstar's github handle to tag him instead.

The original patch actually comes from @JonathanKang - care to chime in, please?

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.

None yet

3 participants