1 From rsync-admin@lists.samba.org Thu Apr 18 20:05:33 2002
2 Return-Path: <rsync-admin@lists.samba.org>
3 Delivered-To: mbp@samba.org
4 Received: from va.samba.org (localhost [127.0.0.1])
5 by lists.samba.org (Postfix) with ESMTP
6 id 8AD0349D4; Thu, 18 Apr 2002 20:05:32 -0700 (PDT)
7 Delivered-To: rsync@lists.samba.org
8 Received: from ctmsg01.corp.fitlinxx.com (mail.fitlinxx.com [208.247.212.10])
9 by lists.samba.org (Postfix) with ESMTP id 12ED449C6
10 for <rsync@lists.samba.org>; Thu, 18 Apr 2002 20:05:00 -0700 (PDT)
11 Received: by ctmsg01.corp.fitlinxx.com with Internet Mail Service (5.5.2653.19)
12 id <JCL2B4NB>; Thu, 18 Apr 2002 23:04:07 -0400
13 Message-ID: <926F937512224245A616323693D3F16B1C0022@ctmsg01.corp.fitlinxx.com>
14 From: David Bolen <db3l@fitlinxx.com>
15 To: 'Peter Tattam' <peter@jazz-1.trumpet.com.au>
16 Cc: rsync@lists.samba.org
17 Subject: RE: mixed case file systems.
19 X-Mailer: Internet Mail Service (5.5.2653.19)
20 Content-Type: text/plain;
22 Sender: rsync-admin@lists.samba.org
23 Errors-To: rsync-admin@lists.samba.org
24 X-BeenThere: rsync@lists.samba.org
25 X-Mailman-Version: 2.0.8
27 List-Help: <mailto:rsync-request@lists.samba.org?subject=help>
28 List-Post: <mailto:rsync@lists.samba.org>
29 List-Subscribe: <http://lists.samba.org/mailman/listinfo/rsync>,
30 <mailto:rsync-request@lists.samba.org?subject=subscribe>
31 List-Id: rsync user list <rsync.lists.samba.org>
32 List-Unsubscribe: <http://lists.samba.org/mailman/listinfo/rsync>,
33 <mailto:rsync-request@lists.samba.org?subject=unsubscribe>
34 List-Archive: <http://lists.samba.org/pipermail/rsync/>
35 X-Original-Date: Thu, 18 Apr 2002 23:04:06 -0400
36 Date: Thu, 18 Apr 2002 23:04:06 -0400
42 Peter Tattam [peter@jazz-1.trumpet.com.au] writes:
44 > I believe a suitable workaround would be to ignore case for file names
45 > when the rsync process is undertaken. Is this facility available or
46 > planned in the near future?
48 I've attached a context diff for some changes I made to our local copy
49 a while back to add an "--ignore-case" option just for this purpose.
50 In our case it came up in the context of disting between NTFS and FAT
51 remote systems. I think we ended up not needing it, but it does make
52 rsync match filenames in a case insensitive manner, so it might at
53 least be worth trying to see if it resolves your issue.
55 A few caveats - both ends have to support the option - I couldn't make
56 it backwards compatible because both ends exchange information about a
57 sorted file list that has to sort the same way on either side (which
58 very subtly bit me when I first did this). I also didn't bump the
59 protocol in this patch (wasn't quite sure it was appropriate just for an
60 incompatible command line option) since since it was for local use.
62 The patch is based on a 2.4.x series rsync, but if it doesn't apply
63 cleanly to 2.5.x, it's should be simple enough to just apply manually.
67 /-----------------------------------------------------------------------\
68 \ David Bolen \ E-mail: db3l@fitlinxx.com /
69 | FitLinxx, Inc. \ Phone: (203) 708-5192 |
70 / 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
71 \-----------------------------------------------------------------------/
73 - - - - - - - - - - - - - - - - - - - - - - - - -
76 ===================================================================
77 RCS file: e:/binaries/cvs/ni/bin/rsync/options.c,v
78 retrieving revision 1.5
79 retrieving revision 1.7
81 *** options.c 2000/12/28 00:30:18 1.5
82 --- options.c 2001/06/20 19:25:24 1.7
90 int modify_window_set=0;
96 rprintf(F," --exclude-from=FILE exclude patterns listed in
98 rprintf(F," --include=PATTERN don't exclude files matching
100 rprintf(F," --include-from=FILE don't exclude patterns listed in
102 + rprintf(F," --ignore-case ignore case when comparing
104 rprintf(F," --version print version number\n");
105 rprintf(F," --daemon run as a rsync daemon\n");
106 rprintf(F," --address bind to the specified
110 OPT_PROGRESS, OPT_COPY_UNSAFE_LINKS, OPT_SAFE_LINKS,
112 OPT_LOG_FORMAT, OPT_PASSWORD_FILE, OPT_SIZE_ONLY, OPT_ADDRESS,
113 OPT_DELETE_AFTER, OPT_EXISTING, OPT_MAX_DELETE, OPT_BACKUP_DIR,
114 ! OPT_IGNORE_ERRORS, OPT_MODIFY_WINDOW, OPT_DELETE_SENT};
116 ! static char *short_options = "oblLWHpguDCtcahvqrRIxnSe:B:T:zP";
118 static struct option long_options[] = {
119 {"version", 0, 0, OPT_VERSION},
121 OPT_PROGRESS, OPT_COPY_UNSAFE_LINKS, OPT_SAFE_LINKS,
123 OPT_LOG_FORMAT, OPT_PASSWORD_FILE, OPT_SIZE_ONLY, OPT_ADDRESS,
124 OPT_DELETE_AFTER, OPT_EXISTING, OPT_MAX_DELETE, OPT_BACKUP_DIR,
125 ! OPT_IGNORE_ERRORS, OPT_MODIFY_WINDOW, OPT_DELETE_SENT,
128 ! static char *short_options = "oblLWHpguDCtcahvqrRIxnSe:B:T:zP";
130 static struct option long_options[] = {
131 {"version", 0, 0, OPT_VERSION},
135 {"exclude-from",1, 0, OPT_EXCLUDE_FROM},
136 {"include", 1, 0, OPT_INCLUDE},
137 {"include-from",1, 0, OPT_INCLUDE_FROM},
138 + {"ignore-case", 0, 0, OPT_IGNORE_CASE},
139 {"rsync-path", 1, 0, OPT_RSYNC_PATH},
140 {"password-file", 1, 0, OPT_PASSWORD_FILE},
141 {"one-file-system",0, 0, 'x'},
145 add_exclude_file(optarg,1, 1);
148 + case OPT_IGNORE_CASE:
152 case OPT_COPY_UNSAFE_LINKS:
158 slprintf(mwindow,sizeof(mwindow),"--modify-window=%d",
160 args[ac++] = mwindow;
164 + args[ac++] = "--ignore-case";
169 ===================================================================
170 RCS file: e:/binaries/cvs/ni/bin/rsync/exclude.c,v
171 retrieving revision 1.1.1.1
172 retrieving revision 1.2
173 diff -c -r1.1.1.1 -r1.2
174 *** exclude.c 2000/05/30 18:08:19 1.1.1.1
175 --- exclude.c 2001/06/14 04:30:17 1.2
179 static struct exclude_struct *make_exclude(char *pattern, int include)
181 struct exclude_struct *ret;
182 + extern int ignore_case;
184 ret = (struct exclude_struct *)malloc(sizeof(*ret));
185 if (!ret) out_of_memory("make_exclude");
190 if (!strchr(ret->pattern,'/')) {
195 + ret->fnmatch_flags |= FNM_CASEFOLD;
200 ===================================================================
201 RCS file: e:/binaries/cvs/ni/bin/rsync/util.c,v
202 retrieving revision 1.2
203 retrieving revision 1.3
205 *** util.c 2000/07/07 03:23:40 1.2
206 --- util.c 2001/06/14 04:30:17 1.3
210 const uchar *s1 = (const uchar *)cs1;
211 const uchar *s2 = (const uchar *)cs2;
213 ! while (*s1 && *s2 && (*s1 == *s2)) {
217 - return (int)*s1 - (int)*s2;
220 static OFF_T last_ofs;
223 const uchar *s1 = (const uchar *)cs1;
224 const uchar *s2 = (const uchar *)cs2;
225 + extern int ignore_case;
228 + while (*s1 && *s2 && (toupper(*s1) == toupper(*s2))) {
232 + return (int)toupper(*s1) - (int)toupper(*s2);
234 + while (*s1 && *s2 && (*s1 == *s2)) {
238 ! return (int)*s1 - (int)*s2;
242 static OFF_T last_ofs;
245 To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
246 Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html