| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we don't have a version installed yet we shouldn't go do a version
comparison with nil. No matter what that's a waste of time and in
dpkg/apt it's going to require shelling out now. Instead just do the
install.
This also adds the same version comparison method to the dpkg resource.
At the moment it doesn't look like this is going to get called since our
upgrade action there is a bit broken (doesn't actually compare
versions), but that's going to get fixed next.
This also cleans up the version comparison to make sure we're
always dealing with strings
Signed-off-by: Tim Smith <tsmith@chef.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The strings of dpkg versions are more complex than the Gem::Version
and not compatible with it.
Using Gem::Version to compare versions of dpkg packages will cause
mistakes or raise the exeption of 'Malformed version number..'.
please see a simple example:
https://gist.github.com/komazarari/c6b33b29a0e31e9c62bbc2f0b2091647
Prefer to use the dpkg cli.
https://debian-handbook.info/browse/en-US/stable/sect.manipulating-packages-with-dpkg.html
Signed-off-by: Takuto Komazaki <komazarari@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces fixes to the behaviour of the various providers of the "package" resource (and subtypes like dnf_package etc) when a more recent version of the package has been installed than that present in an available repository or file source and "action :upgrade" is called against the package.
Currently, a number of package providers will attempt to downgrade a package under this scenario, where the desired action should be to recognise that a more up to date version is already installed and do nothing.
I've introduced a ```version_compare``` method to the package superclass which by default uses ```Gem::Version``` comparison with spaceship-operator semantics to ensure that an upgrade is attempted only when the candidate version is not older than the current version.
Additionally, this commit introduces a method called ```version_equals?``` which is functionally identical to ```target_version_already_installed?``` (and that method now in fact calls ```version_equals?```. This has been done to clarify the purpose and functionality of that method, but since it's a public API, deprecation of the old method name will have to be done more gradually.
Signed-off-by: Jon Cowie <jcowie@chef.io>
|
|
|
|
|
|
|
|
|
| |
- cleans up a lot of ivar usage
- converts most providers to shell_out_compact_timeout!
- almost deprecates a few APIs, but can't quite yet
- windows providers need mixlib-shellout to take an argv
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
i think i fixed a bug here where now we expect the superclass to raise
on candidate_version = nil when installing, so now we can remove
packages that do not have a candidate_version
|
| |
|
| |
|
| |
|
|
|
| |
Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
|
|
|
| |
Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
|
|
|
| |
Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
|
|
|
|
|
|
|
| |
This is an entirely mechanically generated (chefstyle -a) change, to go
along with chef/chefstyle#5 . We should pick something and use it
consistently, and my opinion is that double quotes are the appropriate
thing.
|
|
|
|
| |
over priority
|
|
|
|
|
|
|
|
|
|
| |
updates all the shell_out calls to respect the timeout which is passed
on the new_resource.
the old `Chef::Config` yum timeout values are still respected and will
override the default.
the default of 900 seconds is preserved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
since check_package_state calls itself to check virtual packages the
array building it does was getting indexed incorrectly as the virtual
packages were getting inserted into arrays that were supposed to be
indexed by the package arguments the user gave. there was also a bug
which broke idempotency with virtual packages and would cause virtual
packages to get reinstalled every time (installed_version not geting
correctly inherited from the virtual package).
WIP2
remove debug
fix specs
|
|
|
|
| |
the names in this class are a bit confusing and need to be cleaned up
|
|
|
|
|
|
|
|
|
| |
make this a hash based on name so that when we pass an array of
names to install_package we can look up the right one and do not
have to synchronize arrays.
we should probably convert the arrays in the superclass to hashes
based on name as well.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit a88c852e7166c2d209d0670f668cf67feab19222.
We can't easily do this without changing a LOT of other assumptions. Since all
the consumer sites already call `as_array` functions, it's easier to keep those
safe.
|
|
|
|
| |
Also handle a lot more corner casses consistently and cleanup more code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow the `package` provider to take an array of packages to handle in one
transaction.
This solves two large problems:
* There are times when you cannot install two packages in sequence, like when a
binary is moving between two packages - they *must* be done in the same
transaction.
* When using Chef to install the vast majority of your base system, it
can make imaging take a very, very long time because executing yum or apt once
for every single package is painfully slow.
This solves both. The scaffolding is all there in the Package HWRP, plus the
underlying implementation for both apt and yum, the two I have access to test.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the apt provider attempts to check if it has a provider that
responds to :default_release (i.e. a real apt_package resource) via
if the provider attribute is explicitly set or not, which is relying
on a side-effect which broke in 12.0. the correct behavior is just
to duck-type the new_resource object and see if it
respond_to?(:default_release) and then use it if it does.
Also the unit tests were not testing the apt_provider against both the
package and apt_package resources. Added some hacky spec code (which
needs a cleanup) to at least exercise the use cases.
|
|
|
|
|
| |
makes resource and provider class resolution more dynamic.
begins deprecation of Chef::Platform static mapping.
|
|
|
|
| |
yes, i just used rubocop on the chef sourcecode...
|
| |
|
|
|
|
| |
functionality to fix resource notifications and ChefSpec stubs.
|
|\
| |
| | |
[CHEF-5168] Apt Package provider times out
|
| |
| |
| |
| |
| | |
- Convert APT package resource to use `provides :package`
- Add timeout parameter
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
| |
- Convert apt package provider to shellout. Improves content of error
messages when apt fails.
- Refactor tests to avoid stubbing value objects
|
|
|
|
| |
The opscode/chef repository now only contains the core Chef library code
used by chef-client, knife and chef-solo!
|
|
|
|
| |
all with proper deps
|
| |
|
| |
|
|
|