Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: chef/chef
base: master
...
head fork: paulnicholson/chef
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 27, 2011
@paulnicholson paulnicholson add --ignore-default-opts to prevent errors when emerge is called and…
… EMERGE_DEFAULT_OPTS includes "ask"
4751daf
View
8 chef/lib/chef/provider/package/portage.rb
@@ -1,5 +1,7 @@
#
+# Author:: Paul Nicholson (<paul@webpowerdesign.net>)
# Author:: Ezra Zygmuntowicz (<ezra@engineyard.com>)
+# Copyright:: Copyright (c) 2011 Paul Nicholson
# Copyright:: Copyright (c) 2008 Opscode, Inc.
# License:: Apache License, Version 2.0
#
@@ -82,7 +84,7 @@ def parse_emerge(package, txt)
def candidate_version
return @candidate_version if @candidate_version
- status = popen4("emerge --color n --nospinner --search #{@new_resource.package_name.split('/').last}") do |pid, stdin, stdout, stderr|
+ status = popen4("emerge --ignore-default-opts --color n --nospinner --search #{@new_resource.package_name.split('/').last}") do |pid, stdin, stdout, stderr|
available, installed = parse_emerge(@new_resource.package_name, stdout.read)
@candidate_version = available
end
@@ -105,7 +107,7 @@ def install_package(name, version)
end
run_command_with_systems_locale(
- :command => "emerge -g --color n --nospinner --quiet#{expand_options(@new_resource.options)} #{pkg}"
+ :command => "emerge --ignore-default-opts -g --color n --nospinner --quiet#{expand_options(@new_resource.options)} #{pkg}"
)
end
@@ -121,7 +123,7 @@ def remove_package(name, version)
end
run_command_with_systems_locale(
- :command => "emerge --unmerge --color n --nospinner --quiet#{expand_options(@new_resource.options)} #{pkg}"
+ :command => "emerge --ignore-default-opts --unmerge --color n --nospinner --quiet#{expand_options(@new_resource.options)} #{pkg}"
)
end
View
12 chef/spec/unit/provider/package/portage_spec.rb
@@ -1,5 +1,7 @@
#
+# Author:: Paul Nicholson (<paul@webpowerdesign.net>)
# Author:: Caleb Tennis (<caleb.tennis@gmail.com>)
+# Copyright:: Copyright (c) 2011 Paul Nicholson
# Copyright:: Copyright (c) 2008 Opscode, Inc.
# License:: Apache License, Version 2.0
#
@@ -220,21 +222,21 @@
describe Chef::Provider::Package::Portage, "install_package" do
it "should install a normally versioned package using portage" do
@provider.should_receive(:run_command_with_systems_locale).with({
- :command => "emerge -g --color n --nospinner --quiet =dev-util/git-1.0.0"
+ :command => "emerge --ignore-default-opts -g --color n --nospinner --quiet =dev-util/git-1.0.0"
})
@provider.install_package("dev-util/git", "1.0.0")
end
it "should install a tilde versioned package using portage" do
@provider.should_receive(:run_command_with_systems_locale).with({
- :command => "emerge -g --color n --nospinner --quiet ~dev-util/git-1.0.0"
+ :command => "emerge --ignore-default-opts -g --color n --nospinner --quiet ~dev-util/git-1.0.0"
})
@provider.install_package("dev-util/git", "~1.0.0")
end
it "should add options to the emerge command when specified" do
@provider.should_receive(:run_command_with_systems_locale).with({
- :command => "emerge -g --color n --nospinner --quiet --oneshot =dev-util/git-1.0.0"
+ :command => "emerge --ignore-default-opts -g --color n --nospinner --quiet --oneshot =dev-util/git-1.0.0"
})
@new_resource.stub!(:options).and_return("--oneshot")
@@ -245,14 +247,14 @@
describe Chef::Provider::Package::Portage, "remove_package" do
it "should un-emerge the package with no version specified" do
@provider.should_receive(:run_command_with_systems_locale).with({
- :command => "emerge --unmerge --color n --nospinner --quiet dev-util/git"
+ :command => "emerge --ignore-default-opts --unmerge --color n --nospinner --quiet dev-util/git"
})
@provider.remove_package("dev-util/git", nil)
end
it "should un-emerge the package with a version specified" do
@provider.should_receive(:run_command_with_systems_locale).with({
- :command => "emerge --unmerge --color n --nospinner --quiet =dev-util/git-1.0.0"
+ :command => "emerge --ignore-default-opts --unmerge --color n --nospinner --quiet =dev-util/git-1.0.0"
})
@provider.remove_package("dev-util/git", "1.0.0")
end

No commit comments for this range

Something went wrong with that request. Please try again.