Changeset 23

Show
Ignore:
Timestamp:
20/02/2007 17:09:28 (2 years ago)
Author:
nextime
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • packages/main/dupload/trunk/dupload

    r19 r23  
    464464} elsif ($method eq "rsync") { 
    465465        p "Uploading (rsync) to $host ($fqdn)\n"; 
     466} elsif ($method eq "cp") { 
     467        p "Copying (cp) to $incoming\n"; 
    466468} else { 
    467469        fatal("Unknown upload method\n"); 
     
    547549                        $t = 1; 
    548550                        $batchmode = 1; 
     551                } elsif ($method eq "cp") { 
     552                        $mode = (stat($file))[2]; 
     553                        unless ($dry) { 
     554                                system("cp -p $options $file $incoming"); 
     555                                fatal("cp $file failed\n") if $?; 
     556                                $t = time() - $t; 
     557                                # Small optimization 
     558                                if ($mode != 33188) { # rw-r--r-- aka 0644 
     559                                    system("chmod 0644 $incoming/$file"); 
     560                                    fatal("chmod 0644 failed\n") if $?; 
     561                                } 
     562                        } else { 
     563                                p "\n+ cp -p $options $file $incoming"; 
     564                                if ($mode != 33188) { # rw-r--r-- aka 0644 
     565                                     p "\n+ chmod 0644 $incoming/$file"; 
     566                                } 
     567                                $t = 1; 
     568                        } 
    549569                } 
    550570 
     
    568588                                        p "\n+ ssh -x -l $login $fqdn \"mv $incoming$file $queuedir$file\""; 
    569589                                } 
     590                        } elsif ($method eq "cp") { 
     591                                unless ($dry) { 
     592                                        system("mv $incoming$file $queuedir$file"); 
     593                                        fatal("mv failed\n") if $?; 
     594                                } else { 
     595                                        p "\n+ mv $incoming$file $queuedir$file"; 
     596                                } 
    570597                        } 
    571598                }