Unverified Commit 58b8c638 authored by Robin H. Johnson's avatar Robin H. Johnson
Browse files

package: Validate emerge_command for future error handling.


Signed-off-by: default avatarRobin H. Johnson <robbat2@gentoo.org>
parent c63cb1cb
...@@ -125,9 +125,10 @@ define portage::package ( ...@@ -125,9 +125,10 @@ define portage::package (
$unmask_target = undef, $unmask_target = undef,
$emerge_command = undef, $emerge_command = undef,
) { ) {
include ::portage::params include ::portage::params
$_emerge_command = pick($emerge_command, $portage::emerge_command, $portage::params::emerge_command) $_emerge_command = pick($emerge_command, $portage::emerge_command, $portage::params::emerge_command)
validate_re($_emerge_command, '^/', 'emerge_command must start with an absolute path')
$atom = $ensure ? { $atom = $ensure ? {
/(present|absent|purged|held|installed|latest)/ => $name, /(present|absent|purged|held|installed|latest)/ => $name,
...@@ -286,14 +287,11 @@ define portage::package ( ...@@ -286,14 +287,11 @@ define portage::package (
false => "${_emerge_command} --changed-use -u1 ${atom}", false => "${_emerge_command} --changed-use -u1 ${atom}",
default => '/bin/false Should-Not-Trigger', # This should not happen. default => '/bin/false Should-Not-Trigger', # This should not happen.
} }
notify { "rebuild_${atom}_msg":
message => "rebuild_command=${rebuild_command}",
withpath => true,
}
exec { "rebuild_${atom}": exec { "rebuild_${atom}":
command => $rebuild_command, command => $rebuild_command,
refreshonly => true, refreshonly => true,
timeout => 43200, timeout => 43200,
# Emerge inherits the path, so it must be valid.
path => ['/usr/local/sbin','/usr/local/bin', path => ['/usr/local/sbin','/usr/local/bin',
'/usr/sbin','/usr/bin','/sbin','/bin'], '/usr/sbin','/usr/bin','/sbin','/bin'],
} }
......
{ {
"name": "gentoo-portage", "name": "gentoo-portage",
"version": "2.4.4", "version": "2.4.5",
"author": "Gentoo", "author": "Gentoo",
"summary": "Puppet types and providers for Gentoo portage", "summary": "Puppet types and providers for Gentoo portage",
"license": "GPL-2.0", "license": "GPL-2.0",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment