Bug #3655

Puppet doesn't find installed packages with portage provider

Added by Doug Warner almost 2 years ago. Updated almost 2 years ago.

Status:Closed Start date:04/22/2010
Priority:Normal Due date:
Assignee:Benedikt Böhm % Done:

0%

Category:Gentoo
Target version:0.25.5
Affected Puppet version:0.25.4 Branch:
Keywords:eix
portage
gentoo
Votes: 0

Description

I’m trying to upgrade my gentoo boxes to 0.25.4 but am running into a problem with the portage package provider is not finding installed packages. It looks like the “<installedversions:LASTVERSION>” format for eix is not finding the correct value. I’ve tried using eix versions 0.17.0, 0.19.2, and 0.20.3.

Example output:

# /usr/bin/eix --nocolor --pure-packages --stable --format '  [] []  
' --exact --category-name sys-devel/gcc-config
sys-devel gcc-config [] [] http://www.gentoo.org/ Utility to change the gcc compiler being used

In this example it looks like the brackets should be filled in with the values which are captured by eix, shown here:

# eix gcc-config
[I] sys-devel/gcc-config
     Available versions:  1.3.16 1.4.0-r4 1.4.1 **1.5
     Installed versions:  1.4.1(19:38:02 06/05/09)
     Homepage:            http://www.gentoo.org/
     Description:         Utility to change the gcc compiler being used

puppet-0.25.4-portage-provider-result.patch - patch to fix parsing the output of eix to accomodate extra spaces (1 kB) Doug Warner, 04/23/2010 06:49 pm

puppet-0.25.4-portage-provider-result.patch (1 kB) Benedikt Böhm, 04/30/2010 06:31 am

History

Updated by James Turnbull almost 2 years ago

  • Category set to Gentoo
  • Status changed from Unreviewed to Accepted
  • Assignee set to Benedikt Böhm

Benedikt – any chance you can take a look at this?

Updated by Benedikt Böhm almost 2 years ago

Hi Doug! can you please try the following command (LASTVERSION has to be set in the ENV):

LASTVERSION="{last}{}" /usr/bin/eix --nocolor --pure-packages --stable --format '  [] []  ' --exact --category-name sys-devel/gcc-config

Updated by James Turnbull almost 2 years ago

  • Target version set to 0.25.5

Updated by Doug Warner almost 2 years ago

Thanks, I definitely missed that part when I was looking at the code (I was trying to figure out what ‘version_format’ was doing ;).

That also makes the full “—installed” command work as described (both tried on eix 0.19.2).

Unfortunately puppet still thinks that files that are installed aren’t, but this seems to be only happening with my own overlay now (although it was previously happening for all packages).

Here’s some debug:

debug: Puppet::Type::Package::ProviderPortage: Executing '/usr/bin/eix --nocolor --pure-packages --stable --format   [] []  
 --exact --category-name bitleap-server/bitleaplibs'
err: //bitleapportage::bitleaplibs/Package[bitleaplibs]: Failed to retrieve current state of resource: No package found with the specified name [bitleap-server/bitleaplibs]
notice: //bitleapportage::php_modules/Package[php-modules]: Dependency package[bitleaplibs] has 1 failures
warning: //bitleapportage::php_modules/Package[php-modules]: Skipping because of failed dependencies

Here’s the command and output when I run this from the cli:

$ LASTVERSION="{last}{}" /usr/bin/eix --nocolor --pure-packages --stable --format '  [] []  
> ' --exact --category-name bitleap-server/bitleaplibs
bitleap-server bitleaplibs [20071020-r7588] [20071020-r7588]  BitLeap C Libraries

For some background, I’m trying to upgrade my 0.24.8 puppetmaster to 0.25.4 and get things running on that host before I point all my 0.24.8 boxes to it and work on upgrading them.

Updated by Doug Warner almost 2 years ago

I forgot, here’s the output of the “installed” command looking for the package mentioned:

$ LASTVERSION="{last}{}" /usr/bin/eix --nocolor --pure-packages --stable --installed --format '  [] []  
> ' | grep bitleaplibs
bitleap-server bitleaplibs [20071020-r7588] [20071020-r7588]  BitLeap C Libraries

Updated by Doug Warner almost 2 years ago

With some extra debugging I was able to find the the ‘result_format’ regex wasn’t matching my vendor due to an extra space being picked up somewhere, for example, the search result:

bitleap-server bitleap-nagios-plugins [0.06] [0.06]  BitLeap custom nagios plugins

Doesn’t work because of the extra space before Bitleap.

Updating the result_format regex to the following for the time being fixes things up:

result_format = /^(\S+)\s+(\S+)\s+\[(\S+)\]\s+\[(\S+)\]\s+(\S+)\s+(.*)$/

A proper patch will be coming shortly.

Updated by Doug Warner almost 2 years ago

Here’s the patch I was talking about.

Updated by Benedikt Böhm almost 2 years ago

  • Status changed from Accepted to In Topic Branch Pending Review

thanks for investigating this! the patch looks fine, but i cannot test it until monday

Updated by Benedikt Böhm almost 2 years ago

  • Status changed from In Topic Branch Pending Review to Ready For Checkin

patch confirmed, please commit, thanks

Updated by Benedikt Böhm almost 2 years ago

ops, i missed on change you made: [(\S*)] to [(\S+)] for the part of the string. this won’t work: if you don’t have the package installed already, the pattern wouldn’t match.

fixed patch is attached

Updated by James Turnbull almost 2 years ago

  • Status changed from Ready For Checkin to Closed

Pushed in commit:8a3049591a2913c7a7a33407f742892bf27a2d34 in branch 0.25.x

Also available in: Atom PDF