X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=makeDist;h=fc16eef86f4402e44e60e9131ae833b18072bb2a;hp=9b638fef40d2c8cd302eb72040138a66cd277b37;hb=dcb39df8e33e09eabfb4eae471c2e6447094d0e2;hpb=5b3e6091d542c2e7445d5dd511cdf6e20aec8b8d diff --git a/makeDist b/makeDist index 9b638fe..fc16eef 100755 --- a/makeDist +++ b/makeDist @@ -92,6 +92,7 @@ my @PerlSrc = qw( lib/BackupPC/CGI/RestoreFile.pm lib/BackupPC/CGI/RestoreInfo.pm lib/BackupPC/CGI/Restore.pm + lib/BackupPC/CGI/RSS.pm lib/BackupPC/CGI/StartServer.pm lib/BackupPC/CGI/StartStopBackup.pm lib/BackupPC/CGI/StopServer.pm @@ -133,11 +134,18 @@ $errCnt += CheckConfigParams("conf/config.pl", $ConfVars, 0); $errCnt += CheckConfigParams("doc-src/BackupPC.pod", $ConfVars, 1); +$errCnt += CheckMetaDataVsConfig($ConfVars, "lib/BackupPC/Config/Meta.pm"); + +$errCnt += CheckEditorVsConfig($ConfVars, "lib/BackupPC/CGI/EditConfig.pm"); + # # These config parameters are not used in the code, so ignore them. # $ConfVars->{BackupPCUser} = 2; $ConfVars->{CgiDir} = 2; +$ConfVars->{TopDir} = 2; +$ConfVars->{LogDir} = 2; +$ConfVars->{ConfDir} = 2; $ConfVars->{InstallDir} = 2; $ConfVars->{CgiImageDir} = 2; @@ -282,10 +290,12 @@ sub InstallFile print OUT "$1'__TOPDIR__'$2\n"; } elsif ( $file =~ /Lib.pm/ && /^(\s*\$installDir\s*=\s*)'.*'(\s*if\s.*)/ ) { print OUT "$1'__INSTALLDIR__'$2\n"; - } elsif ( $file =~ /Lib.pm/ && /^(\s*my \$useFHS\s*=\s*)\d;/ ) { - print OUT "${1}__USEFHS__;\n"; - } elsif ( $file =~ /Lib.pm/ && /(.*Version *=> .*)'[\w\d\.]+',/ ) { - print OUT "$1'$Version',\n"; + } elsif ( $file =~ /Lib.pm/ && /^(\s*my \$useFHS\s*=\s*)\d;/ ) { + print OUT "${1}0;\n"; + } elsif ( $file =~ /configure.pl/ && /__CONFIGURE_BIN_LIST__/ ) { + print OUT " ", join("\n ", grep(/^bin\//, @PerlSrc)), "\n"; + } elsif ( $file =~ /configure.pl/ && /__CONFIGURE_LIB_LIST__/ ) { + print OUT " ", join("\n ", grep(/^lib\//, @PerlSrc)), "\n"; } elsif ( $file =~ /BackupPC_Admin/ && /(my *\$installDir *= *)'.*'/ ) { print OUT "$1'__INSTALLDIR__/lib';\n"; } else { @@ -397,6 +407,68 @@ sub CheckConfigParams return $errors; } +sub CheckMetaDataVsConfig +{ + my($confVars, $file) = @_; + my $done = {}; + my $errors; + + # + # Check that the meta file mentions all the config + # parameters + # + open(F, $file) || die("can't open $file"); + + while ( ) { + next if ( !/^\s{4}(\w+)\s+=>/ ); + if ( $confVars->{$1} ) { + $done->{$1} = 1; + next; + } + next if ( $1 eq "Hosts" ); + print("$file has $1 but missing from conf/config.pl\n"); + $errors++; + } + close(F); + foreach my $v ( keys(%$confVars) ) { + next if ( $done->{$v} ); + print("$file missing $v from conf/config.pl\n"); + $errors++; + } + return $errors; +} + +sub CheckEditorVsConfig +{ + my($confVars, $file) = @_; + my $done = {}; + my $errors; + + # + # Check that the config editor file mentions all the config + # parameters + # + open(F, $file) || die("can't open $file"); + + while ( ) { + next if ( !/name\s*=>\s*"(\w+)"/ ); + if ( $confVars->{$1} ) { + $done->{$1} = 1; + next; + } + next if ( $1 eq "Hosts" ); + print("$file has $1 but missing from conf/config.pl\n"); + $errors++; + } + close(F); + foreach my $v ( keys(%$confVars) ) { + next if ( $done->{$v} ); + print("$file missing $v from conf/config.pl\n"); + $errors++; + } + return $errors; +} + # # Make sure that every lang variable in cgi-bin/BackupPC_Admin matches # the strings in each lib/BackupPC/Lang/*.pm file. This makes sure @@ -416,6 +488,7 @@ sub CheckLangUsage while ( ) { next if ( /^\s*#/ ); s/\$Lang->{([^}]*)}/$vars->{$1} = 1;/eg; + s/(text|comment)\s*=>\s*"(CfgEdit_.*)"/$vars->{$2} = 1;/eg; } close(F); } @@ -472,7 +545,11 @@ sub CheckLangTags my $t1 = LangTextStrip($v1->{val}); my $t2 = LangTextStrip($v2->{val}); if ( $t1 ne $t2 ) { - print("$v1->{var}: got en.pm $t1\nvs $lang $t2\n\n"); + my $i; + for ( $i = 0 ; $i < length($t1) ; $i++ ) { + last if ( substr($t1, 0, $i) ne substr($t2, 0, $i) ); + } + print("$v1->{var}: ($i) got en.pm $t1\nvs $lang $t2\n\n"); $errors++; } }