Changeset 23
- Timestamp:
- 20/02/2007 17:09:28 (2 years ago)
- Files:
-
- packages/main/dupload/trunk/dupload (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
packages/main/dupload/trunk/dupload
r19 r23 464 464 } elsif ($method eq "rsync") { 465 465 p "Uploading (rsync) to $host ($fqdn)\n"; 466 } elsif ($method eq "cp") { 467 p "Copying (cp) to $incoming\n"; 466 468 } else { 467 469 fatal("Unknown upload method\n"); … … 547 549 $t = 1; 548 550 $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 } 549 569 } 550 570 … … 568 588 p "\n+ ssh -x -l $login $fqdn \"mv $incoming$file $queuedir$file\""; 569 589 } 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 } 570 597 } 571 598 }
