--- db/prgsrc/updatedb.pl 2003/01/08 23:36:38 1.30 +++ db/prgsrc/updatedb.pl 2003/01/09 19:53:23 1.33 @@ -28,7 +28,7 @@ The database, user and password are hard Dmitry Rubinstein -=head1 $Id: updatedb.pl,v 1.30 2003/01/08 23:36:38 roma7 Exp $ +=head1 $Id: updatedb.pl,v 1.33 2003/01/09 19:53:23 roma7 Exp $ =cut @@ -38,7 +38,7 @@ use Getopt::Std; getopts('i'); #open STDERR, ">errors"; my $Interactive=$opt_i || 0; - +my $DUMPDIR = $ENV{DUMPDIR} || "../dump"; my (%RevMonths) = ('Jan', '1', 'Feb', '2', 'Mar', '3', 'Apr', '4', 'May', '5', 'Jun', '6', @@ -144,7 +144,11 @@ sub SelectGroup { # Теперь, если файла нет в дереве турниров, никаких вопросов не # задаётся, а вместо этого он добавляется в группу 9999 $ParentId = 9999; - print UNSORTED "$source".((12 -length($source))x' ')."\t$TourName\n"; + my $tempsource=$source; + my $temptname=$TourName; + $tempsource=~s/^\'(.*)\'$/$1/; + $temptname=~s/^\'(.*)\'$/$1/; + print UNSORTED "$tempsource".((12 -length($source))x' ')."\t$temptname\n"; $isunsorted=1; $sth = $dbh->prepare("INSERT INTO Tournaments (Title, Type, ParentId, FileName) @@ -269,7 +273,7 @@ MAIN: my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") or die "Can't connect to DB chgk\n"; my @sources; - open UNSORTED, ">unsorted"; + open UNSORTED, ">$DUMPDIR/unsorted"; while ($source = shift) { push @sources,glob($source); }