openSUSE / zypper

World's most powerful command line package manager
http://en.opensuse.org/Portal:Zypper
Other
405 stars 110 forks source link

Add --ignore-unknown option for install/update #13

Closed mlandres closed 11 years ago

mlandres commented 12 years ago

Requested 2012-09-14 by Juergen Gehne on [zypp-devel]:

may I add something to the zypper wish list?

We very often install a group of packages via zypper automatically by

zypper --no-refresh --non-interactive --no-gpg-check in pack1 pack2 ... packN

But if only 1 package cannot be found, zypper does not install any package. I would be very glad if you could implement an option like "--ignore-unknown" so that unknown packages will be ignored.

Steap commented 11 years ago

I took a quick look at this issue. The following patch should solve it:

https://www.gitorious.org/steap-opensuse/zypper/commit/e29722ebb1e72ba470512d2e1b8a4b584f51b8d4

When running "zypper in --ignore-unknown pkg1 pkg2..." or 'zypper in -i pkg1 pkg2", zypper will ignore packages it cannot find anywhere, and return 0.

I am new to openSUSE, but I hope this helps.

mlandres commented 11 years ago

Thanks for doing the 1st step. This option should IMO be applicable to every command that takes such a list of packages (or patches). Maybe it could even be a global option, so it can later be used with repository or lock commands as well. And of course it needs to be mentioned in the manpage.

Steap commented 11 years ago

On 11/22/2012 10:47 AM, Michael Andres wrote:

Thanks for doing the 1st step. This option should IMO be applicable to every command that takes such a list of packages (or patches). Maybe it could even be a global option, so it can later be used with repository or lock commands as well.

I'll add --ignore-unknown as a global option, then.

And of course it needs to be mentioned in the manpage.

OK, I'll update the manpage as well.

The "tests" directory has not been updated in a while. Should I add a test for this option anyway ? I used a simple shell script to make sure my first patch worked well.

WBR, Cyril Roelandt.

mlandres commented 11 years ago

I don't think it needs a dedicated testcase.

Steap commented 11 years ago

On 11/26/2012 10:56 AM, Michael Andres wrote:

I don't think it needs a dedicated testcase.

I made it a global option, that currently applies to install/remove/source install/update and updated the man page. The code can be found at :

https://gitorious.org/steap-opensuse/zypper/commit/e590d950839c0487b723dbc87c796121fea53ec0

WBR, Cyril Roelandt.

mlandres commented 11 years ago

Thanks for the patch. Commit cdf3877d5fc2c8fd5ee0d51cbfca07ce6f27a625 fixes this issue.