File tree Expand file tree Collapse file tree
lib/puppet/provider/package
fixtures/unit/provider/package/openbsd Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 These options should be specified as an array where each element is either a
1616 string or a hash."
1717
18- commands :pkgadd => "pkg_add " ,
19- :pkginfo => "pkg_info " ,
18+ commands :pkginfo => "pkg_info " ,
19+ :pkgadd => "pkg_add " ,
2020 :pkgdelete => "pkg_delete"
2121
2222 defaultfor 'os.name' => :openbsd
@@ -38,7 +38,7 @@ def self.instances
3838
3939 # now turn each returned line into a package object
4040 process . each_line { |line |
41- match = regex . match ( line . split ( " \n " ) [ 0 ] )
41+ match = regex . match ( line . split [ 0 ] )
4242 if match
4343 fields . zip ( match . captures ) { |field , value |
4444 hash [ field ] = value
@@ -88,9 +88,9 @@ def install
8888
8989 def get_full_name
9090 # In case of a real update (i.e., the package already exists) then
91- # pkg_add(8 ) can handle the flavors. However, if we're actually
91+ # pkg_add(1 ) can handle the flavors. However, if we're actually
9292 # installing with 'latest', we do need to handle the flavors. This is
93- # done so we can feed pkg_add(8 ) the full package name to install to
93+ # done so we can feed pkg_add(1 ) the full package name to install to
9494 # prevent ambiguity.
9595
9696 name_branch_regex = /^(\S *)(%\w *)$/
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ autoconf--%2.13
22autoconf--%2.56
33bash--
44postfix--ldap%stable
5- puppet --%8
5+ openvox --%8
66zstd--
Original file line number Diff line number Diff line change 3838 fixture = File . read ( my_fixture ( 'pkginfo.list' ) )
3939 expect ( described_class ) . to receive ( :execpipe ) . with ( %w{ /bin/pkg_info -a -z } ) . and_yield ( fixture )
4040 expect ( described_class . instances . map ( &:name ) . sort ) . to eq (
41- %w{ autoconf%2.13 autoconf%2.56 bash postfix%stable puppet %8 zstd } . sort
41+ %w{ autoconf%2.13 autoconf%2.56 bash postfix%stable openvox %8 zstd } . sort
4242 )
4343 end
4444
5252 expect ( instances [ 1 ] ) . to eq ( { :name => 'autoconf%2.56' , :flavor => :absent , :branch => '%2.56' } )
5353 expect ( instances [ 2 ] ) . to eq ( { :name => 'bash' , :flavor => :absent , :branch => :absent } )
5454 expect ( instances [ 3 ] ) . to eq ( { :name => 'postfix%stable' , :flavor => 'ldap' , :branch => '%stable' } )
55- expect ( instances [ 4 ] ) . to eq ( { :name => 'puppet %8' , :flavor => :absent , :branch => '%8' } )
55+ expect ( instances [ 4 ] ) . to eq ( { :name => 'openvox %8' , :flavor => :absent , :branch => '%8' } )
5656 expect ( instances [ 5 ] ) . to eq ( { :name => 'zstd' , :flavor => :absent , :branch => :absent } )
5757 end
5858 end
7878 end
7979
8080 it "should return the full unversioned package name when installing without a flavor" do
81- provider . resource [ :name ] = 'puppet '
82- expect ( provider . get_full_name ) . to eq ( 'puppet --' )
81+ provider . resource [ :name ] = 'openvox '
82+ expect ( provider . get_full_name ) . to eq ( 'openvox --' )
8383 end
8484
8585 it "should return unversioned package name when installing without flavor or branch" do
You can’t perform that action at this time.
0 commit comments