summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDavide Pesavento <pesa@gentoo.org>2012-02-13 00:32:31 +0000
committerDavide Pesavento <pesa@gentoo.org>2012-02-13 00:32:31 +0000
commit859a8e9149a6c81b774e232b84a6767b861c03ca (patch)
treed4dfb852523beea96f89d933adc8d0edfba679d1 /eclass
parentDrop eutils. (diff)
downloadhistorical-859a8e9149a6c81b774e232b84a6767b861c03ca.tar.gz
historical-859a8e9149a6c81b774e232b84a6767b861c03ca.tar.bz2
historical-859a8e9149a6c81b774e232b84a6767b861c03ca.zip
eqmake4: make CONFIG manipulation more robust by using gsub in the awk script. Fixes bug #372719.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/qt4-r2.eclass25
2 files changed, 18 insertions, 13 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 041e87d2d888..09277a0c1acd 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.131 2012/02/12 21:48:58 mabi Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.132 2012/02/13 00:32:31 pesa Exp $
+
+ 13 Feb 2012; Davide Pesavento <pesa@gentoo.org> qt4-r2.eclass:
+ eqmake4: make CONFIG manipulation more robust by using gsub in the awk
+ script. Fixes bug #372719.
12 Feb 2012; Matti Bickel <mabi@gentoo.org> php-lib-r1.eclass:
always install stuff into /usr/share/php
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)" \