@@ -45,28 +45,27 @@ def self.instances
45
45
46
46
def self . listcmd
47
47
regex_fuzzy = /^(.*)--([\w -]+)?(%[^w]+)?$/
48
- f = [ ]
49
48
f = pkginfo ( "-a" , "-z" ) . split ( "\n " )
50
49
packages = { }
51
50
f . each do |line |
52
- match = regex_fuzzy . match ( line . split [ 0 ] )
53
- name = match . captures [ 0 ]
54
- flavor = match . captures [ 1 ]
55
- branch = match . captures [ 2 ]
56
- if branch . nil?
57
- pname = name
58
- else
59
- pname = name + branch
60
- end
61
- packages [ pname ] = { :name => pname , :flavor => flavor , :branch => branch , :ensure => "present" }
51
+ match = regex_fuzzy . match ( line . split [ 0 ] )
52
+ name = match . captures [ 0 ]
53
+ flavor = match . captures [ 1 ]
54
+ branch = match . captures [ 2 ]
55
+ if branch . nil?
56
+ pname = name
57
+ else
58
+ pname = name + branch
59
+ end
60
+ packages [ pname ] = { :name => pname , :flavor => flavor , :branch => branch , :ensure => "present" }
62
61
end
63
62
packages
64
63
end
65
64
66
65
def install
67
66
cmd = [ ]
68
67
69
- full_name = get_full_name ( action = "install" )
68
+ full_name = get_full_name ( action = "install" )
70
69
71
70
cmd << '-r'
72
71
cmd << install_options
@@ -80,7 +79,7 @@ def install
80
79
end
81
80
end
82
81
83
- def get_full_name ( action = "install" )
82
+ def get_full_name ( action = "install" )
84
83
# In case of a real update (i.e., the package already exists) then
85
84
# pkg_add(8) can handle the flavors. However, if we're actually
86
85
# installing with 'latest', we do need to handle the flavors. This is
@@ -122,14 +121,14 @@ def uninstall_options
122
121
123
122
def uninstall ( purge = false )
124
123
if purge
125
- pkgdelete "-c" , "-qq" , uninstall_options . flatten . compact , get_full_name ( action = "uninstall" )
124
+ pkgdelete "-c" , "-qq" , uninstall_options . flatten . compact , get_full_name ( action = "uninstall" )
126
125
else
127
- pkgdelete uninstall_options . flatten . compact , get_full_name ( action = "uninstall" )
126
+ pkgdelete uninstall_options . flatten . compact , get_full_name ( action = "uninstall" )
128
127
end
129
128
end
130
129
131
130
def purge
132
- uninstall ( purge = true )
131
+ uninstall ( purge = true )
133
132
end
134
133
135
134
def flavor
0 commit comments