Skip to content

Commit

Permalink
Merge pull request #167 from mariux64/pdist-add-status-file
Browse files Browse the repository at this point in the history
pdist: Add option --set-pdist-status
  • Loading branch information
donald authored Mar 31, 2021
2 parents af5de81 + cfe4db8 commit 6bdc8b0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pdist/pdist
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ $SIG{PIPE} = sub {clean_tmp();exit 1;};

# options

our ($debug,$quiet,$fileop_noop,$fileop_debug,$delete);
our ($debug,$quiet,$fileop_noop,$fileop_debug,$delete,$set_pdist_status);
our ($verbose,$timeout,@files,$ssh_tunnel,$post_command,$parallel,$prompt,$msg_prefix);
our ($distfilename) = (DISTFILE);

Expand Down Expand Up @@ -829,6 +829,13 @@ sub prog_update
warn "$fn: $!\n";
}
}

if ( !$fileop_noop && $set_pdist_status) {
my $t=time;
open L,'>','/.pdist_status' or die "/.pdist_status: $!\n";
print L 'OK',$t,scalar(localtime($t));
close L;
}
}

if ($function==F_REQUEST) {
Expand Down Expand Up @@ -1014,6 +1021,8 @@ sub push_single
$fileop_debug and push @remote_opts,'--fileop_debug';
$debug and push @remote_opts,'--debug';
push @remote_opts,$delete ? '--delete' : '--nodelete';
$set_pdist_status and push @remote_opts,'--set-pdist-status';

$post_command and push @remote_opts,'--post-command='.quotemeta($post_command);

$parallel && $parallel>1 and push @remote_opts,'--msg-prefix',$client;
Expand Down Expand Up @@ -1186,6 +1195,7 @@ usage: $0 cmd [options]
--fileop_debug # log all file operations
--[no]delete # do or do not clean up additional files on client.
# default is delete unless --files is used
--set-pdist-status # force creation of /.pdist_status on target
--verbose # be more verbose
--fileop_noop # DEPRECATED: now --noop
Expand Down Expand Up @@ -1222,6 +1232,7 @@ use constant OPTIONS => (

'fileop_debug' => \$fileop_debug,
'delete!' => \$delete,
'set-pdist-status' => \$set_pdist_status,

'verbose' => \$verbose,
'debug' => \$debug,
Expand Down

0 comments on commit 6bdc8b0

Please sign in to comment.