Index: ossp-pkg/shiela/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/shiela/ChangeLog,v rcsdiff -q -kk '-r1.32' '-r1.33' -u '/v/ossp/cvs/ossp-pkg/shiela/ChangeLog,v' 2>/dev/null --- ChangeLog 2002/12/23 12:13:27 1.32 +++ ChangeLog 2002/12/23 14:08:38 1.33 @@ -9,6 +9,17 @@ ChangeLog + Changes between 1.0.3 and 1.0.4 (23-Dec-2002 to 23-Dec-2002): + + *) Added "Setenv " configuration command to + "Environment" configuration section which allows one to set + environment variables like PATH, etc. This especially allows now + non-absolute paths on "Program" configuration commands. + [Ralf S. Engelschall] + + *) Fixed indentation on "Content files" report part. + [Ralf S. Engelschall] + Changes between 1.0.2 and 1.0.3 (23-Dec-2002 to 23-Dec-2002): *) CVS since 1.11.2 allows verifymsg-hooked scripts to actually Index: ossp-pkg/shiela/shiela.pl RCS File: /v/ossp/cvs/ossp-pkg/shiela/shiela.pl,v rcsdiff -q -kk '-r1.45' '-r1.46' -u '/v/ossp/cvs/ossp-pkg/shiela/shiela.pl,v' 2>/dev/null --- shiela.pl 2002/12/23 13:10:56 1.45 +++ shiela.pl 2002/12/23 14:08:38 1.46 @@ -54,6 +54,7 @@ $|++; umask(002); delete $ENV{TZ}; +$ENV{PATH} = "/bin:/usr/bin:/sbin:/usr/sbin"; # Generic program error handler $SIG{__DIE__} = sub { @@ -98,7 +99,7 @@ $rv = &hook_loginfo($PA, $RT, $CF); } else { - die "unknown hook (use --hook option)"; + die "unknown processing stage (use --hook option)"; } exit($rv); @@ -163,11 +164,16 @@ } $RT->{usergroups} = join(',', @G); + # optionally set environment variables (like PATH) + foreach my $var (keys(%{$CF->{Environment}->{Setenv}})) { + $ENV{PATH} = $CF->{Environment}->{Setenv}->{$var}; + } + # determine various program paths sub find_program { my ($name) = @_; my ($prog) = ''; - foreach my $dir (split(/:/, "$ENV{PATH}:/bin:/usr/bin:/sbin:/usr/sbin")) { + foreach my $dir (split(/:/, $ENV{PATH})) { if (-x "$dir/$name") { $prog = "$dir/$name"; last; @@ -393,7 +399,8 @@ 'Report' => {} }, 'Environment' => { - 'Program' => {} + 'Program' => {}, + 'Setenv' => {} } }; my $cf = &parse_config($t, \&parse_config_callback, $CF); @@ -452,6 +459,9 @@ elsif ($action eq 'CMD' and $cf->[0] eq 'Program') { $CF->{Environment}->{Program}->{$cf->[1]} = $cf->[2]; } + elsif ($action eq 'CMD' and $cf->[0] eq 'Setenv') { + $CF->{Environment}->{Setenv}->{$cf->[1]} = $cf->[2]; + } return $cf; } return $CF; @@ -2148,10 +2158,10 @@ my $branch; foreach $branch (sort(keys(%{$list}))) { if ($branch eq 'HEAD') { - $O .= $prefix."$header:\n"; + $O .= sprintf("%s%s\n", $prefix, "$header:"); } else { - $O .= $prefix.sprintf("%-25s %s\n", "$header:", "(Branch: $branch)"); + $O .= sprintf("%s%-25s %s\n", $prefix, "$header:", "(Branch: $branch)"); } $O .= &format_branch($prefix, $header, $branch, $list->{$branch}); } @@ -2173,27 +2183,28 @@ my $first = 1; my $col = 0; foreach $file (sort(@{$list})) { - if ($col+length($file)+1 > 78) { + if (($col + 1 + length($file)) > 78) { $O .= "\n"; $col = 0; } if ($col == 0) { if ($first) { - if (length($dir) > 25) { - $O .= $prefix.sprintf("%s\n$prefix%-25s", " $dir", ""); + if ((2+length($dir)) > 25) { + $O .= sprintf("%s%s\n", $prefix, " " . $dir); + $O .= sprintf("%s%-25s", $prefix, ""); } else { - $O .= $prefix.sprintf("%-25s", " $dir"); + $O .= sprintf("%s%-25s", $prefix, " " . $dir); } $first = 0; } else { - $O .= $prefix.sprintf("%-25s", ""); + $O .= sprintf("%s%-25s", $prefix, ""); } - $col += length($prefix)+25; + $col += length($prefix) + 25; } - $O .= " $file"; - $col += length($file)+1; + $O .= " " . $file; + $col += 1 + length($file); } $O .= "\n" if ($O !~ m|\n$|s); return $O; Index: ossp-pkg/shiela/shiela.pod RCS File: /v/ossp/cvs/ossp-pkg/shiela/shiela.pod,v rcsdiff -q -kk '-r1.18' '-r1.19' -u '/v/ossp/cvs/ossp-pkg/shiela/shiela.pod,v' 2>/dev/null --- shiela.pod 2002/12/23 13:10:56 1.18 +++ shiela.pod 2002/12/23 14:08:38 1.19 @@ -88,6 +88,7 @@ structure: Environment { + [Setenv ; [...]] [Program sendmail ;] [Program cvs ;] [Program diff ;] @@ -99,6 +100,13 @@ =over 4 +=item BvariableE EvalueE;> + +This sets (and overrides) a environment variable with a particular +value. A common use is to set the environment variable C, so the +path arguments on B configuration lines can be non-absolute +paths. + =item BpathE;> This overrides the path to the F executable. Per default @@ -408,6 +416,7 @@ # override the run-time environment Environment { + Setenv PATH /bin:/usr/bin:/sbin:/usr/sbin; Program sendmail /e/foo/sw/bin/sendmail; Program cvs /e/foo/sw/bin/cvs; Program diff /e/foo/sw/bin/diff;