I made some changes to the libraries. If you compare against the last official
version, that's fine.
During some last version(s) I used the interpreter function for lines in the
configuration file for reading the info file also. This is fine because it's
much
more powerful than the old (simple) stuff. But unfortunately, I did not
consider that it's able to replace environment variables when it detects a $
sign (like described in the config file comments). I now added a flag to switch
off this behaviour.
I also added the path/name of the info file for better error messages.
Am Montag, 31. August 2009 16:16:13 schrieb Francesco Potorti`:
> >this seems to work for me. Can you please double-check?
>
> Indeed, it works with the version you sent me. For some reason,
> Debian's libraries are different. Here is a diff:
>
>
> ===File /tmp/diff===========================================
> tucano:~# for f in /tmp/storeBackup/lib/*; do diff -u $f
> /usr/share/storebackup/lib/$(basename $f); done ---
> /tmp/storeBackup/lib/checkParam2.pl 2009-08-29 16:24:48.000000000 +0200 +++
> /usr/share/storebackup/lib/checkParam2.pl 2009-07-18 20:09:30.000000000
> +0200 @@ -427,9 +427,6 @@
> {
> my $l = shift;
> my $errorPart = shift; # where this happens, 'in file at ...'
> - my $doNotReplaceEnvVar = shift; # 1 or undef
> -
> - $doNotReplaceEnvVar = 0 unless defined $doNotReplaceEnvVar;
>
> # masking of special characters
> my $dollar = "\001"; # mask for \$
> @@ -456,9 +453,7 @@
> #print "dQuote = $dQuote\n";
> if ($sQuote == -1 and $dQuote == -1) # no quotes
> {
> - push @l, replaceEnvironmentVars($doNotReplaceEnvVar,
> - $errorPart,
> - split(/\s+/, $l));
> + push @l, replaceEnvironmentVars(split(/\s+/, $l));
> $l = '';
> }
> elsif ($dQuote == -1 or
> @@ -467,9 +462,7 @@
> #print "-1- <$l>\n";
> if ($l =~ /\A(.*?)\'(.*?)\'(.*)\Z/)
> {
> - push @l, replaceEnvironmentVars($doNotReplaceEnvVar,
> - $errorPart,
> - split(/\s+/, $1));
> + push @l, replaceEnvironmentVars(split(/\s+/, $1));
> push @l, $2;
> $l = $3;
> #print "\t<", join('> <', @l), "> + <$l>\n";
> @@ -484,11 +477,8 @@
> #print "-2- <$l>\n";
> if ($l =~ /\A(.*?)\"(.*?)\"(.*)\Z/)
> {
> - push @l, replaceEnvironmentVars($doNotReplaceEnvVar,
> - $errorPart,
> - split(/\s+/, $1));
> - push @l, replaceEnvironmentVars($doNotReplaceEnvVar,
> - $errorPart, $2);
> + push @l, replaceEnvironmentVars(split(/\s+/, $1));
> + push @l, replaceEnvironmentVars($2);
> #print "\t<", join('> <', @l), "> + <$l>\n";
> $l = $3;
> }
> @@ -516,9 +506,7 @@
> ########################################
> sub replaceEnvironmentVars
> {
> - my ($doNotReplaceEnvVar, $errorPart, @lines) = @_;
> -
> - return (@lines) if $doNotReplaceEnvVar;
> + my (@lines) = @_;
>
> my (@newLines);
> my $l;
> @@ -546,7 +534,7 @@
> }
>
> die "environment variable \$$env not set\n",
> - "please set \$$env before calling this program $errorPart"
> + "please set \$$env before calling this program"
> unless $ENV{$env};
>
> $l =~ s/\$\{?$env\}?/$ENV{$env}/;
> --- /tmp/storeBackup/lib/storeBackupLib.pl 2009-08-29 16:24:48.000000000
> +0200 +++ /usr/share/storebackup/lib/storeBackupLib.pl 2009-07-18
> 20:09:30.000000000 +0200 @@ -2173,12 +2173,12 @@
> $val =~ s/\\0A/\n/og; # '\n' wiederherstellen
> $val =~ s/\\5C/\\/og; # '\\' wiederherstellen
>
> - my (@val) = # do not replace environment vars
> - (@{ConfigFile::splitQuotedLine($val, "at $checkSumFile.info", 1)});
> + my (@val) =
> + (@{ConfigFile::splitQuotedLine($val, "at $checkSumFile.info")});
>
> $metaField{$key} = \...@val;
> $meta{$key} = $val[0];
> - push @meta, $key; # für die Reihenfolge
> + push @meta, $val[0]; # für die Reihenfolge
> }
> close(FILE);
> unless ($meta{'version'})
> ============================================================
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]