File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
lib/puppet/provider/package
spec/unit/provider/package Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -101,9 +101,12 @@ def self.instances(target_command = nil)
101
101
102
102
# Parse lines of output from `pip freeze`, which are structured as:
103
103
# _package_==_version_ or _package_===_version_
104
+ # or _package_ @ someURL@_version_
104
105
def self . parse ( line )
105
106
if line . chomp =~ /^([^=]+)===?([^=]+)$/
106
107
{ :ensure => Regexp . last_match ( 2 ) , :name => Regexp . last_match ( 1 ) , :provider => name }
108
+ elsif line . chomp =~ /^([^@]+) @ [^@]+@(.+)$/
109
+ { :ensure => Regexp . last_match ( 2 ) , :name => Regexp . last_match ( 1 ) , :provider => name }
107
110
end
108
111
end
109
112
Original file line number Diff line number Diff line change 38
38
} )
39
39
end
40
40
41
+ it "should correctly parse URL format" do
42
+ expect ( described_class . parse ( "real_package @ git+https://github.com/example/test.git@6b4e203b66c1de7345984882e2b13bf87c700095" ) ) . to eq ( {
43
+ :ensure => "6b4e203b66c1de7345984882e2b13bf87c700095" ,
44
+ :name => "real_package" ,
45
+ :provider => :pip ,
46
+ } )
47
+ end
48
+
41
49
it "should return nil on invalid input" do
42
50
expect ( described_class . parse ( "foo" ) ) . to eq ( nil )
43
51
end
You can’t perform that action at this time.
0 commit comments