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

(PUP-7095) Enable portage install and uninstall options for the package provider #5498

Merged
merged 1 commit into from Mar 22, 2017

Conversation

Projects
None yet
4 participants
@prometheanfire
Contributor

prometheanfire commented Jan 12, 2017

Allow the portage package provider to accept install and uninstall
options. This is useful if you do not want to use the default global
EMERGE_DEFAULT_OPTS paramaters setable in make.conf.

Allow the portage package provider to purge package if requested.

Allow package sets (@world @System and the like)

@prometheanfire

This comment has been minimized.

Show comment
Hide comment
@prometheanfire

prometheanfire Jan 12, 2017

Contributor

my ruby is a bit rusty, but I believe I generate the correct install and uninstall commands, not sure if anything needed to be passed differently.

Contributor

prometheanfire commented Jan 12, 2017

my ruby is a bit rusty, but I believe I generate the correct install and uninstall commands, not sure if anything needed to be passed differently.

@puppetcla

This comment has been minimized.

Show comment
Hide comment
@puppetcla

puppetcla Jan 12, 2017

CLA signed by all contributors.

puppetcla commented Jan 12, 2017

CLA signed by all contributors.

@prometheanfire

This comment has been minimized.

Show comment
Hide comment
@prometheanfire

prometheanfire Mar 19, 2017

Contributor

Ok, this should be done and good

Contributor

prometheanfire commented Mar 19, 2017

Ok, this should be done and good

@MikaelSmith MikaelSmith changed the title from Enable portage install and uninstall options for the package provider to (PUP-7095) Enable portage install and uninstall options for the package provider Mar 20, 2017

@prometheanfire

This comment has been minimized.

Show comment
Hide comment
@prometheanfire

prometheanfire Mar 20, 2017

Contributor

I just tested this on a test server and now ensure => latest works, before it didn't, no bugs so far.

I've also one-off tested uninstalling and installing based on package version and slot. Install options work (I passed it --update on a ensure => latest package and it called emerge --update --update as it should have. Not sure what else to test atm.

Contributor

prometheanfire commented Mar 20, 2017

I just tested this on a test server and now ensure => latest works, before it didn't, no bugs so far.

I've also one-off tested uninstalling and installing based on package version and slot. Install options work (I passed it --update on a ensure => latest package and it called emerge --update --update as it should have. Not sure what else to test atm.

@prometheanfire

This comment has been minimized.

Show comment
Hide comment
@prometheanfire

prometheanfire Mar 20, 2017

Contributor

My puppet runs went to ~54 seconds from ~8 seconds though. Looking into it now. My guess is all the qatom calls (which call out to binaries on the system) really added up more than I thought.

Contributor

prometheanfire commented Mar 20, 2017

My puppet runs went to ~54 seconds from ~8 seconds though. Looking into it now. My guess is all the qatom calls (which call out to binaries on the system) really added up more than I thought.

@prometheanfire

This comment has been minimized.

Show comment
Hide comment
@prometheanfire

prometheanfire Mar 21, 2017

Contributor

it's the emerge --list-sets it's running every package run.

setting that statically got my run back down to 9 seconds

Contributor

prometheanfire commented Mar 21, 2017

it's the emerge --list-sets it's running every package run.

setting that statically got my run back down to 9 seconds

@prometheanfire

This comment has been minimized.

Show comment
Hide comment
@prometheanfire

prometheanfire Mar 21, 2017

Contributor

so, how do I store the output of emerge --list-sets between package runs?

Contributor

prometheanfire commented Mar 21, 2017

so, how do I store the output of emerge --list-sets between package runs?

@prometheanfire

This comment has been minimized.

Show comment
Hide comment
@prometheanfire

prometheanfire Mar 21, 2017

Contributor

fixed the runtime with dominic's help on irc. Old runtime was ~8 seconds, new runtime is ~5.4 seconds based on installing ~32 packages and a bunch of other services / files.

Contributor

prometheanfire commented Mar 21, 2017

fixed the runtime with dominic's help on irc. Old runtime was ~8 seconds, new runtime is ~5.4 seconds based on installing ~32 packages and a bunch of other services / files.

Show outdated Hide outdated spec/unit/provider/package/portage_spec.rb Outdated
Show outdated Hide outdated lib/puppet/provider/package/portage.rb Outdated
Show outdated Hide outdated lib/puppet/provider/package/portage.rb Outdated
Show outdated Hide outdated spec/unit/provider/package/portage_spec.rb Outdated
end
def self.eix_result_fields
[:category, :name, :ensure, :version_available, :installed_slots, :slot_versions_available, :vendor, :description]
# ensure:[3.4.5], version_available:[3.5.2], installed_slots:[2.7.12:2.7,3.4.5:3.4], installable_versions:[2.7.10-r1,2.7.12,3.4.3-r1,3.4.5,3.5.2] slot_versions_available:[2.7.12:2.7,3.4.5:3.4,3.5.2:3.5]
[:category, :name, :ensure, :version_available, :installed_slots, :installed_versions, :installable_versions, :slot_versions_available, :vendor, :description]

This comment has been minimized.

@prometheanfire

prometheanfire Mar 22, 2017

Contributor

bestversion should be what we want to ensure, not version_available (just need to switch them here too)

@prometheanfire

prometheanfire Mar 22, 2017

Contributor

bestversion should be what we want to ensure, not version_available (just need to switch them here too)

@prometheanfire

This comment has been minimized.

Show comment
Hide comment
@prometheanfire

prometheanfire Mar 22, 2017

Contributor

@MikaelSmith thanks for pointing it out, fixed :D

Contributor

prometheanfire commented Mar 22, 2017

@MikaelSmith thanks for pointing it out, fixed :D

(PUP-7095) Enable portage install and uninstall options
Allow the portage package provider to accept install and uninstall
options.  This is useful if you do not want to use the default global
EMERGE_DEFAULT_OPTS paramaters setable in make.conf.

Allow the portage package provider to purge package if requested.

Allow package sets (@world @System and the like)

Use ||= where possible and class variables when appropriate to reduce
runtime.  Old runtime was ~8.1 seconds, new runtime is ~5.4 seconds for
32 packages (and a bunch of other things).

@MikaelSmith MikaelSmith merged commit 43e2c93 into puppetlabs:master Mar 22, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@prometheanfire prometheanfire deleted the prometheanfire:enable_portage_options branch Mar 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment