Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bsd: refactor common netbsd and freebsd method up in BSD distro class
There is a lot of duplication of code that could be shared between the FreeBSD and NetBSD classes. Let's avoid as much boilerplate cut-n-paste as possible. Move the following methods up into the parent BSD class: * create_group which now uses group_add_cmd_prefix and _get_add_member_to_group_cmd to specialize subclass commands * install_packages can be generalized since NetBSD.update_package_sources is nothing * package_command is generalized with minor command diffs sourced from class attributes pkg_cmd_install_prefix and pkg_cmd_remove_prefix and custom environment given by _get_pkg_cmd_environ Also in this commit: * A bug fix in existing Freebsd which was switching group name and and username parameters * I left a TODO message for your review as I don't think either BSD class handles a distro.package_command('upgrade') call and it might be needed in a followup PR
- Loading branch information
1 parent
6d45e7c
commit 7ee08d3
Showing
3 changed files
with
94 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters