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

Add root and no_recommends parameters in the public interface for Zypper and RPM (lowpkg) #51409

Closed
wants to merge 9 commits into from

Conversation

aplanas
Copy link
Contributor

@aplanas aplanas commented Jan 30, 2019

What does this PR do?

Provides a new root parameter in the public interfaces for rpm and zypper

What issues does this PR fix or reference?

New feature

Tests written?

For the low level RPM yes, for the zypper level I adjusted the current tests.

(backport from #50125)
(backport from #50671)

(cherry picked from commit 6aae270)
The CLI rpm command allows the --root parameter to change the
expected location where the rpm database can be found.

This patch add a new optional parameter in the public interface
to allow the set of the new root location.

Update the tests to use the extra parameter.

(cherry picked from commit 5747448)
The zypper CLI provides a way to change the path where zypper expect
to find the required configuration files and repositories.

This feature is useful to bootstrap chroot environments, inspect
repositories and packages from locally mounted devices, or help
during the installation of a new OS from the SUSE family.

This patch add the root optional parameter for each command in the
public interface, and fix the tests.

(cherry picked from commit 1e57b30)
_Zypper class take note when a .call() is done, to clean up the data
when we access to some attribute.

This produces a bug when two calls are one after another an we set
some attributes via the __call__ method, as whatever is set will be
cleared after the first attribute is accessed.

For example:

zypper.attrib.call(..)
zypper(root=root).otherattrib.call(..)

The first call will set __called as True, and the reset of the inner
state of zypper will be cleared when otherattrib is accessed,
cleanning the status for __root.

This patch makes sure to clean the status also during the __call__
method, avoiding the cleanning when the attribute is accessed.

(cherry picked from commit 50e549d)
Add no_recommends parameter to install and upgrade actions.

(cherry picked from commit c2ace99)
In _get_configured_repos if the directory where the repositories
are stored is not found, an log error is emitted.

Most of the times this is indeed an indication of an error, but is
not always the case. For example, when we are creating a chroot
environment we do not need to create this directory, as is generated
by zypper when a new repository is added.

This patch demote the error to a warning, as this directory will
be present eventually is most situations after the first call to
zypper.

(cherry picked from commit 441e116)
@dwoz
Copy link
Contributor

dwoz commented Feb 1, 2019

2019.2 has been feature frozen.

@dwoz dwoz closed this Feb 1, 2019
@aplanas aplanas deleted the backport_50125 branch February 4, 2019 12:41
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