Sort generated qrc
For reproducible builds (https://reproducible-builds.org) Sadly I don't have a particularly strong reproducer for this problem, but testing manually with disorderfs and inspecting the results \_suggests\_ this does the trick. BUG: 508718
This commit is contained in:
parent
bf46b2777d
commit
0c7550acd8
@ -137,16 +137,10 @@ static QString resolveWindowsGitLink(const QString &path, const QString &fileNam
|
|||||||
*/
|
*/
|
||||||
static void generateQRCAndCheckInputs(const QStringList &indirs, const QString &outfile)
|
static void generateQRCAndCheckInputs(const QStringList &indirs, const QString &outfile)
|
||||||
{
|
{
|
||||||
QFile out(outfile);
|
|
||||||
if (!out.open(QIODevice::WriteOnly)) {
|
|
||||||
qFatal() << "Failed to create" << outfile;
|
|
||||||
}
|
|
||||||
out.write("<!DOCTYPE RCC><RCC version=\"1.0\">\n");
|
|
||||||
out.write("<qresource>\n");
|
|
||||||
|
|
||||||
// loop over the inputs, remember if we do look at generated stuff for checks
|
// loop over the inputs, remember if we do look at generated stuff for checks
|
||||||
bool generatedIcons = false;
|
bool generatedIcons = false;
|
||||||
QSet<QString> checkedFiles, filesInResource;
|
QSet<QString> checkedFiles, filesInResource;
|
||||||
|
QList<QString> lines;
|
||||||
bool themeFileFound = false, icons24Seen = false;
|
bool themeFileFound = false, icons24Seen = false;
|
||||||
for (const auto &indir : indirs) {
|
for (const auto &indir : indirs) {
|
||||||
// go to input dir to have proper relative paths
|
// go to input dir to have proper relative paths
|
||||||
@ -220,8 +214,7 @@ static void generateQRCAndCheckInputs(const QStringList &indirs, const QString &
|
|||||||
themeFileFound = true;
|
themeFileFound = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// write the one alias to file entry
|
lines.append(QStringLiteral(" <file alias=\"%1\">%2</file>\n").arg(file, fullPath));
|
||||||
out.write(QStringLiteral(" <file alias=\"%1\">%2</file>\n").arg(file, fullPath).toUtf8());
|
|
||||||
|
|
||||||
// remember for checks below
|
// remember for checks below
|
||||||
filesInResource.insert(file);
|
filesInResource.insert(file);
|
||||||
@ -234,6 +227,19 @@ static void generateQRCAndCheckInputs(const QStringList &indirs, const QString &
|
|||||||
generatedIcons = true;
|
generatedIcons = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write the resource file
|
||||||
|
QFile out(outfile);
|
||||||
|
if (!out.open(QIODevice::WriteOnly)) {
|
||||||
|
qFatal() << "Failed to create" << outfile;
|
||||||
|
}
|
||||||
|
out.write("<!DOCTYPE RCC><RCC version=\"1.0\">\n");
|
||||||
|
out.write("<qresource>\n");
|
||||||
|
|
||||||
|
std::sort(lines.begin(), lines.end());
|
||||||
|
for (const auto &line : lines) {
|
||||||
|
out.write(line.toUtf8());
|
||||||
|
}
|
||||||
|
|
||||||
out.write("</qresource>\n");
|
out.write("</qresource>\n");
|
||||||
out.write("</RCC>\n");
|
out.write("</RCC>\n");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user