X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fbin%2Fbex-add;h=7138ef5046bc38b5677347786efe58ed700f642d;hb=HEAD;hp=4f2c3b39138822594dac031e807c298db4637814;hpb=d4674b5aa83e0d917910e67634b0371f3d41c16b;p=bex.git diff --git a/lib/bin/bex-add b/lib/bin/bex-add index 4f2c3b3..7138ef5 100755 --- a/lib/bin/bex-add +++ b/lib/bin/bex-add @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Batch EXecutor 3.0 -- Insert to Queue +# Batch EXecutor -- Insert to Queue # (c) 2011-2013 Martin Mares use strict; @@ -21,7 +21,7 @@ my @attach = (); sub usage() { print <] [!] ... +Usage: bex add [] [!] ... Options: -a, --attach= Attach a file or directory to the job @@ -70,8 +70,8 @@ if (defined $requeue_id) { if (defined($given_body) || defined($given_execute) || defined($given_id) || defined($given_subject) || defined($given_template)) { die "Parameters of a requeued job cannot be changed\n"; } - my $fn = $queue->job_file($requeue_id); - -f $fn or die "Job $requeue_id not known\n"; + my $id = $queue->resolve_job_id($requeue_id); + my $fn = $queue->job_file($id); $job = BEX::Job->new_from_file($fn); } else { # Create job template @@ -95,7 +95,7 @@ if (defined $requeue_id) { if (!$given_go) { $tmp_fn = $job->save; my $orig_stat = stat($tmp_fn) or die; - system "editor", $tmp_fn and die "Editor exited with an error, file kept as $tmp_fn\n"; + system $BEX::Config::editor_command, $tmp_fn and die "Editor exited with an error, file kept as $tmp_fn\n"; my $new_stat = stat($tmp_fn) or die "File $tmp_fn disappeared under my hands: $!\n"; if ($new_stat->mtime <= $orig_stat->mtime && $new_stat->size == $orig_stat->size) { unlink $tmp_fn; @@ -123,7 +123,7 @@ if (@attach) { $? and die "Cannot delete old attachment $adest\n"; $msg = "Updated attachment"; } - system "/bin/cp", "-a", $asrc, $adest; + system "/bin/cp", "-aL", $asrc, $adest; $? and die "Cannot copy attachment $asrc to $adest\n"; if (-d $asrc) { print "$msg $base/...\n";