Revert "Merge pull request #4912 from zehome/openbsd_pkg_flavourfix"

This reverts commit de2f4cf04d, reversing
changes made to 2c33737bfa.
This commit is contained in:
James Tanner 2013-11-18 00:15:33 -05:00
parent b7971a426c
commit 99dfa1afec
2 changed files with 0 additions and 14 deletions

View file

@ -63,7 +63,6 @@ Misc changes:
* Fixes for IPv6 addresses in inventory text files * Fixes for IPv6 addresses in inventory text files
* name of executable can be passed to pip/gem etc, for installing under *different* interpreters * name of executable can be passed to pip/gem etc, for installing under *different* interpreters
* copy of ./hacking/env-setup added for fish users, ./hacking/env-setup.fish * copy of ./hacking/env-setup added for fish users, ./hacking/env-setup.fish
* openbsd_pkg can handle "flavoured" packages like vim--no_x11
1.3.4 "Top of the World" (reprise) - October 29, 2013 1.3.4 "Top of the World" (reprise) - October 29, 2013

View file

@ -52,9 +52,6 @@ EXAMPLES = '''
# Make sure nmap is not installed # Make sure nmap is not installed
- openbsd_pkg: name=nmap state=absent - openbsd_pkg: name=nmap state=absent
# Make sure vim is installed using no_x11 flavour
- openbsd_pkg name=vim--no_x11 state=present
''' '''
# Function used for executing commands. # Function used for executing commands.
@ -84,23 +81,13 @@ def get_current_name(name, specific_version, module):
return current_name return current_name
# Function used to find out if a package is currently installed. # Function used to find out if a package is currently installed.
# OpenBSD packages can contain "flavours"
# For example vim is distributed as a "gtk2":
# - vim--gtk2
# and "no_x11" flavour:
# - vim--no_x11
def get_package_state(name, specific_version, module): def get_package_state(name, specific_version, module):
info_cmd = 'pkg_info -e' info_cmd = 'pkg_info -e'
if specific_version: if specific_version:
syntax = "%s %s" syntax = "%s %s"
else: else:
if "--" in name:
(name, flavour) = name.split("--", 1)
syntax = "%s %s-*" syntax = "%s %s-*"
if flavour:
syntax += "-%s" % (flavour, )
syntax = "%s-"
rc, stdout, stderr = execute_command(syntax % (info_cmd, name), module) rc, stdout, stderr = execute_command(syntax % (info_cmd, name), module)