=================================================================== RCS file: /cvs/wpscripts/ztransfer/fetch.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- wpscripts/ztransfer/fetch.pm 2011/07/22 07:34:56 1.4 +++ wpscripts/ztransfer/fetch.pm 2011/07/22 07:43:56 1.5 @@ -1,10 +1,10 @@ #!/usr/bin/perl -# $Id: fetch.pm,v 1.4 2011/07/22 07:34:56 yason Exp $ +# $Id: fetch.pm,v 1.5 2011/07/22 07:43:56 yason Exp $ package fetch; use db; use log; # bad! only for log::filelist() use warnings; -my $EXPAND_SYMLINKS = 1; +#my $EXPAND_SYMLINKS = 1; my $QUERY_Z = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=0"; my $QUERY_P = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=1"; @@ -46,14 +46,14 @@ # Returning of array with bad element is deprecated, # So this code too weak to work correctly. # - if($EXPAND_SYMLINKS && -e $dbpaths[$i]) - { - chomp( $_ = `dirname $dbpaths[$i] | xargs /usr/bin/readlink` ); - chomp( $dbpaths[$i] = $_ . '/' . `basename $dbpaths[$i]` ); - - # increment $i ONLY if local file exists, otherwise replace element in next iteration - $i++; - } +# if($EXPAND_SYMLINKS && -e $dbpaths[$i]) +# { +# chomp( $_ = `dirname $dbpaths[$i] | xargs /usr/bin/readlink` ); +# chomp( $dbpaths[$i] = $_ . '/' . `basename $dbpaths[$i]` ); +# +# # increment $i ONLY if local file exists, otherwise replace element in next iteration +# $i++; +# } # if localfile does not exists, write result of next iteration on its place } else @@ -102,15 +102,15 @@ $sth->execute( ); while(($dbids[$i], $dbpaths[$i]) = $sth->fetchrow_array( ) ) { - $dbpaths[$i] = substr($dbpaths[$i], 23); + $dbpaths[$i] = substr($dbpaths[$i], 13); $dbpaths[$i] =~ tr/\\/\//; - $dbpaths[$i] = '/WIDEPRINT/' . $dbpaths[$i]; + $dbpaths[$i] = '/mnt/maket/' . $dbpaths[$i]; $dbpaths[$i] = substr($dbpaths[$i], 0, ( index($dbpaths[$i], ' ', 0) ) ); - if($EXPAND_SYMLINKS && -e $dbpaths[$i]) - { - chomp( $_ = `dirname $dbpaths[$i] | xargs /usr/bin/readlink` ); - chomp( $dbpaths[$i] = $_ . '/' . `basename $dbpaths[$i]` ); - } +# if($EXPAND_SYMLINKS && -e $dbpaths[$i]) +# { +# chomp( $_ = `dirname $dbpaths[$i] | xargs /usr/bin/readlink` ); +# chomp( $dbpaths[$i] = $_ . '/' . `basename $dbpaths[$i]` ); +# } $i++; }