Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
e3a39837
Commit
e3a39837
authored
Feb 19, 2014
by
Daniel Jaouen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add back homebrew `install_options` parameter.
parent
155f6e4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
28 deletions
+53
-28
library/packaging/homebrew
+53
-28
No files found.
library/packaging/homebrew
View file @
e3a39837
...
@@ -284,10 +284,13 @@ class Homebrew(object):
...
@@ -284,10 +284,13 @@ class Homebrew(object):
# /class properties -------------------------------------------- }}}
# /class properties -------------------------------------------- }}}
def
__init__
(
self
,
module
,
path
=
None
,
packages
=
None
,
state
=
None
,
def
__init__
(
self
,
module
,
path
=
None
,
packages
=
None
,
state
=
None
,
update_homebrew
=
False
,
)
:
update_homebrew
=
False
,
install_options
=
None
)
:
if
not
install_options
:
install_options
=
list
()
self
.
_setup_status_vars
()
self
.
_setup_status_vars
()
self
.
_setup_instance_vars
(
module
=
module
,
path
=
path
,
packages
=
packages
,
self
.
_setup_instance_vars
(
module
=
module
,
path
=
path
,
packages
=
packages
,
state
=
state
,
update_homebrew
=
update_homebrew
,
)
state
=
state
,
update_homebrew
=
update_homebrew
,
install_options
=
install_options
,
)
self
.
_prep
()
self
.
_prep
()
...
@@ -473,10 +476,12 @@ class Homebrew(object):
...
@@ -473,10 +476,12 @@ class Homebrew(object):
else
:
else
:
head
=
None
head
=
None
cmd
=
[
opt
opts
=
(
for
opt
in
(
self
.
brew_path
,
'
install
'
,
self
.
current_package
,
head
)
[
self
.
brew_path
,
'
install
'
]
if
opt
]
+
self
.
install_options
+
[
self
.
current_package
,
head
]
)
cmd
=
[
opt
for
opt
in
opts
if
opt
]
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
if
self
.
_current_package_is_installed
()
:
if
self
.
_current_package_is_installed
()
:
...
@@ -523,11 +528,13 @@ class Homebrew(object):
...
@@ -523,11 +528,13 @@ class Homebrew(object):
)
)
raise
HomebrewException
(
self
.
message
)
raise
HomebrewException
(
self
.
message
)
rc
,
out
,
err
=
self
.
module
.
run_command
([
opts
=
(
self
.
brew_path
,
[
self
.
brew_path
,
command
]
command
,
+
self
.
install_options
self
.
current_package
,
+
[
self
.
current_package
]
])
)
cmd
=
[
opt
for
opt
in
opts
if
opt
]
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
if
not
self
.
_current_package_is_outdated
()
:
if
not
self
.
_current_package_is_outdated
()
:
self
.
changed_count
+=
1
self
.
changed_count
+=
1
...
@@ -540,10 +547,13 @@ class Homebrew(object):
...
@@ -540,10 +547,13 @@ class Homebrew(object):
raise
HomebrewException
(
self
.
message
)
raise
HomebrewException
(
self
.
message
)
def
_upgrade_all_packages
(
self
)
:
def
_upgrade_all_packages
(
self
)
:
rc
,
out
,
err
=
self
.
module
.
run_command
([
opts
=
(
self
.
brew_path
,
[
self
.
brew_path
,
'
upgrade
'
]
'
upgrade
'
,
+
self
.
install_options
])
)
cmd
=
[
opt
for
opt
in
opts
if
opt
]
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
if
rc
==
0
:
if
rc
==
0
:
self
.
changed
=
True
self
.
changed
=
True
self
.
message
=
'
All
packages
upgraded
.
'
self
.
message
=
'
All
packages
upgraded
.
'
...
@@ -584,10 +594,12 @@ class Homebrew(object):
...
@@ -584,10 +594,12 @@ class Homebrew(object):
)
)
raise
HomebrewException
(
self
.
message
)
raise
HomebrewException
(
self
.
message
)
cmd
=
[
opt
opts
=
(
for
opt
in
(
self
.
brew_path
,
'
uninstall
'
,
self
.
current_package
)
[
self
.
brew_path
,
'
uninstall
'
]
if
opt
]
+
self
.
install_options
+
[
self
.
current_package
]
)
cmd
=
[
opt
for
opt
in
opts
if
opt
]
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
if
not
self
.
_current_package_is_installed
()
:
if
not
self
.
_current_package_is_installed
()
:
...
@@ -627,10 +639,12 @@ class Homebrew(object):
...
@@ -627,10 +639,12 @@ class Homebrew(object):
)
)
raise
HomebrewException
(
self
.
message
)
raise
HomebrewException
(
self
.
message
)
cmd
=
[
opt
opts
=
(
for
opt
in
(
self
.
brew_path
,
'
link
'
,
self
.
current_package
)
[
self
.
brew_path
,
'
link
'
]
if
opt
]
+
self
.
install_options
+
[
self
.
current_package
]
)
cmd
=
[
opt
for
opt
in
opts
if
opt
]
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
if
rc
==
0
:
if
rc
==
0
:
...
@@ -671,10 +685,12 @@ class Homebrew(object):
...
@@ -671,10 +685,12 @@ class Homebrew(object):
)
)
raise
HomebrewException
(
self
.
message
)
raise
HomebrewException
(
self
.
message
)
cmd
=
[
opt
opts
=
(
for
opt
in
(
self
.
brew_path
,
'
unlink
'
,
self
.
current_package
)
[
self
.
brew_path
,
'
unlink
'
]
if
opt
]
+
self
.
install_options
+
[
self
.
current_package
]
)
cmd
=
[
opt
for
opt
in
opts
if
opt
]
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
rc
,
out
,
err
=
self
.
module
.
run_command
(
cmd
)
if
rc
==
0
:
if
rc
==
0
:
...
@@ -717,6 +733,11 @@ def main():
...
@@ -717,6 +733,11 @@ def main():
aliases
=
[
"update-brew"
],
aliases
=
[
"update-brew"
],
type
=
'
bool
'
,
type
=
'
bool
'
,
),
),
install_options
=
dict
(
default
=
None
,
aliases
=
[
'
options
'
],
type
=
'
list
'
,
)
),
),
supports_check_mode
=
True
,
supports_check_mode
=
True
,
)
)
...
@@ -746,9 +767,13 @@ def main():
...
@@ -746,9 +767,13 @@ def main():
state
=
'
absent
'
state
=
'
absent
'
update_homebrew
=
p
[
'
update_homebrew
'
]
update_homebrew
=
p
[
'
update_homebrew
'
]
p
[
'
install_options
'
]
=
p
[
'
install_options
'
]
or
[]
install_options
=
[
'
--
{
0
}
'
.
format
(
install_option
)
for
install_option
in
p
[
'
install_options
'
]]
brew
=
Homebrew
(
module
=
module
,
path
=
path
,
packages
=
packages
,
brew
=
Homebrew
(
module
=
module
,
path
=
path
,
packages
=
packages
,
state
=
state
,
update_homebrew
=
update_homebrew
)
state
=
state
,
update_homebrew
=
update_homebrew
,
install_options
=
install_options
)
(
failed
,
changed
,
message
)
=
brew
.
run
()
(
failed
,
changed
,
message
)
=
brew
.
run
()
if
failed
:
if
failed
:
module
.
fail_json
(
msg
=
message
)
module
.
fail_json
(
msg
=
message
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment