~ubuntu-branches/ubuntu/natty/quilt/natty

« back to all changes in this revision

Viewing changes to debian/patches/arch_all.other

  • Committer: Bazaar Package Importer
  • Author(s): Martin Quinson
  • Date: 2006-11-23 16:17:11 UTC
  • mfrom: (2.1.6 feisty)
  • Revision ID: james.westby@ubuntu.com-20061123161711-b17ess0ls8t959ca
Tags: 0.45-6
* [debian/patches/override_mail_sender_in_testsuite]
  Fix the patch to catch all occurences of 'quilt mail' since each of them
  will cause a FTBFS on misconfigured hosts (thanks to Goswin Brederlow).
  (Closes: #397285, #395482, #393985) I hope, at least.
  
* [debian/patches/doc_improvement]
  Fix some more typos in the manpages
  (Closes: #386548, #395447)

* [debian/control]
   Add procmail to suggest list to help users locating the 'formail' tool.
   (Closes: #396093)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
---
 
2
 Makefile.in                   |   31 ----
 
3
 quilt/add.in                  |    2 
 
4
 quilt/pop.in                  |    4 
 
5
 quilt/push.in                 |    2 
 
6
 quilt/remove.in               |    2 
 
7
 quilt/scripts/backup-files.in |  269 ++++++++++++++++++++++++++++++++++++++++++
 
8
 quilt/snapshot.in             |    2 
 
9
 7 files changed, 281 insertions(+), 31 deletions(-)
 
10
 
 
11
--- quilt-0.45.orig/Makefile.in
 
12
+++ quilt-0.45/Makefile.in
 
13
@@ -6,7 +6,6 @@
 
14
 prefix :=      @prefix@
 
15
 exec_prefix := @exec_prefix@
 
16
 bindir :=      @bindir@
 
17
-libdir :=      @libdir@
 
18
 datadir :=     @datadir@
 
19
 docdir :=      @docdir@
 
20
 mandir :=      $(datadir)/man
 
21
@@ -49,11 +48,6 @@
 
22
 LIBS :=                @LIBS@
 
23
 EXEEXT :=      @EXEEXT@
 
24
 
 
25
-LIBOBJS :=     $(filter $(patsubst lib/%.c,lib/%.o,$(wildcard lib/*.c)), $(patsubst %,lib/%,@LIBOBJS@))
 
26
-ifneq ($(LIBOBJS),)
 
27
-CFLAGS += -Ilib
 
28
-endif
 
29
-
 
30
 COMPAT_SYMLINKS        := @COMPAT_SYMLINKS@
 
31
 COMPAT_PROGRAMS        := @COMPAT_PROGRAMS@
 
32
 
 
33
@@ -81,7 +75,7 @@
 
34
 DIRT +=                $(QUILT_IN:%=quilt/%)
 
35
 
 
36
 SCRIPTS_IN :=  patchfns parse-patch inspect dependency-graph edmail    \
 
37
-               remove-trailing-ws
 
38
+               remove-trailing-ws backup-files
 
39
 
 
40
 SCRIPTS_SRC := $(SCRIPTS_IN:%=%.in)
 
41
 SCRIPTS :=     $(SCRIPTS_IN)
 
42
@@ -92,11 +86,6 @@
 
43
 SRC +=         $(wildcard compat/*.in) $(wildcard compat/*.sh)
 
44
 DIRT +=                $(patsubst %.in,%,$(wildcard compat/*.in)) $(COMPAT_SYMLINKS:%=compat/%)
 
45
 
 
46
-LIB_SRC :=     backup-files.c
 
47
-LIB :=         backup-files$(EXEEXT)
 
48
-SRC +=         $(LIB_SRC:%=lib/%)
 
49
-DIRT +=                lib/backup-files$(EXEEXT) $(LIB_SRC:%.c=lib/%.o)
 
50
-
 
51
 DOC_IN :=      README
 
52
 DOC_SRC :=     $(DOC_IN:%=doc/%.in)
 
53
 DOC :=         $(DOC_IN)
 
54
@@ -126,16 +115,13 @@
 
55
 # Settings for running the uninstalled version of quilt in the source tree:
 
56
 PATH :=                $(CURDIR)/bin:$(CURDIR)/compat:$(PATH)
 
57
 QUILT_DIR :=   $(CURDIR)/quilt
 
58
-QUILT_LIB :=   $(CURDIR)/lib
 
59
 QUILTRC :=     $(CURDIR)/test/test.quiltrc
 
60
-export QUILT_DIR QUILT_LIB QUILTRC
 
61
+export QUILT_DIR QUILTRC
 
62
 
 
63
 #-----------------------------------------------------------------------
 
64
 
 
65
 all : configure scripts compat $(DOC:%=doc/%) $(MAN1) mofiles
 
66
 
 
67
-$(LIB:%=lib/%) :: $(LIBOBJS)
 
68
-
 
69
 ifeq ($(USE_NLS),yes)
 
70
 mofiles : $(LINGUAS:%=po/%.mo)
 
71
 else
 
72
@@ -149,7 +135,7 @@
 
73
        $(MSGMERGE) -o $@ $@ $^
 
74
 
 
75
 scripts : $(BIN:%=bin/%) $(QUILT:%=quilt/%)                            \
 
76
-         $(SCRIPTS:%=quilt/scripts/%) $(LIB:%=lib/%)                   \
 
77
+         $(SCRIPTS:%=quilt/scripts/%)                                  \
 
78
          $(if $(PATCH_WRAPPER),bin/patch-wrapper)
 
79
 
 
80
 dist : clean $(PACKAGE)-$(VERSION).tar.gz
 
81
@@ -248,8 +234,7 @@
 
82
 $(patsubst %.in,%,$(wildcard bin/*.in quilt/*.in quilt/scripts/*.in)) :: Makefile
 
83
 % :: %.in
 
84
        @echo "$< -> $@" >&2
 
85
-       @$(SED) -e 's:@QUILT_LIB''@:$(libdir)/$(PACKAGE):g'             \
 
86
-               -e 's:@QUILT_DIR''@:$(datadir)/$(PACKAGE):g'            \
 
87
+       @$(SED) -e 's:@QUILT_DIR''@:$(datadir)/$(PACKAGE):g'            \
 
88
                -e 's:@PERL''@:$(PERL):g'                               \
 
89
                -e 's:@BASH''@:$(BASH):g'                               \
 
90
                -e 's:@PATCH''@:$(PATCH):g'                             \
 
91
@@ -260,7 +245,7 @@
 
92
                $< > $@
 
93
        @$(if $(filter-out $<,$(NON_EXEC_IN)),chmod +x $@)
 
94
 
 
95
-lib/backup-files.o :: Makefile
 
96
+#lib/backup-files.o :: Makefile
 
97
 
 
98
 configure : configure.ac aclocal.m4
 
99
        autoconf
 
100
@@ -312,9 +297,6 @@
 
101
                   $(BUILD_ROOT)$(datadir)/$(PACKAGE)/wrapper/patch
 
102
 endif
 
103
        
 
104
-       $(INSTALL) -d $(BUILD_ROOT)$(libdir)/$(PACKAGE)
 
105
-       $(INSTALL) -m 755 $(LIB:%=lib/%) $(BUILD_ROOT)$(libdir)/$(PACKAGE)/
 
106
-
 
107
        $(INSTALL) -d $(BUILD_ROOT)$(docdir)/$(PACKAGE)-$(VERSION)/
 
108
        $(INSTALL) -m 644 doc/README                                    \
 
109
                   $(BUILD_ROOT)$(docdir)/$(PACKAGE)-$(VERSION)/
 
110
@@ -349,7 +331,6 @@
 
111
 
 
112
 uninstall ::
 
113
        rm -rf $(BIN:%=$(BUILD_ROOT)$(bindir)/%)                        \
 
114
-              $(BUILD_ROOT)$(libdir)/$(PACKAGE)                        \
 
115
               $(BUILD_ROOT)$(datadir)/$(PACKAGE)                       \
 
116
               $(patsubst %,$(BUILD_ROOT)$(mandir)/man1/%,              \
 
117
                   $(notdir $(MAN1)))                                   \
 
118
@@ -374,7 +355,7 @@
 
119
 
 
120
 # Include a run-time generated list of dependencies for each test case
 
121
 test/.depend : Makefile $(TESTS)
 
122
-       @(  printf "%s : bin/quilt quilt/scripts/patchfns $(LIB:%=lib/%) $(COMPAT)\n" $(TESTS); \
 
123
+       @(  printf "%s : bin/quilt quilt/scripts/patchfns $(COMPAT)\n" $(TESTS); \
 
124
            $(AWK) 'sub(/.*\$$ *quilt /, "")                            \
 
125
                        { print FILENAME, ":", "quilt/"$$1}' $(TESTS); \
 
126
            $(AWK) 'sub(/.*\<quilt_command /, "") && ($$1 !~ /[^a-z]/)  \
 
127
--- quilt-0.45.orig/quilt/add.in
 
128
+++ quilt-0.45/quilt/add.in
 
129
@@ -121,7 +121,7 @@
 
130
                continue
 
131
        fi
 
132
 
 
133
-       if ! $QUILT_LIB/backup-files -b -s -L -B $QUILT_PC/$patch/ $SUBDIR$file
 
134
+       if ! $QUILT_DIR/scripts/backup-files -b -s -L -B $QUILT_PC/$patch/ $SUBDIR$file
 
135
        then
 
136
                printf $"Failed to back up file %s\n" "$SUBDIR$file" >&2
 
137
                status=1
 
138
--- quilt-0.45.orig/quilt/pop.in
 
139
+++ quilt-0.45/quilt/pop.in
 
140
@@ -167,7 +167,7 @@
 
141
                        status=0
 
142
                else
 
143
                        printf $"Removing patch %s\n" "$(print_patch $patch)"
 
144
-                       $QUILT_LIB/backup-files $silent -r -t -B $QUILT_PC/$patch/ -
 
145
+                       $QUILT_DIR/scripts/backup-files $silent -r -t -B $QUILT_PC/$patch/ -
 
146
                        status=$?
 
147
                fi
 
148
                remove_from_db $patch
 
149
@@ -269,7 +269,7 @@
 
150
        # of one: This will automatically be the case in the usual
 
151
        # situations, but we don't want to risk file corruption in weird
 
152
        # corner cases such as files added to a patch but not modified.
 
153
-       $QUILT_LIB/backup-files -L -s -B $QUILT_PC/$patch/ -
 
154
+       $QUILT_DIR/scripts/backup-files -L -s -B $QUILT_PC/$patch/ -
 
155
        printf $"Now at patch %s\n" "$(print_patch $patch)"
 
156
 fi
 
157
 ### Local Variables:
 
158
--- quilt-0.45.orig/quilt/push.in
 
159
+++ quilt-0.45/quilt/push.in
 
160
@@ -139,7 +139,7 @@
 
161
 {
 
162
        local patch=$1
 
163
 
 
164
-       $QUILT_LIB/backup-files $silent_unless_verbose -r -B $QUILT_PC/$patch/ -
 
165
+       $QUILT_DIR/scripts/backup-files $silent_unless_verbose -r -B $QUILT_PC/$patch/ -
 
166
 }
 
167
 
 
168
 cleanup_patch_output() {
 
169
--- quilt-0.45.orig/quilt/remove.in
 
170
+++ quilt-0.45/quilt/remove.in
 
171
@@ -86,7 +86,7 @@
 
172
        fi
 
173
 
 
174
        # Restore file from backup
 
175
-       if ! $QUILT_LIB/backup-files -r -t -s -B $QUILT_PC/$patch/ $SUBDIR$file
 
176
+       if ! $QUILT_DIR/scripts/backup-files -r -t -s -B $QUILT_PC/$patch/ $SUBDIR$file
 
177
        then
 
178
                printf $"Failed to remove file %s from patch %s\n" \
 
179
                       "$SUBDIR$file" "$(print_patch $patch)" >&2
 
180
--- /dev/null
 
181
+++ quilt-0.45/quilt/scripts/backup-files.in
 
182
@@ -0,0 +1,269 @@
 
183
+#! @BASH@
 
184
+
 
185
+set -e
 
186
+
 
187
+# File: backup-files.sh
 
188
+
 
189
+# Copyright (C) 2006 Steve Langasek <vorlon@debian.org>
 
190
+# portions Copyright (C) 2003, 2004, 2005, 2006 Andreas Gruenbacher
 
191
+# <agruen@suse.de>, SuSE Labs
 
192
+
 
193
+# This program is free software; you can redistribute it and/or modify
 
194
+# it under the terms of the GNU General Public License as published by
 
195
+# the Free Software Foundation; version 2 dated June, 1991.
 
196
+
 
197
+# This program is distributed in the hope that it will be useful, but 
 
198
+# WITHOUT ANY WARRANTY; without even the implied warranty of
 
199
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 
200
+# General Public License for more details.
 
201
+
 
202
+# You should have received a copy of the GNU General Public License 
 
203
+# along with this program;  if not, write to the Free Software
 
204
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
 
205
+# MA 02110-1301, USA.
 
206
+
 
207
+
 
208
+# Create backup files of a list of files similar to GNU patch. A path
 
209
+# name prefix and suffix for the backup file can be specified with the
 
210
+# -B and -z options.
 
211
+
 
212
+usage () {
 
213
+       progname="$1"
 
214
+       printf "Usage: %s [-B prefix] [-z suffix] [-f {file|-}] [-s] [-b|-r|-x] [-t] [-L] {file|-} ...\n"\
 
215
+       "\n"\
 
216
+       "\tCreate hard linked backup copies of a list of files\n"\
 
217
+       "\tread from standard input.\n"\
 
218
+       "\n"\
 
219
+       "\t-b\tCreate backup\n"\
 
220
+       "\t-r\tRestore the backup\n"\
 
221
+       "\t-x\tRemove backup files and empty parent directories\n"\
 
222
+       "\t-B\tPath name prefix for backup files\n"\
 
223
+       "\t-z\tPath name suffix for backup files\n"\
 
224
+       "\t-s\tSilent operation; only print error messages\n"\
 
225
+       "\t-f\tRead the filenames to process from file (- = standard input)\n"\
 
226
+       "\t-t\tTouch original files after restore (update their mtimes)\n\n"\
 
227
+       "\t-L\tEnsure that when finished, the source file has a link count of 1\n\n", \
 
228
+       "$progname"
 
229
+}
 
230
+
 
231
+link_or_copy_file() {
 
232
+       from="$1"
 
233
+       to="$2"
 
234
+       if ! ln "$from" "$to" || [ -d "$to" ]; then
 
235
+               cp -dp --remove-destination "$from" "$to"
 
236
+       fi
 
237
+}
 
238
+
 
239
+ensure_nolinks() {
 
240
+       filename="$1"
 
241
+
 
242
+       link_count=$(stat -c '%h' "$filename")
 
243
+       if [ -z "$link_count" ] || [ "$link_count" -gt 1 ]; then
 
244
+               dirname=$(dirname "$filename")
 
245
+               basename=$(basename "$filename")
 
246
+               # Temp file name is "path/to/.file.XXXXXX"
 
247
+               tmpname=$(mktemp "${dirname}/.${basename}.XXXXXX")
 
248
+               cp -dp "$filename" "$tmpname"
 
249
+               mv "$tmpname" "$filename"
 
250
+       fi
 
251
+}
 
252
+
 
253
+process_file() {
 
254
+       file="$1"
 
255
+       backup="${OPT_PREFIX}${file}${OPT_SUFFIX}"
 
256
+
 
257
+       if [ "$OPT_WHAT" == "backup" ]; then
 
258
+               if [ -e "$backup" ]; then
 
259
+                       rm "$backup"
 
260
+               else
 
261
+                       mkdir -p "$(dirname "$backup")"
 
262
+               fi
 
263
+               if [ ! -e "$file" ]; then
 
264
+                       $ECHO "New file $file"
 
265
+                       touch "$backup"
 
266
+                       chmod 000 "$backup"
 
267
+               else
 
268
+                       $ECHO "Copying $file"
 
269
+                       link_or_copy_file "$file" "$backup"
 
270
+                       if [ -n "$OPT_NOLINKS" ]; then
 
271
+                               ensure_nolinks "$file"
 
272
+                       fi
 
273
+                       if [ -n "OPT_TOUCH" ]; then
 
274
+                               touch "$backup"
 
275
+                       fi
 
276
+               fi
 
277
+       elif [ "$OPT_WHAT" == "restore" ]; then
 
278
+               mkdir -p "$(dirname "$file")"
 
279
+
 
280
+               if [ ! -e "$backup" ]; then
 
281
+                       return 1
 
282
+               fi
 
283
+               if [ ! -s "$backup" ]; then
 
284
+                       if [ -e "$file" ]; then
 
285
+                               rm "$file"
 
286
+                       fi
 
287
+                       $ECHO "Removing $file"
 
288
+                       rm "$backup"
 
289
+                       while [ -d "${backup%/*}" ] && ! [ -L "${backup%/*}" ]
 
290
+                       do
 
291
+                               backup="${backup%/*}"
 
292
+                               rmdir --ignore-fail-on-non-empty "$backup" 2>/dev/null
 
293
+                               if [ -d "$backup" ]; then
 
294
+                                       break
 
295
+                               fi
 
296
+                       done
 
297
+               else
 
298
+                       $ECHO "Restoring $file"
 
299
+                       if [ -e "$file" ]; then
 
300
+                               rm "$file"
 
301
+                       fi
 
302
+                       link_or_copy_file "$backup" "$file"
 
303
+                       rm "$backup"
 
304
+                       while [ -d "${backup%/*}" ] && ! [ -L "${backup%/*}" ]
 
305
+                       do
 
306
+                               backup="${backup%/*}"
 
307
+                               rmdir --ignore-fail-on-non-empty "$backup" 2>/dev/null
 
308
+                               if [ -d "$backup" ]; then
 
309
+                                       break
 
310
+                               fi
 
311
+                       done
 
312
+                       if [ -n "$OPT_NOLINKS" ]; then
 
313
+                               ensure_nolinks "$file"
 
314
+                       fi
 
315
+                       if [ -n "$OPT_TOUCH" ]; then
 
316
+                               touch "$file"
 
317
+                       fi
 
318
+               fi
 
319
+       elif [ "$OPT_WHAT" == "remove" ]; then
 
320
+               if [ -e "$backup" ]; then
 
321
+                       rm "$backup"
 
322
+               fi
 
323
+               while [ -d "${backup%/*}" ] && ! [ -L "${backup%/*}" ]
 
324
+               do
 
325
+                       backup="${backup%/*}"
 
326
+                       rmdir --ignore-fail-on-non-empty "$backup" 2>/dev/null
 
327
+                       if [ -d "$backup" ]; then
 
328
+                               break
 
329
+                       fi
 
330
+               done
 
331
+       elif [ "$OPT_WHAT" == "noop" ]; then
 
332
+               if [ -e "$file" ] && [ -n "$OPT_NOLINKS" ]; then
 
333
+                       ensure_nolinks "$file"
 
334
+               fi
 
335
+       else
 
336
+               return 1
 
337
+       fi
 
338
+}
 
339
+
 
340
+walk() {
 
341
+       path="$1"
 
342
+       if [ ! -f "$path" ]; then
 
343
+               return 0
 
344
+       fi
 
345
+
 
346
+       if [ "${path#$OPT_PREFIX}" == "$path" ]
 
347
+       then
 
348
+               # prefix does not match
 
349
+               return 0
 
350
+       fi
 
351
+       path="${path#$OPT_PREFIX}"
 
352
+
 
353
+       if [ -n "$OPT_SUFFIX" ] && [ "${path%$OPT_SUFFIX}" == "$path" ]
 
354
+       then
 
355
+               # suffix does not match
 
356
+               return 0
 
357
+       fi
 
358
+       path="${path%$OPT_SUFFIX}"
 
359
+
 
360
+       process_file "$path"
 
361
+}
 
362
+
 
363
+
 
364
+ECHO=echo
 
365
+declare -a FILELIST
 
366
+progname="$0"
 
367
+while [ $# -gt 0 ]; do
 
368
+       case $1 in
 
369
+       -b)     OPT_WHAT=backup
 
370
+               ;;
 
371
+       -r)     OPT_WHAT=restore
 
372
+               ;;
 
373
+       -x)     OPT_WHAT=remove
 
374
+               ;;
 
375
+       -B)     OPT_PREFIX=$2
 
376
+               shift
 
377
+               ;;
 
378
+       -f)     OPT_FILE=$2
 
379
+               shift
 
380
+               ;;
 
381
+       -z)     OPT_SUFFIX=$2
 
382
+               shift
 
383
+               ;;
 
384
+       -s)     ECHO=:
 
385
+               ;;
 
386
+       -L)     OPT_NOLINKS=1
 
387
+               ;;
 
388
+       -t)     OPT_TOUCH=1
 
389
+               ;;
 
390
+       -?*)    usage "$progname"
 
391
+               exit 0
 
392
+               ;;
 
393
+       *)      FILELIST=($1)
 
394
+               ;;
 
395
+       esac
 
396
+
 
397
+        shift
 
398
+done
 
399
+
 
400
+if [ -z "${OPT_PREFIX}${OPT_SUFFIX}" ]; then
 
401
+       usage "$progname"
 
402
+       exit 1
 
403
+fi
 
404
+if [ ${#FILELIST[@]} == 0 ] && [ -z "$OPT_FILE" ]; then
 
405
+       usage "$progname"
 
406
+       exit 1
 
407
+fi
 
408
+
 
409
+if [ -n "$OPT_FILE" ]; then
 
410
+       cat "$OPT_FILE" \
 
411
+       | while read nextfile; do
 
412
+               process_file "$nextfile"
 
413
+       done
 
414
+fi
 
415
+
 
416
+I=0
 
417
+while [ $I -lt ${#FILELIST[@]} ]; do
 
418
+
 
419
+       case "${FILELIST[$I]}" in
 
420
+       -)
 
421
+               path="${OPT_PREFIX%/*}"
 
422
+               if ! [ -n "$path" ] && [ -d "$path" ] ; then
 
423
+                       I=$(($I+1))
 
424
+                       continue
 
425
+               fi
 
426
+
 
427
+               find "$path" -mindepth 1 \( -type f -o -type d \) -print 2>/dev/null \
 
428
+               | while read
 
429
+               do
 
430
+                       if [ -d "$REPLY" ]
 
431
+                       then
 
432
+                               if ! [ -r "$REPLY" ] || ! [ -x "$REPLY" ]
 
433
+                               then
 
434
+                                       echo "$REPLY: Permission denied"
 
435
+                                       exit 1
 
436
+                               fi
 
437
+                       else
 
438
+                               walk "$REPLY"
 
439
+                       fi
 
440
+               done
 
441
+               if [ $? != 0 ]; then
 
442
+                       exit 1
 
443
+               fi
 
444
+               ;;
 
445
+       *)
 
446
+               process_file "${FILELIST[$I]}"
 
447
+               ;;
 
448
+       esac
 
449
+               
 
450
+       I=$(($I+1))
 
451
+done
 
452
--- quilt-0.45.orig/quilt/snapshot.in
 
453
+++ quilt-0.45/quilt/snapshot.in
 
454
@@ -85,7 +85,7 @@
 
455
        }
 
456
        { print }
 
457
 ' \
 
458
-| $QUILT_LIB/backup-files -b -s -L -f - -B "$QUILT_PC/$snap_subdir/"
 
459
+| $QUILT_DIR/scripts/backup-files -b -s -L -f - -B "$QUILT_PC/$snap_subdir/"
 
460
 
 
461
 ### Local Variables:
 
462
 ### mode: shell-script