~ubuntu-archive/ubuntu-archive-scripts/trunk

« back to all changes in this revision

Viewing changes to rrsync

  • Committer: Ubuntu Archive
  • Date: 2010-09-09 13:21:06 UTC
  • Revision ID: ubuntu-archive@lillypilly-20100909132106-vf90hsui7r781cky
rrsync: update to example script from rsync 3.0.7-1ubuntu1, to deal with options passed by newer rsync versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
my $command = $ENV{SSH_ORIGINAL_COMMAND};
40
40
die "$0: Not invoked via sshd\n$Usage"  unless defined $command;
41
41
die "$0: SSH_ORIGINAL_COMMAND='$command' is not rsync\n" unless $command =~ s/^rsync\s+//;
 
42
die "$0: --server option is not first\n" unless $command =~ /^--server\s/;
42
43
our $am_sender = $command =~ /^--server\s+--sender\s/; # Restrictive on purpose!
43
44
die "$0 -ro: sending to read-only server not allowed\n" if $ro && !$am_sender;
44
45
 
48
49
# and only in the option format that the stock rsync produces.
49
50
 
50
51
# To disable a short-named option, add its letter to this string:
51
 
our $short_disabled = '';
 
52
our $short_disabled = 's';
52
53
 
53
 
our $short_no_arg = 'CDEHIKLORSWbcdgklmnoprtuvxz'; # DO NOT REMOVE ANY
 
54
our $short_no_arg = 'ACDEHIKLORSWXbcdgklmnoprstuvxz'; # DO NOT REMOVE ANY
54
55
our $short_with_num = 'B'; # DO NOT REMOVE ANY
55
56
 
56
57
# To disable a long-named option, change its value to a -1.  The values mean:
65
66
  'compress-level' => 1,
66
67
  'copy-dest' => 2,
67
68
  'copy-unsafe-links' => 0,
68
 
  'daemon' => 0,
 
69
  'daemon' => -1,
69
70
  'delay-updates' => 0,
70
71
  'delete' => 0,
71
72
  'delete-after' => 0,
72
73
  'delete-before' => 0,
 
74
  'delete-delay' => 0,
73
75
  'delete-during' => 0,
74
76
  'delete-excluded' => 0,
75
77
  'existing' => 0,
 
78
  'fake-super' => 0,
76
79
  'files-from' => 3,
77
80
  'force' => 0,
78
81
  'from0' => 0,
79
82
  'fuzzy' => 0,
 
83
  'iconv' => 1,
80
84
  'ignore-errors' => 0,
81
85
  'ignore-existing' => 0,
82
86
  'inplace' => 0,
83
87
  'link-dest' => 2,
84
88
  'list-only' => 0,
 
89
  'log-file' => 3,
85
90
  'log-format' => 1,
86
91
  'max-delete' => 1,
87
92
  'max-size' => 1,
88
93
  'min-size' => 1,
89
94
  'modify-window' => 1,
 
95
  'no-i-r' => 0,
90
96
  'no-implied-dirs' => 0,
91
97
  'no-r' => 0,
92
98
  'no-relative' => 0,
101
107
  'sender' => 0,
102
108
  'server' => 0,
103
109
  'size-only' => 0,
 
110
  'skip-compress' => 1,
104
111
  'specials' => 0,
105
112
  'suffix' => 1,
106
113
  'super' => 0,
107
114
  'temp-dir' => 2,
108
115
  'timeout' => 1,
 
116
  'use-qsort' => 0,
109
117
);
110
118
 
111
119
### END of options data produced by the cull_options script. ###
135
143
    if ($_ eq '.') {
136
144
      $in_options = 0;
137
145
    } else {
138
 
      next if /^-$short_no_arg+$/o || /^-$short_with_num\d+$/o;
 
146
      die "$0: invalid option: '-'\n" if $_ eq '-';
 
147
      next if /^-$short_no_arg*(e\d*\.\w*)?$/o || /^-$short_with_num\d+$/o;
139
148
 
140
149
      my($opt,$arg) = /^--([^=]+)(?:=(.*))?$/;
141
150
      my $disabled;