Skip to content

(PUP-9975) Fix dpkg provider parsing of virtual packages#7683

Closed
treydock wants to merge 1 commit intopuppetlabs:masterfrom
treydock:PUP-9975
Closed

(PUP-9975) Fix dpkg provider parsing of virtual packages#7683
treydock wants to merge 1 commit intopuppetlabs:masterfrom
treydock:PUP-9975

Conversation

@treydock
Copy link
Contributor

No description provided.

@treydock treydock requested a review from a team August 24, 2019 20:06
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@treydock
Copy link
Contributor Author

Old:

irb(main):002:0> lines = ["install ok installed binutils 2.30-21ubuntu1~18.04.2 [binutils-gold, elf-binutils]"]
=> ["install ok installed binutils 2.30-21ubuntu1~18.04.2 [binutils-gold, elf-binutils]"]
irb(main):005:0> name = "g++"
=> "g++"
irb(main):006:0> lines.find {|package| package.match(/\[.*#{name}.*\]/)}
=> "install ok installed binutils 2.30-21ubuntu1~18.04.2 [binutils-gold, elf-binutils]"

NEW

irb(main):012:0> lines.find {|package| package.match(/\[.*#{Regexp.escape(name)}.*\]/)}
=> nil
irb(main):013:0> name = "binutils-gold"
=> "binutils-gold"
irb(main):014:0> lines.find {|package| package.match(/\[.*#{Regexp.escape(name)}.*\]/)}
=> "install ok installed binutils 2.30-21ubuntu1~18.04.2 [binutils-gold, elf-binutils]"

@puppetcla
Copy link

CLA signed by all contributors.

@jtappa
Copy link
Contributor

jtappa commented Sep 9, 2019

ping @loopinu this seems related to something you have a PR up for?

@joshcooper
Copy link
Contributor

Thank you for your contribution @treydock! We ended up reverting the dpkg virtual package change and releasing the fix in 6.8.1, so it is no longer necessary to escape the regex. I'm going to close this PR.

We are working on readding dpkg/apt virtual package support, but it will be strictly opt-in, so that 6.x users are not surprised. Please follow our progress in #7701 and give feedback there. It looks like that PR correctly handles regex escaping, such as g++, but it would be great if you could give it a try.

Thanks again!

@joshcooper joshcooper closed this Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants