equal
deleted
inserted
replaced
1 #! /usr/bin/perl |
|
2 # ha-diff [diff-options] <other> file |
|
3 use strict; |
|
4 use warnings; |
|
5 use Cwd qw(abs_path); |
|
6 |
|
7 die "bad usage" if @ARGV < 2; |
|
8 |
|
9 my $file = pop @ARGV; |
|
10 my $other = pop @ARGV; |
|
11 |
|
12 $file = abs_path($file) if not $file =~ /^\//; |
|
13 push @ARGV, "-u" if (not @ARGV); |
|
14 |
|
15 system qq{/bin/bash -c "diff @ARGV --label other <(ssh $other cat '$file') '$file'"}; |
|
16 system qq{/bin/bash -c "diff @ARGV --label other --label local <(ssh $other stat '$file') <(stat '$file')"} |
|
17 if $? == 0; |
|