1 |
On Sunday 30 September 2012 17:44:05 Gilles Dartiguelongue wrote: |
2 |
> +# @USAGE: gnome2_disable_deprecation_warning |
3 |
|
4 |
no need for this |
5 |
|
6 |
> + for makefile in $(find "${S}" -name "Makefile.in" \ |
7 |
> + -o -name "Makefile.am" -o -name "Makefile.decl" | sort); do |
8 |
|
9 |
`local makefile` missing. also, this does not preserve quoting. you would |
10 |
have to do: |
11 |
while read makefile ; do |
12 |
... |
13 |
done < <(find ...) |
14 |
|
15 |
> + if ! grep -qE "(DISABLE_DEPRECATED|GSEAL_ENABLE)" "${makefile}"; then |
16 |
|
17 |
`grep -E` -> `egrep` |
18 |
|
19 |
> + LC_ALL=C sed -e 's:-D[A-Z_]\+_DISABLE_DEPRECATED:$(NULL):g' \ |
20 |
> + -e 's:-DGSEAL_ENABLE:$(NULL):g' \ |
21 |
> + -i "${makefile}" |
22 |
|
23 |
use -r instead of escaping. it's also more readable to split -e from the rest |
24 |
since that tends to be the meat of sed. |
25 |
LC_ALL=C sed -i -r \ |
26 |
-e '...' \ |
27 |
-e '...' \ |
28 |
"${makefile}" |
29 |
|
30 |
> + fails[$(( ${#fails[@]} + 1 ))]="${makefile}" |
31 |
|
32 |
fails+=( "${makefile}" ) |
33 |
|
34 |
> + eerror "Failed to disable deprecation warnings in $makefile" |
35 |
|
36 |
${makefile} |
37 |
|
38 |
also, if you're using eerror, this really should end in a `die`. or it should |
39 |
use ewarn. |
40 |
-mike |