From 098d7549c17919683a5ba1600f1fd9b6c3bc420f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 3 Sep 2019 14:21:52 +0200 Subject: Android: Fix architecture extraction from file path in androiddeployqt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The regular expression was too greedy with the ".*" sub-expression, thus if the prefix path contained underscores, the extracted architecture value was wrong. Example prefix: ~/dev/qt/qt514_built_android/qtbase Example captured architecture: built_android/qtbase/plugins/platforms/android/libqtforandroid_x86 First extract the file name from the given path, and then match on just the file name. Change-Id: I8e56e56747096c7a2398e959d91c2d1f65de2495 Reviewed-by: Jörg Bornemann --- src/tools/androiddeployqt/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 206c0ff374..794e3b49ae 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -314,8 +314,10 @@ static QString shellQuote(const QString &arg) QString architecureFromName(const QString &name) { + const QFileInfo fi(name); + const QString extractedFileName = fi.fileName(); QRegExp architecture(QStringLiteral(".*_(.*)\\.so")); - if (!architecture.exactMatch(name)) + if (!architecture.exactMatch(extractedFileName)) return {}; return architecture.capturedTexts().last(); } -- cgit v1.2.3