diff options
author | Davide Pesavento <pesa@gentoo.org> | 2012-02-13 00:32:31 +0000 |
---|---|---|
committer | Davide Pesavento <pesa@gentoo.org> | 2012-02-13 00:32:31 +0000 |
commit | cf4f06241f2451713aff166f4d2563a177f04c29 (patch) | |
tree | 589241a14f006c44e0f7dcda045a5f25be6d1fd7 /eclass/qt4-r2.eclass | |
parent | Drop eutils. (diff) | |
download | gentoo-2-cf4f06241f2451713aff166f4d2563a177f04c29.tar.gz gentoo-2-cf4f06241f2451713aff166f4d2563a177f04c29.tar.bz2 gentoo-2-cf4f06241f2451713aff166f4d2563a177f04c29.zip |
eqmake4: make CONFIG manipulation more robust by using gsub in the awk script. Fixes bug #372719.
Diffstat (limited to 'eclass/qt4-r2.eclass')
-rw-r--r-- | eclass/qt4-r2.eclass | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/eclass/qt4-r2.eclass b/eclass/qt4-r2.eclass index d6231bb84026..3406c62aa7e0 100644 --- a/eclass/qt4-r2.eclass +++ b/eclass/qt4-r2.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.16 2011/12/28 10:57:38 pesa Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.17 2012/02/13 00:32:31 pesa Exp $ # @ECLASS: qt4-r2.eclass # @MAINTAINER: @@ -218,33 +218,35 @@ eqmake4() { fi local awkscript='BEGIN { printf "### eqmake4 was here ###\n" > file; + printf "CONFIG -= debug_and_release %s\n", remove >> file; + printf "CONFIG += %s\n\n", add >> file; fixed=0; } /^[[:blank:]]*CONFIG[[:blank:]]*[\+\*]?=/ { - for (i=1; i <= NF; i++) { - if ($i ~ rem || $i ~ /debug_and_release/) - { $i=add; fixed=1; } + if (gsub("\\<((" remove ")|(debug_and_release))\\>", "") > 0) { + fixed=1; } } /^[[:blank:]]*CONFIG[[:blank:]]*-=/ { - for (i=1; i <= NF; i++) { - if ($i ~ add) { $i=rem; fixed=1; } + if (gsub("\\<" add "\\>", "") > 0) { + fixed=1; } } { print >> file; } END { - printf "\nCONFIG -= debug_and_release %s\n", rem >> file; - printf "CONFIG += %s\n", add >> file; print fixed; }' local file= while read file; do grep -q '^### eqmake4 was here ###$' "${file}" && continue local retval=$({ - rm -f "${file}" || echo "FAILED" - awk -v file="${file}" -- "${awkscript}" add=${CONFIG_ADD} rem=${CONFIG_REMOVE} || echo "FAILED" + rm -f "${file}" || echo FAIL + awk -v file="${file}" \ + -v add=${CONFIG_ADD} \ + -v remove=${CONFIG_REMOVE} \ + -- "${awkscript}" || echo FAIL } < "${file}") if [[ ${retval} == 1 ]]; then einfo " - fixed CONFIG in ${file}" @@ -258,7 +260,6 @@ eqmake4() { "${EPREFIX}"/usr/bin/qmake \ -makefile \ - -config ${CONFIG_ADD} \ QTDIR="${EPREFIX}"/usr/$(get_libdir) \ QMAKE="${EPREFIX}"/usr/bin/qmake \ QMAKE_CC="$(tc-getCC)" \ |