Skip to content

Commit

Permalink
Android: Fix architecture extraction from file path in androiddeployqt
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
alcroito committed Sep 3, 2019
1 parent f00e326 commit 098d754
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/androiddeployqt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 098d754

Please sign in to comment.