lib/perl5/Isconf.pm - help for a linux environment
"Stephen Schaefer" <[email protected]>
| Newsgroups | gmane.comp.sysutils.isconf.devel |
|---|---|
| Message-ID | <B00734715569184EA5B7A81C826CB17B02B59413@mail3> |
These changes began with version 1.3 of lib/perl5/Isconf.pm; in
particular, if you were to apply them, they would reverse the adoption
of the new parsing routines that went from the ->{ary} to the ->{hash}
components, so
D O N O T A P P L Y T H E P A T C H V E R B A T I M !
What these changes do contribute is:
1. Don't throw away environment variables that just happen to contain
the string IFS; only do that for /^IFS=/.
2. Don't try to set the SHELLOPTS environment variable; it makes bash
complain and exit.
3. Don't throw away environment variables that are set to an empty list.
4. If we're running on linux, tell linux to use the System V checksum
algorithm.
Hope this helps,
- Stephen
*** Isconf.pm 2003-10-16 00:09:24.000000000 -0400
--- Isconf.pm-new 2003-10-21 17:31:24.000000000 -0400
***************
*** 20,26 ****
);
# this lets cvs manage our version number
! $VERSION = sprintf("%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/);
########################################################################
############
# Isconf::File::Target::assert
--- 20,26 ----
);
# this lets cvs manage our version number
! $VERSION = sprintf("%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/);
########################################################################
############
# Isconf::File::Target::assert
***************
*** 69,75 ****
}
else
{
! #print "Setting context to 'NULL'\n";
$ENV{'CONTEXT'} = $::CONTEXT = 'NULL';
}
--- 69,75 ----
}
else
{
! print "Setting context to 'NULL'\n";
$ENV{'CONTEXT'} = $::CONTEXT = 'NULL';
}
***************
*** 80,89 ****
foreach (split /\n/, $env)
{
! /IFS/ and next; # we know we don't need to import IFS,
and it's got a carriage return
($var,$value) = split /=/ or next;
unless ($value) { next; }
! $value =~ /\(\)/ and last; # we don't want function
definitions
$value =~ s/^['"]//;
$value =~ s/['"]$//;
debug("$var is [$value]");
--- 80,91 ----
foreach (split /\n/, $env)
{
! /^IFS=/ and next; # we know we don't need to import IFS,
and it's got a carriage return
! /^SHELLOPTS=/ and next; # bash won't let us touch this
($var,$value) = split /=/ or next;
unless ($value) { next; }
! $value =~ /.\(\)/ and last; # we don't want function
definitions
! # BUT! don't confuse with
empty list
$value =~ s/^['"]//;
$value =~ s/['"]$//;
debug("$var is [$value]");
***************
*** 212,221 ****
{
$obj->debug(6,"$list: returning all $list");
#return keys %{ $obj->{$list} };
! if (exists $obj->{$list}->{'hash'})
{
my @return;
! foreach (values %{ $obj->{$list}->{'hash'} } )
{
push @return, $_->name();
}
--- 214,223 ----
{
$obj->debug(6,"$list: returning all $list");
#return keys %{ $obj->{$list} };
! if (exists $obj->{$list}->{'ary'})
{
my @return;
! foreach (@{ $obj->{$list}->{'ary'} } )
{
push @return, $_->name();
}
***************
*** 255,261 ****
error("File $file does not have a sum set."), return;
}
! $nsum = qx(cat $file | grep -v '^#' | sum | awk '{print \$1'});
chomp $nsum;
unless ($nsum)
{
--- 257,264 ----
error("File $file does not have a sum set."), return;
}
! $sysv_flag = (defined $ENV{'IS_OS'} && $ENV{'IS_OS'} eq 'linux')
? " -s " : "";
! $nsum = qx(cat $file | grep -v '^#' | sum $sysv_flag | awk
'{print \$1'});
chomp $nsum;
unless ($nsum)
{
***************
*** 336,342 ****
=for html <hr>
! I<$Id: Isconf.pm,v 1.5 2003/10/16 04:09:24 loosifer Exp $>
=cut
1;
--- 339,345 ----
=for html <hr>
! I<$Id: Isconf.pm,v 1.7 2003/02/18 17:47:56 sps Exp $>
=cut
1;
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54