Commit graph

238 commits

Author SHA1 Message Date
Robin Roth
584a06eec7 zypper cleanup checks for failure/diff (#2569)
* zypper cleanup checks for failure/diff

* move check for changed/failed from functions back to main
* handle all cases identially
* generate diff together

* fix module name
2016-07-16 09:38:30 +02:00
Andrii Radyk
f2b255ffa3 Add zypper refresh support in zypper module (#2411)
* added zypper refresh support

* removed trailing symbols
* added forced zypper refresh support similar to update_cache for apt module

* removed unnecessary blocks and cleaned up the logic for refresh

* added update_cache as alias for refresh to be similar to apt/yum module

* update zypper module according to comments
2016-07-13 08:28:05 +02:00
Robin Roth
8fe06a86f7 Check for zypper version before using options (#2549)
* priority needs zypper version >= 1.12.25
* gpgcheck needs zypper version >= 1.6.2
* output warnings if version not sufficient for option
* fixes #2548
2016-07-12 22:52:43 +02:00
Peter Oliver
92301f7451 Handle empty IPS publishers (#2047)
It turns out it's possible to set up a publisher with no URIs.  Handle
this gracefully.
2016-07-11 00:22:03 +02:00
Robin Roth
3480d3d167 allow overwrite_multiple with more than 2 repos (#2481)
2.1 introduces overwrite_multiple, which can overwrite more than one
exisiting repo (with matching alias or URL). Allow more than 2 repos to
be overwritten, since openSuSE allow more than one repo with the same
URL if the alias is different.
2016-07-09 11:38:12 +02:00
Patrik Lundin
1453d55c23 Improve debug log some more. 2016-07-01 18:38:19 +02:00
Patrik Lundin
d55f22a2c6 Make fail messages all use lowercase messages. 2016-06-30 18:55:43 +02:00
Patrik Lundin
59364500bc Improve debug logging some more. 2016-06-30 18:51:35 +02:00
Patrik Lundin
dd14d14224 No support for build=true with 'branch' syntax. 2016-06-30 18:13:40 +02:00
Patrik Lundin
2d353dc98c Improve debug logging for build code. 2016-06-30 17:41:17 +02:00
Patrik Lundin
c118bcab5c Add a break and extra debug log for clarity. 2016-06-30 17:30:28 +02:00
Patrik Lundin
7dcac77df5 openbsd_pkg: no need to call .rstrip. 2016-06-30 00:40:28 +02:00
Patrik Lundin
f4b40926b4 openbsd_pkg: fix build=true corner case.
* Fix bug where we were actually checking for the availability of the
  requested package name and not 'sqlports' even if that was the goal.

* Add check that the sqlports database file exists before using it.

* Sprinkle some debug messages for an easier time following the code when
  developing.
2016-06-29 23:57:31 +02:00
Patrik Lundin
39d0088af8 openbsd_pkg: support "pkgname%branch" syntax.
* Such package names requires at least OpenBSD 6.0.

* Rework get_package_state() to use 'pkg_info -Iq inst:' instead of 'pkg_info -e'
  because it understands the branch syntax. It also means we can get rid of
  some additional special handling.

  This was suggested by Marc Espie:
  http://marc.info/?l=openbsd-tech&m=146659756711614&w=2

* Drop get_current_name() because the use of 'pkg_info -Iq inst:' in
  get_package_state() means we already have that information available without
  needing to do custom parsing. This was also necessary because a name such as
  "postfix%stable" does not in itself contain the version information necessary
  for the custom parsing. pkg_info -Iq translates such a name to the actual
  package name seamlessly.

* Add support for finding more than one package for the supplied package name
  which may happen if we only supply a stem.
2016-06-29 23:27:31 +02:00
Chris Weber
9f58e7325c Fixed exception compatablity for py3 (and 2.4 in yum_repository.py) (#2369)
* Fixed exception compatablity for py3 (and 2.4 in yum_repository.py)

* Moved Import
2016-06-04 23:21:04 +02:00
Jiri Tyr
7549976dc0 Fixing wrong type of params option in yum_repository module (#2371)
This commit fixes incorrect type of the "params" option of the
"yum_repository" module. Without this fix the value of the "params"
option is read as a string instead of as a dictionary which makes
it impossible to define any additional YUM repository parameters.
2016-06-03 21:59:28 +02:00
Dmitry Marakasov
b0aec50b9a Improve documentation for pkgng module (#2338)
According to module checklist:

- Descriptions should always start with a Capital letter and end with a
  full stop.
- Ensure that you make use of U() for urls, C() for files and options,
  I() for params, M() for modules.
2016-05-31 12:58:55 -04:00
Brian Coca
8fac01a3cc minor fixes
removed unused imports
rearranged basic import
added if/main for testing/importability
2016-05-31 08:39:29 -04:00
Dmitry Marakasov
e316888f21 Freebsd pkgng autoremove support (#2324)
* Whitespace cleanup

* Add autoremove capability to pkgng

* Add "default" and "choices" documentnation items for autoremove
2016-05-27 09:49:54 -04:00
Adrian Likins
d1a4f703ce Fix pkgutil "upgrade_catalog must be one of" err (#2149)
The arg spec for update_catalog include 'type=bool'
and 'choices=["yes", "no"] which can never both be
true.

Remove the 'choices' directive, and update doc string.

Fixes #2144
2016-05-24 11:55:14 -04:00
Alex
ce5a9b6c5f zypper: (Bugfix) Change command option --verbose to --details which is supported since 2008 (#2224) 2016-05-19 08:21:33 +02:00
Rene Moser
806ebef383 homebrew_cask: fix doc version_added for install_options
See #2086
2016-05-04 08:29:46 +02:00
Robin Roth
bb68df525c refactor zypper module
* refactor zypper module

Cleanup:
* remove mention of old_zypper (no longer supported)
  * requirement goes up to zypper 1.0, SLES 11.0, openSUSE 11.1
  * allows to use newer features (xml output)
  * already done for zypper_repository
* use zypper instead of rpm to get old version information, based on work by @jasonmader
* don't use rpm, zypper can do everything itself
* run zypper only twice, first to determine current state, then to apply changes

New features:
* determine change by parsing zypper xmlout
* determine failure by checking return code
* allow simulataneous installation/removal of packages (using '-' and '+' prefix)
  * allows to swap out alternatives without removing packages depending
    on them
* implement checkmode, using zypper --dry-run
* implement diffmode
* implement 'name=* state=latest' and 'name=* state=latest type=patch'
* add force parameter, handed to zypper to allow downgrade or change of vendor/architecture

Fixes/Replaces:
* fixes #1627, give changed=False on installed patches
* fixes #2094, handling URLs for packages
* fixes #1461, fixes #546, allow state=latest name='*'
* fixes #299, changed=False on second install, actually this was fixed earlier, but it is explicitly tested now
* fixes #1824, add type=application
* fixes #1256, install rpm from path, this is done by passing URLs and paths directly to zypper

* fix typo in package_update_all

* minor fixes

* remove commented code block
* bump version added to 2.2
* deal with zypper return codes 103 and 106
2016-05-04 07:47:47 +02:00
Indrajit Raychaudhuri
142742964e Fix homebrew_cask examples 2016-04-25 08:56:04 -05:00
Indrajit Raychaudhuri
c5ed63a972 Add version_added doc property for install_options in homebrew_cask 2016-04-22 00:19:34 -05:00
Indrajit Raychaudhuri
8128464adc Add additional examples for parameter install_options in homebrew_cask 2016-04-21 19:26:47 -05:00
Enric Lluelles
357cbd73f5 Adding install_options to homebrew_cask 2016-04-21 19:10:50 -05:00
Robin Roth
e8fdba7593 Zypper repository rewrite (#1990)
* Remove support for ancient zypper versions

Even SLES11 has zypper 1.x.

* zypper_repository: don't silently ignore repo changes

So far when a repo URL changes this got silently ignored (leading to
incorrect package installations) due to this code:

    elif 'already exists. Please use another alias' in stderr:
        changed = False

Removing this reveals that we correctly detect that a repo definition
has changes (via repo_subset) but don't indicate this as change but as a
nonexistent repo. This makes us currenlty bail out silently in the above
statement.

To fix this distinguish between non existent and modified repos and
remove the repo first in case of modifications (since there is no force
option in zypper to overwrite it and 'zypper mr' uses different
arguments).

To do this we have to identify a repo by name, alias or url.

* Don't fail on empty values

This unbreaks deleting repositories

* refactor zypper_repository module

* add properties enabled and priority
* allow changing of one property and correctly report changed
* allow overwrite of multiple repositories by alias and URL
* cleanup of unused code and more structuring

* respect enabled option

* make zypper_repository conform to python2.4

* allow repo deletion only by alias

* check for non-existant url field and use alias instead

* remove empty notes and aliases

* add version_added for priority and overwrite_multiple

* add version requirement on zypper and distribution

* zypper 1.0 is enough and exists

* make suse versions note, not requirement

based on comment by @alxgu
2016-04-18 17:47:17 +02:00
Jiri Tyr
3ba9e817fe Describing the _none_ value of the proxy option (#2053) 2016-04-18 11:01:24 -04:00
Michael Scherer
e8dbb4e4f2 Mark conf_file as a path, for various user expansion 2016-04-14 21:15:07 +02:00
Christopher M. Fuhrman
8c6a3e732e pkgin: Fix bad regexp which did not catch packages such as p5-SVN-Notify
The previous version of my regexp did not take into account packages
such as 'p5-Perl-Tidy' or 'p5-Test-Output', so use a greedy match up to
the last occurrance of '-' for matching the package.  This regex has
been extensively tested using all packages as provided by pkgsrc-2016Q1[1].

Footnotes:
[1]  http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/?only_with_tag=pkgsrc-2016Q1
2016-04-14 12:51:29 +02:00
Jasper Lievisse Adriaanse
2b8debbc2b Sprinkle some LANG/LC_* where command output is parsed (#2019) 2016-04-13 10:03:26 -04:00
Jasper Lievisse Adriaanse
85c1440ede Tweak and extend the pkgin module
- make path to pkgin a global and stop passing it around; it's not going
  to change while ansible is running
- add support for several new options:
  * upgrade
  * full_upgrade
  * force
  * clean
- allow for update_cache to be run in the same task as upgrading/installing
  packages instead of needing a separate task for that
2016-04-13 11:02:42 +02:00
Joerg Fiedler
44bfca315a add chroot flag to pkgng in order to allow installation of packages into chroot environments, e.g. jails (#1218) 2016-04-11 08:25:30 +02:00
René Moser
542a96f907 Merge pull request #1827 from jasperla/pkgin_update_cache
support for 'update_cache' in pkgin module
2016-04-10 22:49:31 +02:00
Michael Scherer
d9b8043b4a Use type='path' for reposdir, since that's a path 2016-03-30 21:49:58 +02:00
Jasper Lievisse Adriaanse
3e31c2408d support for 'update_cache' in pkgin module 2016-03-29 22:50:10 +02:00
Brian Coca
7ef09ac889 Merge pull request #1919 from mscherer/fix_portage
Use boolean instead of "yes" + choice for most option
2016-03-28 07:05:10 -07:00
Michael Scherer
9853caa536 Use boolean instead of "yes" + choice for most option
This enable a more standard behavior with others modules
2016-03-28 09:14:57 +02:00
Michael Scherer
2e8cd5cd74 Use type 'path' for rootdir, for pkgng 2016-03-27 21:08:05 +02:00
Brian Coca
3b95400a59 change name to be a list type
remove implicit split that expects a , separated string, let list type
deal with multiple possible compatible input types.
also removed unused imports
2016-03-23 12:21:03 -07:00
Matthew Gamble
a92a0e56f2 Remove dead code from pacman module
The manual check to see if get_bin_path() returned anything is
redundant, because we pass True to the required parameter of
get_bin_path(). This automatically causes the task to fail if the pacman
binary isn't available. Therefore, the code within the if statement
being removed is never called.
2016-03-23 18:39:26 +11:00
René Moser
af9aaed64c Merge pull request #1662 from saez0pub/devel
Prevent reinstallation in case of group package
2016-03-16 22:28:44 +01:00
Will Keeling
282deb3291 Better handling of package groups in pacman module 2016-03-08 20:24:11 +00:00
saez0pub
6c7be7d97d Prevent reinstallation in case of group package 2016-03-08 18:57:30 +01:00
Toshio Kuratomi
9835b6a477 Fail due to no dnf module installed earlier as we use a dnf utility function to determine if we have permission to install packages. 2016-03-04 09:43:23 -08:00
Jiri Tyr
012085263f Removing parameter from yum_repository module 2016-03-04 00:43:44 +00:00
Toshio Kuratomi
95d54004af Merge pull request #1772 from jtyr/jtyr-yumrepo_new_params
Adding more options to the yum_repository module
2016-03-03 15:59:49 -08:00
Brian Coca
f23baa2dda Merge pull request #1646 from k0ste/newfeature
pacman: fix recurse delete. Add force update_cache feature.
2016-03-03 18:16:09 -05:00
Jiri Tyr
23c4e8de4a Adding more options to the yum_repository module 2016-03-03 17:01:46 +00:00