Skip to content

Commit

Permalink
Revert "Let "qmake -install qinstall" set default permissions 0644 an…
Browse files Browse the repository at this point in the history
…d 0755"

This reverts commit 3cdf460.

It seems change is causing regression & is reverted now to be able to
proceed with releases

Task-number: QTBUG-74912
Change-Id: Ib2365b96ee98fbbcc8853cc7f8726c157c1913a7
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
jaheikk committed Apr 4, 2019
1 parent 18e4cf2 commit a0b5d6e
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions qmake/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,25 +260,31 @@ static int installFile(const QString &source, const QString &target, bool exe =
return 3;
}

QFileDevice::Permissions targetPermissions = QFileDevice::ReadOwner | QFileDevice::WriteOwner
| QFileDevice::ReadUser | QFileDevice::WriteUser
| QFileDevice::ReadGroup | QFileDevice::ReadOther;
if (exe) {
targetPermissions |= QFileDevice::ExeOwner | QFileDevice::ExeUser |
QFileDevice::ExeGroup | QFileDevice::ExeOther;
}
if (!targetFile.setPermissions(targetPermissions)) {
fprintf(stderr, "Error setting permissions on %s: %s\n",
qPrintable(target), qPrintable(targetFile.errorString()));
return 3;
if (!targetFile.setPermissions(sourceFile.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeUser |
QFileDevice::ExeGroup | QFileDevice::ExeOther)) {
fprintf(stderr, "Error setting execute permissions on %s: %s\n",
qPrintable(target), qPrintable(targetFile.errorString()));
return 3;
}
}

// Copy file times
QString error;
#ifdef Q_OS_WIN
const QFile::Permissions permissions = targetFile.permissions();
const bool readOnly = !(permissions & QFile::WriteUser);
if (readOnly)
targetFile.setPermissions(permissions | QFile::WriteUser);
#endif
if (!IoUtils::touchFile(target, sourceFile.fileName(), &error)) {
fprintf(stderr, "%s", qPrintable(error));
return 3;
}
#ifdef Q_OS_WIN
if (readOnly)
targetFile.setPermissions(permissions);
#endif
return 0;
}

Expand Down

0 comments on commit a0b5d6e

Please sign in to comment.