commit: 5b08292e3afad53c40404bd908e2512f6506191e
Author: Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 16 17:04:33 2015 +0000
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Thu Apr 16 17:04:58 2015 +0000
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=5b08292e
[eclass] Don't try to remove a dep if it doesn't exist.
eclass/kde5-functions.eclass | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/eclass/kde5-functions.eclass b/eclass/kde5-functions.eclass
index d618368..1b27934 100644
--- a/eclass/kde5-functions.eclass
+++ b/eclass/kde5-functions.eclass
@@ -219,6 +219,12 @@ punt_bogus_dep() {
local dep=${2}
pcregrep -Mn "(?s)find_package\(\s*${prefix}.[^)]*?${dep}.*?\)"
CMakeLists.txt > "${T}/bogus${dep}"
+
+ # pcregrep returns non-zero on no matches/error
+ if [[ $? != 0 ]] ; then
+ return
+ fi
+
local length=$(wc -l "${T}/bogus${dep}" | cut -d " " -f 1)
local first=$(head -n 1 "${T}/bogus${dep}" | cut -d ":" -f 1)
local last=$(( ${length} + ${first} - 1))