[BACK]Return to fetch.pm CVS log [TXT][DIR] Up to [local] / wpscripts / ztransfer

Diff for /wpscripts/ztransfer/fetch.pm between version 1.1.1.1 and 1.4

version 1.1.1.1, 2011/06/03 09:28:47 version 1.4, 2011/07/22 07:34:56
Line 6 
Line 6 
 use warnings;  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_Z = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=0";
 my $QUERY_J = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=1";  my $QUERY_P = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=1";
 my $QUERY_P = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=2";  
 my $QUERY_T = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=3";  
   
 my $sth;  my $sth;
   
Line 39 
Line 37 
         if($dbids[$i])  # element exists (THIS CODE SHOULD BE FIXED)          if($dbids[$i])  # element exists (THIS CODE SHOULD BE FIXED)
         {          {
             #convert samba-paths to local unix paths              #convert samba-paths to local unix paths
             $dbpaths[$i] = substr($dbpaths[$i], 23);    # remove \\fileserver\wideprint\              $dbpaths[$i] = substr($dbpaths[$i], 13);    # remove \\fileserver\
             $dbpaths[$i] =~ tr/\\/\//;                  # convert each \ to /              $dbpaths[$i] =~ tr/\\/\//;                  # convert each \ to /
             $dbpaths[$i] = '/WIDEPRINT/' . $dbpaths[$i];              $dbpaths[$i] = '/mnt/maket/' . $dbpaths[$i];
             $dbpaths[$i] = substr($dbpaths[$i], 0, ( index($dbpaths[$i], ' ', 0) ) );              $dbpaths[$i] = substr($dbpaths[$i], 0, ( index($dbpaths[$i], ' ', 0) ) );
                 #                  #
                 # We must not save non-existent local file in array!                  # We must not save non-existent local file in array!
Line 94 
Line 92 
 }  }
   
   
 sub jpegs_list()  
 {  
     my @dbids;  
     my @dbpaths;  
     my $i = 0;  
   
     $sth = $db::dbh->prepare($QUERY_J);  
     $sth->execute( );  
     while(($dbids[$i], $dbpaths[$i]) = $sth->fetchrow_array( ) )  
     {  
         $dbpaths[$i] = substr($dbpaths[$i], 23);  
         $dbpaths[$i] =~ tr/\\/\//;  
         $dbpaths[$i] = '/WIDEPRINT/' . $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]` );  
             }  
         $i++;  
     }  
   
     $i--;  
     $#dbids = $i;  
     $#dbpaths = $i;  
   
     log::filelist(\@dbpaths);  
   
     return( (\@dbids, \@dbpaths) );  
 }  
   
   
 sub probas_list()  sub probas_list()
 {  {
     my @dbids;      my @dbids;
Line 154 
Line 120 
   
     log::filelist(\@dbpaths);      log::filelist(\@dbpaths);
   
   
     return( (\@dbids, \@dbpaths) );  
 }  
   
   
 sub tpps_list()  
 {  
     my @dbids;  
     my @dbpaths;  
     my $i = 0;  
   
     $sth = $db::dbh->prepare($QUERY_T);  
     $sth->execute( );  
     while(($dbids[$i], $dbpaths[$i]) = $sth->fetchrow_array( ) )  
     {  
         $dbpaths[$i] = substr($dbpaths[$i], 23);  
         $dbpaths[$i] =~ tr/\\/\//;  
         $dbpaths[$i] = '/WIDEPRINT/' . $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]` );  
             }  
         $i++;  
     }  
   
     $i--;  
     $#dbids = $i;  
     $#dbpaths = $i;  
   
     log::filelist(\@dbpaths);  
   
     return( (\@dbids, \@dbpaths) );      return( (\@dbids, \@dbpaths) );
 }  }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.4

CVSweb