tools: quilt: fix perl interpreter line (#20802)
[openwrt/openwrt.git] / tools / quilt / patches / 000-relocatable.patch
1 --- a/bin/quilt.in
2 +++ b/bin/quilt.in
3 @@ -15,14 +15,22 @@ unset POSIXLY_CORRECT
4 unset GREP_OPTIONS
5
6 export TEXTDOMAIN=quilt
7 -export TEXTDOMAINDIR=@LOCALEDIR@
8
9 -: ${QUILT_DIR=@QUILT_DIR@}
10 +if test -n "$STAGING_DIR"; then
11 + export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
12 + : ${QUILT_DIR=$STAGING_DIR/../host/share/quilt} ${QUILT_LIB=$STAGING_DIR/../host/lib/quilt}
13 + : ${QUILT_ETC=$STAGING_DIR/../host/etc}
14 +else
15 + export TEXTDOMAINDIR=@LOCALEDIR@
16 + : ${QUILT_DIR=@QUILT_DIR@}
17 + : ${QUILT_ETC=@ETCDIR@}
18 +fi
19 +
20 export QUILT_DIR
21
22 if [ -z "$QUILTRC" ]
23 then
24 - for QUILTRC in $HOME/.quiltrc @ETCDIR@/quilt.quiltrc; do
25 + for QUILTRC in $HOME/.quiltrc $QUILT_ETC/quilt.quiltrc; do
26 [ -e $QUILTRC ] && break
27 done
28 export QUILTRC
29 --- a/quilt/scripts/edmail.in
30 +++ b/quilt/scripts/edmail.in
31 @@ -1,4 +1,6 @@
32 -#! @PERL@ -w
33 +#! @PERL@
34 +
35 +use warnings;
36
37 # RFCs important for this script:
38 #
39 @@ -29,7 +31,7 @@ BEGIN {
40 }
41
42 setlocale(LC_MESSAGES, "");
43 -bindtextdomain("quilt", "@LOCALEDIR@");
44 +bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/locale' : "@LOCALEDIR@");
45 textdomain("quilt");
46
47 sub _($) {
48 --- a/quilt/scripts/inspect.in
49 +++ b/quilt/scripts/inspect.in
50 @@ -6,7 +6,11 @@
51 #
52 # See the COPYING and AUTHORS files for more details.
53
54 -: ${QUILT_DIR=@QUILT_DIR@}
55 +if test -n "$STAGING_DIR"; then
56 + : ${QUILT_DIR="$STAGING_DIR/../host/share/quilt"}
57 +else
58 + : ${QUILT_DIR=@QUILT_DIR@}
59 +fi
60
61 if ! [ -r $QUILT_DIR/scripts/patchfns ]
62 then
63 --- a/quilt/scripts/patchfns.in
64 +++ b/quilt/scripts/patchfns.in
65 @@ -8,7 +8,11 @@
66 # See the COPYING and AUTHORS files for more details.
67
68 export TEXTDOMAIN=quilt
69 -export TEXTDOMAINDIR=@LOCALEDIR@
70 +if [ -n "$STAGING_DIR" ]; then
71 + export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
72 +else
73 + export TEXTDOMAINDIR=@LOCALEDIR@
74 +fi
75
76 : ${LC_CTYPE:=$LANG}
77 : ${LC_MESSAGES:=$LANG}
78 --- a/quilt/scripts/remove-trailing-ws.in
79 +++ b/quilt/scripts/remove-trailing-ws.in
80 @@ -1,4 +1,6 @@
81 -#! @PERL@ -w
82 +#! @PERL@
83 +
84 +use warnings;
85
86 # Remove trailing whitespace from modified lines in working files.
87 #
88 @@ -31,7 +33,7 @@ BEGIN {
89 }
90
91 setlocale(LC_MESSAGES, "");
92 -bindtextdomain("quilt", "@LOCALEDIR@");
93 +bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/locale' : "@LOCALEDIR@");
94 textdomain("quilt");
95
96 sub _($) {
97 --- a/Makefile.in
98 +++ b/Makefile.in
99 @@ -21,8 +21,8 @@ COLUMN := @COLUMN@
100 GETOPT := @GETOPT@
101 CP := @CP@
102 DATE := @DATE@
103 -PERL := @PERL@
104 -BASH := @BASH@
105 +PERL := /usr/bin/env perl
106 +BASH := /usr/bin/env bash
107 SHELL:= @BASH@ # It does not work if dash is used as a shell, for example
108 GREP := @GREP@
109 TAIL := @TAIL@
110 @@ -32,7 +32,7 @@ AWK := @AWK@
111 FIND := @FIND@
112 XARGS := @XARGS@
113 DIFF := @DIFF@
114 -PATCH := @PATCH@
115 +PATCH := /usr/bin/env patch
116 MKTEMP := @MKTEMP@
117 MSGMERGE := @MSGMERGE@
118 MSGFMT := @MSGFMT@
119 @@ -49,8 +49,8 @@ USE_NLS := @USE_NLS@
120 STAT_HARDLINK := @STAT_HARDLINK@
121 PATCH_WRAPPER := @PATCH_WRAPPER@
122
123 -COMPAT_SYMLINKS := @COMPAT_SYMLINKS@
124 -COMPAT_PROGRAMS := @COMPAT_PROGRAMS@
125 +COMPAT_SYMLINKS :=
126 +COMPAT_PROGRAMS :=
127
128 default: all
129
130 --- a/quilt/scripts/backup-files.in
131 +++ b/quilt/scripts/backup-files.in
132 @@ -53,7 +53,12 @@ usage ()
133 "
134 }
135
136 -: ${QUILT_DIR=@QUILT_DIR@}
137 +if test -n "$STAGING_DIR"; then
138 + : ${QUILT_DIR="$STAGING_DIR/../host/share/quilt"}
139 +else
140 + : ${QUILT_DIR=@QUILT_DIR@}
141 +fi
142 +
143 . $QUILT_DIR/scripts/utilfns
144
145 ensure_nolinks()
146 --- a/bin/guards.in
147 +++ b/bin/guards.in
148 @@ -1,4 +1,6 @@
149 -#!@PERL@ -w
150 +#!@PERL@
151 +
152 +use warnings;
153
154 # This script is free software; you can redistribute it and/or modify
155 # it under the terms of the GNU General Public License version 2 as
156 --- a/compat/date.in
157 +++ b/compat/date.in
158 @@ -1,4 +1,6 @@
159 -#! @PERL@ -w
160 +#! @PERL@
161 +
162 +use warnings;
163
164 # This script is free software; you can redistribute it and/or modify
165 # it under the terms of the GNU General Public License version 2 as
166 --- a/compat/getopt.in
167 +++ b/compat/getopt.in
168 @@ -1,4 +1,6 @@
169 -#! @PERL@ -w
170 +#! @PERL@
171 +
172 +use warnings;
173
174 # This script is free software; you can redistribute it and/or modify
175 # it under the terms of the GNU General Public License version 2 as
176 --- a/quilt/scripts/dependency-graph.in
177 +++ b/quilt/scripts/dependency-graph.in
178 @@ -1,4 +1,6 @@
179 -#!@PERL@ -w
180 +#!@PERL@
181 +
182 +use warnings;
183
184 # This script is free software; you can redistribute it and/or modify
185 # it under the terms of the GNU General Public License version 2 as