Skip to content
Snippets Groups Projects
Commit 57d7d5ad authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Use /* */ for top-level documentation comments.

Consistently use /* */ instead of # for comments documenting classes
and definitions.

This was originally commit f757ef4195dc in nsc-puppet-utils.
parent 4acd45d9
No related branches found
No related tags found
No related merge requests found
...@@ -2,14 +2,15 @@ ...@@ -2,14 +2,15 @@
# Licensed under the GNU LGPL v3+; see the README file for more information. # Licensed under the GNU LGPL v3+; see the README file for more information.
# Comment out lines in the file $file matching the regexp $pattern. /*
# The regexp is implicitly anchored at both ends of the line. * Comment out lines in the file $file matching the regexp $pattern.
# This is only done on matching lines within sections within groups; * The regexp is implicitly anchored at both ends of the line.
# see the regexp_replace_lines type for how sections and groups work. * This is only done on matching lines within sections within groups;
# * see the regexp_replace_lines type for how sections and groups work.
# Commenting out is done by adding $comment (default "#") to the start *
# of the lines, and $comment_end to the end of the lines. * Commenting out is done by adding $comment (default "#") to the start
* of the lines, and $comment_end to the end of the lines.
*/
define comment_lines($file, $pattern=".*", $comment="#", $comment_end="", define comment_lines($file, $pattern=".*", $comment="#", $comment_end="",
$group_start="", $group_end="", $start="", $end="") $group_start="", $group_end="", $start="", $end="")
{ {
...@@ -63,15 +64,16 @@ define config_option($file, $option, $value, $ensure="present") ...@@ -63,15 +64,16 @@ define config_option($file, $option, $value, $ensure="present")
} }
# Ensure that the variable $setting is set to $value for subsystem $subsystem. /*
# If $service is set, that service is notified when the file is changed. * Ensure that the variable $setting is set to $value for subsystem $subsystem.
# * If $service is set, that service is notified when the file is changed.
# Note that if you need spaces or other shell metacharacters in $value, *
# you need to quote it yourself. * Note that if you need spaces or other shell metacharacters in $value,
# * you need to quote it yourself.
# This definition is RedHat-specific, as it does its duty by editing *
# the /etc/sysconfig/$subsystem file. * This definition is RedHat-specific, as it does its duty by editing
* the /etc/sysconfig/$subsystem file.
*/
define rh_sysconfig($subsystem, $setting, $value, $ensure="present", define rh_sysconfig($subsystem, $setting, $value, $ensure="present",
$service="") $service="")
{ {
...@@ -87,16 +89,17 @@ define rh_sysconfig($subsystem, $setting, $value, $ensure="present", ...@@ -87,16 +89,17 @@ define rh_sysconfig($subsystem, $setting, $value, $ensure="present",
# Configure settings in /etc/make.conf in Gentoo/Portage. /*
# Parameters: * Configure settings in /etc/make.conf in Gentoo/Portage.
# - $name The name of the setting, e.g. CFLAGS, FEATURES or VIDEO_CARDS * Parameters:
# - $value The value of the setting. The value will be surrounded * - $name The name of the setting, e.g. CFLAGS, FEATURES or VIDEO_CARDS
# by double quotes, but no other quoting of the value will * - $value The value of the setting. The value will be surrounded
# be done. Be careful to not have newlines in the value, * by double quotes, but no other quoting of the value will
# since portage_makeconf won't be able to handle what it * be done. Be careful to not have newlines in the value,
# will write in the file. * since portage_makeconf won't be able to handle what it
# - $ensure 'present' (default), 'absent' or 'purged' * will write in the file.
* - $ensure 'present' (default), 'absent' or 'purged'
*/
define portage_makeconf($value="", $ensure="present") define portage_makeconf($value="", $ensure="present")
{ {
config_option { config_option {
...@@ -111,7 +114,9 @@ define portage_makeconf($value="", $ensure="present") ...@@ -111,7 +114,9 @@ define portage_makeconf($value="", $ensure="present")
# Internal helper class for Gentoo/Portage. /*
* Internal helper class for Gentoo/Portage.
*/
class portage_files__ class portage_files__
{ {
file { file {
...@@ -128,24 +133,26 @@ class portage_files__ ...@@ -128,24 +133,26 @@ class portage_files__
} }
} }
# Declare Portage USE flags for packages.
# Parameters:
# - $name The package for which USE flags are set.
# The special name "GLOBAL" means set global use flags,
# i.e. set the USE variable in /etc/make.conf.
# - $use The USE flags to set. When set to the empty string,
# the entire line for the package will be removed from
# /etc/portage/package.use.
# Note: It might be tempting to add an automatic before => Package[$name],
# but that would be a mistake. Sometimes you want to set use flags for
# packages that are only installed as dependencies for other packages,
# not because you want that package for itself. Having to add that
# package to the Puppet manifests would be a nuisance, and wrong (it
# would then appear in the Portage world file).
# Instead we tag the changes with 'pkgrepo', so it will be done in
# the first run of Puppet from Make.
/*
* Declare Portage USE flags for packages.
* Parameters:
* - $name The package for which USE flags are set.
* The special name "GLOBAL" means set global use flags,
* i.e. set the USE variable in /etc/make.conf.
* - $use The USE flags to set. When set to the empty string,
* the entire line for the package will be removed from
* /etc/portage/package.use.
*
* Note: It might be tempting to add an automatic before => Package[$name],
* but that would be a mistake. Sometimes you want to set use flags for
* packages that are only installed as dependencies for other packages,
* not because you want that package for itself. Having to add that
* package to the Puppet manifests would be a nuisance, and wrong (it
* would then appear in the Portage world file).
* Instead we tag the changes with 'pkgrepo', so it will be done in
* the first run of Puppet from Make.
*/
define portage_useflags($use) define portage_useflags($use)
{ {
case $name { case $name {
...@@ -183,10 +190,11 @@ define portage_useflags($use) ...@@ -183,10 +190,11 @@ define portage_useflags($use)
# Set options for a Xinetd service. /*
# Assumes that the service definition is in a file in /etc/xinetd.d * Set options for a Xinetd service.
# with the same name as the service. * Assumes that the service definition is in a file in /etc/xinetd.d
* with the same name as the service.
*/
define xinetd_srv_option($service, $option, $value) define xinetd_srv_option($service, $option, $value)
{ {
$qopt = regexp_quote($option) $qopt = regexp_quote($option)
...@@ -206,18 +214,19 @@ define xinetd_srv_option($service, $option, $value) ...@@ -206,18 +214,19 @@ define xinetd_srv_option($service, $option, $value)
# Declare Portage keyword for packages. /*
# Parameters: * Declare Portage keyword for packages.
# - $name The package for which keyword is set. * Parameters:
# The special name "GLOBAL" means set global keyword, * - $name The package for which keyword is set.
# i.e. set the ACCEPT_KEYWORDS variable in /etc/make.conf. * The special name "GLOBAL" means set global keyword,
# - $keyword The keyword to set. When set to the empty string, * i.e. set the ACCEPT_KEYWORDS variable in /etc/make.conf.
# the entire line for the package will be removed from * - $keyword The keyword to set. When set to the empty string,
# /etc/portage/package.keywords. * the entire line for the package will be removed from
* /etc/portage/package.keywords.
# Note: Don't add a before => Package[$name]; see the note for *
# portage_useflags for further explanation. * Note: Don't add a before => Package[$name]; see the note for
* portage_useflags for further explanation.
*/
define portage_keyword($keyword) define portage_keyword($keyword)
{ {
case $name { case $name {
...@@ -255,15 +264,16 @@ define portage_keyword($keyword) ...@@ -255,15 +264,16 @@ define portage_keyword($keyword)
# Set Gentoo config options, in /etc/conf.d. /*
# Parameters: * Set Gentoo config options, in /etc/conf.d.
# - $subsystem The subsystem for which an option is defined. The option * Parameters:
# will be written to /etc/conf.d/$subsystem. * - $subsystem The subsystem for which an option is defined. The option
# - $option The name of the option to set. * will be written to /etc/conf.d/$subsystem.
# - $value The value of the option. The value will be surrounded * - $option The name of the option to set.
# by double quotes, but no other quoting will be performed. * - $value The value of the option. The value will be surrounded
# - $ensure 'present' (default), 'absent' or 'purged'. * by double quotes, but no other quoting will be performed.
* - $ensure 'present' (default), 'absent' or 'purged'.
*/
define gentoo_conf($subsystem, $option, $value, $ensure="present") define gentoo_conf($subsystem, $option, $value, $ensure="present")
{ {
config_option { config_option {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment