tools/mtd-utils: prefer static linking
[openwrt.git] / tools / dosfstools / patches / 0006-fsck.fat-Make-r-option-default.patch
1 From 357ab077198bfa6239fa62fd03a546da959ec756 Mon Sep 17 00:00:00 2001
2 From: Andreas Bombe <aeb@debian.org>
3 Date: Thu, 19 Feb 2015 21:22:54 +0100
4 Subject: [PATCH 06/14] fsck.fat: Make -r option default
5
6 Default mode is now to interactively repair with the option to write
7 the changes back at the end (like the -r option) instead of the previous
8 default mode of interactively correcting but never writing back the
9 changes.
10
11 The -r option continues to be recognized by fsck.fat.
12
13 Signed-off-by: Andreas Bombe <aeb@debian.org>
14 ---
15  manpages/de/fsck.fat.de.8    |  6 ++--
16  manpages/en/fsck.fat.8       |  5 +--
17  manpages/po/de/fsck.fat.8.po | 76 ++++++++++++++++++++------------------------
18  manpages/pot/fsck.fat.8.pot  | 76 ++++++++++++++++++++------------------------
19  src/fsck.fat.c               |  6 ++--
20  5 files changed, 76 insertions(+), 93 deletions(-)
21
22 diff --git a/manpages/de/fsck.fat.de.8 b/manpages/de/fsck.fat.de.8
23 index 1d96e23..f9d70b8 100644
24 --- a/manpages/de/fsck.fat.de.8
25 +++ b/manpages/de/fsck.fat.de.8
26 @@ -123,7 +123,8 @@ anything to the filesystem.
27  Same as (\fB\-a\fP), for compatibility with other *fsck.
28  .IP \fB\-r\fP 4
29  Interactively repair the filesystem. The user is asked for advice whenever
30 -there is more than one approach to fix an inconsistency.
31 +there is more than one approach to fix an inconsistency. This is the default
32 +mode and the option is only retained for backwards compatibility.
33  .IP \fB\-t\fP 4
34  Mark unreadable clusters as bad.
35  .IP \fB\-u\fP 4
36 @@ -143,9 +144,6 @@ Write changes to disk immediately.
37  .IP \fB\-y\fP 4
38  Same as \fB\-a\fP (automatically repair filesystem) for compatibility with other
39  fsck tools.
40 -.PP
41 -\fBNote:\fP If \fB\-a\fP and \fB\-r\fP are absent, the filesystem is only checked, but
42 -not repaired.
43  
44  .SH "EXIT STATUS"
45  .IP 0 4
46 diff --git a/manpages/en/fsck.fat.8 b/manpages/en/fsck.fat.8
47 index 3d95dc8..8c54372 100644
48 --- a/manpages/en/fsck.fat.8
49 +++ b/manpages/en/fsck.fat.8
50 @@ -93,8 +93,7 @@ anything to the filesystem.
51  .IP "\fB\-p\fR" 4
52  Same as (\fB\-a\fR), for compatibility with other *fsck.
53  .IP "\fB\-r\fR" 4
54 -Interactively repair the filesystem. The user is asked for advice whenever
55 -there is more than one approach to fix an inconsistency.
56 +Interactively repair the filesystem. The user is asked for advice whenever there is more than one approach to fix an inconsistency. This is the default mode and the option is only retained for backwards compatibility.
57  .IP "\fB\-t\fR" 4
58  Mark unreadable clusters as bad.
59  .IP "\fB\-u\fR" 4
60 @@ -107,8 +106,6 @@ Perform a verification pass. The filesystem check is repeated after the first ru
61  Write changes to disk immediately.
62  .IP "\fB\-y\fR" 4
63  Same as \fB\-a\fR (automatically repair filesystem) for compatibility with other fsck tools.
64 -.PP
65 -\fBNote:\fR If \fB\-a\fR and \fB\-r\fR are absent, the filesystem is only checked, but not repaired.
66  
67  .SH "EXIT STATUS"
68  .IP "0" 4
69 diff --git a/manpages/po/de/fsck.fat.8.po b/manpages/po/de/fsck.fat.8.po
70 index 3035906..7ca0bc1 100644
71 --- a/manpages/po/de/fsck.fat.8.po
72 +++ b/manpages/po/de/fsck.fat.8.po
73 @@ -3,7 +3,7 @@
74  msgid ""
75  msgstr ""
76  "Project-Id-Version: dosfstools VERSION\n"
77 -"POT-Creation-Date: 2014-11-12 00:52+0100\n"
78 +"POT-Creation-Date: 2015-02-20 20:47+0100\n"
79  "PO-Revision-Date: 2013-06-06 09:34+0300\n"
80  "Last-Translator: Automatically generated\n"
81  "Language-Team: none\n"
82 @@ -56,30 +56,30 @@ msgid "OPTIONS"
83  msgstr ""
84  
85  #. type: SH
86 -#: en/fatlabel.8:41 en/fsck.fat.8:128 en/mkfs.fat.8:78
87 +#: en/fatlabel.8:41 en/fsck.fat.8:125 en/mkfs.fat.8:78
88  #, no-wrap
89  msgid "SEE ALSO"
90  msgstr ""
91  
92  #. type: Plain text
93 -#: en/fatlabel.8:45 en/fsck.fat.8:132
94 +#: en/fatlabel.8:45 en/fsck.fat.8:129
95  msgid "B<mkfs.fat>(8)"
96  msgstr ""
97  
98  #. type: SH
99 -#: en/fatlabel.8:46 en/fsck.fat.8:133 en/mkfs.fat.8:83
100 +#: en/fatlabel.8:46 en/fsck.fat.8:130 en/mkfs.fat.8:83
101  #, no-wrap
102  msgid "HOMEPAGE"
103  msgstr ""
104  
105  #. type: SH
106 -#: en/fatlabel.8:49 en/fsck.fat.8:136 en/mkfs.fat.8:86
107 +#: en/fatlabel.8:49 en/fsck.fat.8:133 en/mkfs.fat.8:86
108  #, no-wrap
109  msgid "AUTHORS"
110  msgstr ""
111  
112  #. type: Plain text
113 -#: en/fatlabel.8:50 en/fsck.fat.8:137 en/mkfs.fat.8:87
114 +#: en/fatlabel.8:50 en/fsck.fat.8:134 en/mkfs.fat.8:87
115  msgid ""
116  "B<dosfstools> were written by Werner Almesberger E<lt>I<werner."
117  "almesberger@lrc.di.epfl.ch>E<gt>, Roman Hodek E<lt>I<Roman.Hodek@informatik."
118 @@ -365,31 +365,32 @@ msgid "B<-r>"
119  msgstr ""
120  
121  #. type: Plain text
122 -#: en/fsck.fat.8:98
123 +#: en/fsck.fat.8:97
124  msgid ""
125  "Interactively repair the filesystem. The user is asked for advice whenever "
126 -"there is more than one approach to fix an inconsistency."
127 +"there is more than one approach to fix an inconsistency. This is the default "
128 +"mode and the option is only retained for backwards compatibility."
129  msgstr ""
130  
131  #. type: IP
132 -#: en/fsck.fat.8:98
133 +#: en/fsck.fat.8:97
134  #, no-wrap
135  msgid "B<-t>"
136  msgstr ""
137  
138  #. type: Plain text
139 -#: en/fsck.fat.8:100
140 +#: en/fsck.fat.8:99
141  msgid "Mark unreadable clusters as bad."
142  msgstr ""
143  
144  #. type: IP
145 -#: en/fsck.fat.8:100
146 +#: en/fsck.fat.8:99
147  #, no-wrap
148  msgid "B<-u>"
149  msgstr ""
150  
151  #. type: Plain text
152 -#: en/fsck.fat.8:102
153 +#: en/fsck.fat.8:101
154  msgid ""
155  "Try to undelete the specified file. B<fsck.fat> tries to allocate a chain of "
156  "contiguous unallocated clusters beginning with the start cluster of the "
157 @@ -397,24 +398,24 @@ msgid ""
158  msgstr ""
159  
160  #. type: IP
161 -#: en/fsck.fat.8:102 en/mkfs.fat.8:72
162 +#: en/fsck.fat.8:101 en/mkfs.fat.8:72
163  #, no-wrap
164  msgid "B<-v>"
165  msgstr ""
166  
167  #. type: Plain text
168 -#: en/fsck.fat.8:104
169 +#: en/fsck.fat.8:103
170  msgid "Verbose mode. Generates slightly more output."
171  msgstr ""
172  
173  #. type: IP
174 -#: en/fsck.fat.8:104
175 +#: en/fsck.fat.8:103
176  #, no-wrap
177  msgid "B<-V>"
178  msgstr ""
179  
180  #. type: Plain text
181 -#: en/fsck.fat.8:106
182 +#: en/fsck.fat.8:105
183  msgid ""
184  "Perform a verification pass. The filesystem check is repeated after the "
185  "first run. The second pass should never report any fixable errors. It may "
186 @@ -424,91 +425,84 @@ msgid ""
187  msgstr ""
188  
189  #. type: IP
190 -#: en/fsck.fat.8:106
191 +#: en/fsck.fat.8:105
192  #, no-wrap
193  msgid "B<-w>"
194  msgstr ""
195  
196  #. type: Plain text
197 -#: en/fsck.fat.8:108
198 +#: en/fsck.fat.8:107
199  msgid "Write changes to disk immediately."
200  msgstr ""
201  
202  #. type: IP
203 -#: en/fsck.fat.8:108
204 +#: en/fsck.fat.8:107
205  #, no-wrap
206  msgid "B<-y>"
207  msgstr ""
208  
209  #. type: Plain text
210 -#: en/fsck.fat.8:110
211 +#: en/fsck.fat.8:109
212  msgid ""
213  "Same as B<-a> (automatically repair filesystem) for compatibility with other "
214  "fsck tools."
215  msgstr ""
216  
217 -#. type: Plain text
218 -#: en/fsck.fat.8:112
219 -msgid ""
220 -"B<Note:> If B<-a> and B<-r> are absent, the filesystem is only checked, but "
221 -"not repaired."
222 -msgstr ""
223 -
224  #. type: SH
225 -#: en/fsck.fat.8:113
226 +#: en/fsck.fat.8:110
227  #, no-wrap
228  msgid "EXIT STATUS"
229  msgstr ""
230  
231  #. type: IP
232 -#: en/fsck.fat.8:114
233 +#: en/fsck.fat.8:111
234  #, no-wrap
235  msgid "0"
236  msgstr ""
237  
238  #. type: Plain text
239 -#: en/fsck.fat.8:116
240 +#: en/fsck.fat.8:113
241  msgid "No recoverable errors have been detected."
242  msgstr ""
243  
244  #. type: IP
245 -#: en/fsck.fat.8:116
246 +#: en/fsck.fat.8:113
247  #, no-wrap
248  msgid "1"
249  msgstr ""
250  
251  #. type: Plain text
252 -#: en/fsck.fat.8:118
253 +#: en/fsck.fat.8:115
254  msgid ""
255  "Recoverable errors have been detected or B<fsck.fat> has discovered an "
256  "internal inconsistency."
257  msgstr ""
258  
259  #. type: IP
260 -#: en/fsck.fat.8:118
261 +#: en/fsck.fat.8:115
262  #, no-wrap
263  msgid "2"
264  msgstr ""
265  
266  #. type: Plain text
267 -#: en/fsck.fat.8:120
268 +#: en/fsck.fat.8:117
269  msgid "Usage error. B<fsck.fat> did not access the filesystem."
270  msgstr ""
271  
272  #. type: SH
273 -#: en/fsck.fat.8:121
274 +#: en/fsck.fat.8:118
275  #, no-wrap
276  msgid "FILES"
277  msgstr ""
278  
279  #. type: IP
280 -#: en/fsck.fat.8:122
281 +#: en/fsck.fat.8:119
282  #, no-wrap
283  msgid "fsck0000.rec, fsck0001.rec, ..."
284  msgstr ""
285  
286  #. type: Plain text
287 -#: en/fsck.fat.8:124
288 +#: en/fsck.fat.8:121
289  msgid ""
290  "When recovering from a corrupted filesystem, B<fsck.fat> dumps recovered "
291  "data into files named 'fsckNNNN.rec' in the top level directory of the "
292 @@ -516,13 +510,13 @@ msgid ""
293  msgstr ""
294  
295  #. type: SH
296 -#: en/fsck.fat.8:125 en/mkfs.fat.8:75
297 +#: en/fsck.fat.8:122 en/mkfs.fat.8:75
298  #, no-wrap
299  msgid "BUGS"
300  msgstr ""
301  
302  #. type: Plain text
303 -#: en/fsck.fat.8:127
304 +#: en/fsck.fat.8:124
305  msgid ""
306  "Does not create . and .. files where necessary. Does not remove entirely "
307  "empty directories. Should give more diagnostic messages. Undeleting files "
308 @@ -530,12 +524,12 @@ msgid ""
309  msgstr ""
310  
311  #. type: Plain text
312 -#: en/fsck.fat.8:130 en/mkfs.fat.8:80
313 +#: en/fsck.fat.8:127 en/mkfs.fat.8:80
314  msgid "B<fatlabel>(8)"
315  msgstr ""
316  
317  #. type: Plain text
318 -#: en/fsck.fat.8:135 en/mkfs.fat.8:85
319 +#: en/fsck.fat.8:132 en/mkfs.fat.8:85
320  msgid ""
321  "More information about B<fsck.fat> and B<dosfstools> can be found at "
322  "E<lt>I<http://daniel-baumann.ch/software/dosfstools/>E<gt>."
323 diff --git a/manpages/pot/fsck.fat.8.pot b/manpages/pot/fsck.fat.8.pot
324 index e411819..f5ca313 100644
325 --- a/manpages/pot/fsck.fat.8.pot
326 +++ b/manpages/pot/fsck.fat.8.pot
327 @@ -7,7 +7,7 @@
328  msgid ""
329  msgstr ""
330  "Project-Id-Version: dosfstools VERSION\n"
331 -"POT-Creation-Date: 2014-11-12 00:52+0100\n"
332 +"POT-Creation-Date: 2015-02-20 20:47+0100\n"
333  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
334  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
335  "Language-Team: LANGUAGE <LL@li.org>\n"
336 @@ -59,30 +59,30 @@ msgid "OPTIONS"
337  msgstr ""
338  
339  #. type: SH
340 -#: en/fatlabel.8:41 en/fsck.fat.8:128 en/mkfs.fat.8:78
341 +#: en/fatlabel.8:41 en/fsck.fat.8:125 en/mkfs.fat.8:78
342  #, no-wrap
343  msgid "SEE ALSO"
344  msgstr ""
345  
346  #. type: Plain text
347 -#: en/fatlabel.8:45 en/fsck.fat.8:132
348 +#: en/fatlabel.8:45 en/fsck.fat.8:129
349  msgid "B<mkfs.fat>(8)"
350  msgstr ""
351  
352  #. type: SH
353 -#: en/fatlabel.8:46 en/fsck.fat.8:133 en/mkfs.fat.8:83
354 +#: en/fatlabel.8:46 en/fsck.fat.8:130 en/mkfs.fat.8:83
355  #, no-wrap
356  msgid "HOMEPAGE"
357  msgstr ""
358  
359  #. type: SH
360 -#: en/fatlabel.8:49 en/fsck.fat.8:136 en/mkfs.fat.8:86
361 +#: en/fatlabel.8:49 en/fsck.fat.8:133 en/mkfs.fat.8:86
362  #, no-wrap
363  msgid "AUTHORS"
364  msgstr ""
365  
366  #. type: Plain text
367 -#: en/fatlabel.8:50 en/fsck.fat.8:137 en/mkfs.fat.8:87
368 +#: en/fatlabel.8:50 en/fsck.fat.8:134 en/mkfs.fat.8:87
369  msgid ""
370  "B<dosfstools> were written by Werner Almesberger E<lt>I<werner."
371  "almesberger@lrc.di.epfl.ch>E<gt>, Roman Hodek E<lt>I<Roman.Hodek@informatik."
372 @@ -368,31 +368,32 @@ msgid "B<-r>"
373  msgstr ""
374  
375  #. type: Plain text
376 -#: en/fsck.fat.8:98
377 +#: en/fsck.fat.8:97
378  msgid ""
379  "Interactively repair the filesystem. The user is asked for advice whenever "
380 -"there is more than one approach to fix an inconsistency."
381 +"there is more than one approach to fix an inconsistency. This is the default "
382 +"mode and the option is only retained for backwards compatibility."
383  msgstr ""
384  
385  #. type: IP
386 -#: en/fsck.fat.8:98
387 +#: en/fsck.fat.8:97
388  #, no-wrap
389  msgid "B<-t>"
390  msgstr ""
391  
392  #. type: Plain text
393 -#: en/fsck.fat.8:100
394 +#: en/fsck.fat.8:99
395  msgid "Mark unreadable clusters as bad."
396  msgstr ""
397  
398  #. type: IP
399 -#: en/fsck.fat.8:100
400 +#: en/fsck.fat.8:99
401  #, no-wrap
402  msgid "B<-u>"
403  msgstr ""
404  
405  #. type: Plain text
406 -#: en/fsck.fat.8:102
407 +#: en/fsck.fat.8:101
408  msgid ""
409  "Try to undelete the specified file. B<fsck.fat> tries to allocate a chain of "
410  "contiguous unallocated clusters beginning with the start cluster of the "
411 @@ -400,24 +401,24 @@ msgid ""
412  msgstr ""
413  
414  #. type: IP
415 -#: en/fsck.fat.8:102 en/mkfs.fat.8:72
416 +#: en/fsck.fat.8:101 en/mkfs.fat.8:72
417  #, no-wrap
418  msgid "B<-v>"
419  msgstr ""
420  
421  #. type: Plain text
422 -#: en/fsck.fat.8:104
423 +#: en/fsck.fat.8:103
424  msgid "Verbose mode. Generates slightly more output."
425  msgstr ""
426  
427  #. type: IP
428 -#: en/fsck.fat.8:104
429 +#: en/fsck.fat.8:103
430  #, no-wrap
431  msgid "B<-V>"
432  msgstr ""
433  
434  #. type: Plain text
435 -#: en/fsck.fat.8:106
436 +#: en/fsck.fat.8:105
437  msgid ""
438  "Perform a verification pass. The filesystem check is repeated after the "
439  "first run. The second pass should never report any fixable errors. It may "
440 @@ -427,91 +428,84 @@ msgid ""
441  msgstr ""
442  
443  #. type: IP
444 -#: en/fsck.fat.8:106
445 +#: en/fsck.fat.8:105
446  #, no-wrap
447  msgid "B<-w>"
448  msgstr ""
449  
450  #. type: Plain text
451 -#: en/fsck.fat.8:108
452 +#: en/fsck.fat.8:107
453  msgid "Write changes to disk immediately."
454  msgstr ""
455  
456  #. type: IP
457 -#: en/fsck.fat.8:108
458 +#: en/fsck.fat.8:107
459  #, no-wrap
460  msgid "B<-y>"
461  msgstr ""
462  
463  #. type: Plain text
464 -#: en/fsck.fat.8:110
465 +#: en/fsck.fat.8:109
466  msgid ""
467  "Same as B<-a> (automatically repair filesystem) for compatibility with other "
468  "fsck tools."
469  msgstr ""
470  
471 -#. type: Plain text
472 -#: en/fsck.fat.8:112
473 -msgid ""
474 -"B<Note:> If B<-a> and B<-r> are absent, the filesystem is only checked, but "
475 -"not repaired."
476 -msgstr ""
477 -
478  #. type: SH
479 -#: en/fsck.fat.8:113
480 +#: en/fsck.fat.8:110
481  #, no-wrap
482  msgid "EXIT STATUS"
483  msgstr ""
484  
485  #. type: IP
486 -#: en/fsck.fat.8:114
487 +#: en/fsck.fat.8:111
488  #, no-wrap
489  msgid "0"
490  msgstr ""
491  
492  #. type: Plain text
493 -#: en/fsck.fat.8:116
494 +#: en/fsck.fat.8:113
495  msgid "No recoverable errors have been detected."
496  msgstr ""
497  
498  #. type: IP
499 -#: en/fsck.fat.8:116
500 +#: en/fsck.fat.8:113
501  #, no-wrap
502  msgid "1"
503  msgstr ""
504  
505  #. type: Plain text
506 -#: en/fsck.fat.8:118
507 +#: en/fsck.fat.8:115
508  msgid ""
509  "Recoverable errors have been detected or B<fsck.fat> has discovered an "
510  "internal inconsistency."
511  msgstr ""
512  
513  #. type: IP
514 -#: en/fsck.fat.8:118
515 +#: en/fsck.fat.8:115
516  #, no-wrap
517  msgid "2"
518  msgstr ""
519  
520  #. type: Plain text
521 -#: en/fsck.fat.8:120
522 +#: en/fsck.fat.8:117
523  msgid "Usage error. B<fsck.fat> did not access the filesystem."
524  msgstr ""
525  
526  #. type: SH
527 -#: en/fsck.fat.8:121
528 +#: en/fsck.fat.8:118
529  #, no-wrap
530  msgid "FILES"
531  msgstr ""
532  
533  #. type: IP
534 -#: en/fsck.fat.8:122
535 +#: en/fsck.fat.8:119
536  #, no-wrap
537  msgid "fsck0000.rec, fsck0001.rec, ..."
538  msgstr ""
539  
540  #. type: Plain text
541 -#: en/fsck.fat.8:124
542 +#: en/fsck.fat.8:121
543  msgid ""
544  "When recovering from a corrupted filesystem, B<fsck.fat> dumps recovered "
545  "data into files named 'fsckNNNN.rec' in the top level directory of the "
546 @@ -519,13 +513,13 @@ msgid ""
547  msgstr ""
548  
549  #. type: SH
550 -#: en/fsck.fat.8:125 en/mkfs.fat.8:75
551 +#: en/fsck.fat.8:122 en/mkfs.fat.8:75
552  #, no-wrap
553  msgid "BUGS"
554  msgstr ""
555  
556  #. type: Plain text
557 -#: en/fsck.fat.8:127
558 +#: en/fsck.fat.8:124
559  msgid ""
560  "Does not create . and .. files where necessary. Does not remove entirely "
561  "empty directories. Should give more diagnostic messages. Undeleting files "
562 @@ -533,12 +527,12 @@ msgid ""
563  msgstr ""
564  
565  #. type: Plain text
566 -#: en/fsck.fat.8:130 en/mkfs.fat.8:80
567 +#: en/fsck.fat.8:127 en/mkfs.fat.8:80
568  msgid "B<fatlabel>(8)"
569  msgstr ""
570  
571  #. type: Plain text
572 -#: en/fsck.fat.8:135 en/mkfs.fat.8:85
573 +#: en/fsck.fat.8:132 en/mkfs.fat.8:85
574  msgid ""
575  "More information about B<fsck.fat> and B<dosfstools> can be found at "
576  "E<lt>I<http://daniel-baumann.ch/software/dosfstools/>E<gt>."
577 diff --git a/src/fsck.fat.c b/src/fsck.fat.c
578 index c073d9a..6c7fd87 100644
579 --- a/src/fsck.fat.c
580 +++ b/src/fsck.fat.c
581 @@ -108,8 +108,8 @@ int main(int argc, char **argv)
582      uint32_t free_clusters = 0;
583  
584      memset(&fs, 0, sizeof(fs));
585 -    rw = salvage_files = verify = 0;
586 -    interactive = 1;
587 +    salvage_files = verify = 0;
588 +    rw = interactive = 1;
589      check_atari();
590  
591      while ((c = getopt(argc, argv, "Aac:d:bflnprtu:vVwy")) != EOF)
592 @@ -169,7 +169,7 @@ int main(int argc, char **argv)
593         }
594      set_dos_codepage(-1);      /* set default codepage if none was given in command line */
595      if ((test || write_immed) && !rw) {
596 -       fprintf(stderr, "-t and -w require -a or -r\n");
597 +       fprintf(stderr, "-t and -w can not be used in read only mode\n");
598         exit(2);
599      }
600      if (optind != argc - 1)
601 -- 
602 1.9.1
603