SHA256
1
0
forked from pool/kauth
Hrvoje Senjan 2015-06-13 08:42:08 +00:00 committed by Git OBS Bridge
parent 14852953ef
commit 1d260c36e9
2 changed files with 2 additions and 128 deletions

View File

@ -1,128 +0,0 @@
From dbd50f94d0f5a794f89a537692973edab38d694d Mon Sep 17 00:00:00 2001
From: Hrvoje Senjan <hrvoje.senjan@gmail.com>
Date: Mon, 20 Apr 2015 02:29:19 +0200
Subject: [PATCH 1/1] Create reproducible builds
By using QHash we get randomness on each build of policy files, which is definately not needed for names, comments and descriptions. With QMap we get nice alphabetic
sorting, and builds of packages that use kauth_install_actions macro have identical builds.
REVIEW: 123430
---
src/backends/polkit-1/kauth-policy-gen-polkit1.cpp | 16 ++++++++--------
src/policy-gen/policy-gen.cpp | 6 +++---
src/policy-gen/policy-gen.h | 6 +++---
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/backends/polkit-1/kauth-policy-gen-polkit1.cpp b/src/backends/polkit-1/kauth-policy-gen-polkit1.cpp
index 2dfd6beb59fc99437b726181e2dbba2bb436c36a..b3a706e0e3bb8c2772f7ae4edec7f93d6a270ac3 100644
--- a/src/backends/polkit-1/kauth-policy-gen-polkit1.cpp
+++ b/src/backends/polkit-1/kauth-policy-gen-polkit1.cpp
@@ -39,7 +39,7 @@ const char policy_tag[] = ""
const char dent[] = " ";
-void output(QList<Action> actions, QHash<QString, QString> domain)
+void output(QList<Action> actions, QMap<QString, QString> domain)
{
QTextStream out(stdout);
out.setCodec("UTF-8");
@@ -47,11 +47,11 @@ void output(QList<Action> actions, QHash<QString, QString> domain)
out << header;
// Blacklisted characters + replacements
- QHash< QChar, QString > blacklist;
+ QMap< QChar, QString > blacklist;
blacklist.insert(QLatin1Char('&'), QLatin1String("&amp;"));
if (domain.contains(QLatin1String("vendor"))) {
- QHash< QChar, QString >::const_iterator blI;
+ QMap< QChar, QString >::const_iterator blI;
QString vendor = domain[QLatin1String("vendor")];
for (blI = blacklist.constBegin(); blI != blacklist.constEnd(); ++blI) {
vendor.replace(blI.key(), blI.value());
@@ -69,13 +69,13 @@ void output(QList<Action> actions, QHash<QString, QString> domain)
out << dent << "<action id=\"" << action.name << "\" >\n";
// Not a typo, messages and descriptions are actually inverted
- for (QHash< QString, QString >::const_iterator i = action.messages.constBegin(); i != action.messages.constEnd(); ++i) {
+ for (QMap< QString, QString >::const_iterator i = action.messages.constBegin(); i != action.messages.constEnd(); ++i) {
out << dent << dent << "<description";
if (i.key() != QLatin1String("en")) {
out << " xml:lang=\"" << i.key() << '"';
}
- QHash< QChar, QString >::const_iterator blI;
+ QMap< QChar, QString >::const_iterator blI;
QString description = i.value();
for (blI = blacklist.constBegin(); blI != blacklist.constEnd(); ++blI) {
description.replace(blI.key(), blI.value());
@@ -84,8 +84,8 @@ void output(QList<Action> actions, QHash<QString, QString> domain)
out << '>' << description << "</description>\n";
}
- QHash< QString, QString >::const_iterator i;
- for (QHash< QString, QString >::const_iterator i = action.descriptions.constBegin();
+ QMap< QString, QString >::const_iterator i;
+ for (QMap< QString, QString >::const_iterator i = action.descriptions.constBegin();
i != action.descriptions.constEnd();
++i) {
out << dent << dent << "<message";
@@ -93,7 +93,7 @@ void output(QList<Action> actions, QHash<QString, QString> domain)
out << " xml:lang=\"" << i.key() << '"';
}
- QHash< QChar, QString >::const_iterator blI;
+ QMap< QChar, QString >::const_iterator blI;
QString message = i.value();
for (blI = blacklist.constBegin(); blI != blacklist.constEnd(); ++blI) {
message.replace(blI.key(), blI.value());
diff --git a/src/policy-gen/policy-gen.cpp b/src/policy-gen/policy-gen.cpp
index 99bb0855fa8e9543f45286c4595fdd984ab663b8..9f77af994053982772d64be03aa4162562458068 100644
--- a/src/policy-gen/policy-gen.cpp
+++ b/src/policy-gen/policy-gen.cpp
@@ -33,7 +33,7 @@
using namespace std;
QList<Action> parse(QSettings &ini);
-QHash<QString, QString> parseDomain(QSettings &ini);
+QMap<QString, QString> parseDomain(QSettings &ini);
int main(int argc, char **argv)
{
@@ -151,9 +151,9 @@ QList<Action> parse(QSettings &ini)
return actions;
}
-QHash<QString, QString> parseDomain(QSettings &ini)
+QMap<QString, QString> parseDomain(QSettings &ini)
{
- QHash<QString, QString> rethash;
+ QMap<QString, QString> rethash;
if (ini.childGroups().contains(QString::fromLatin1("Domain"))) {
if (ini.contains(QString::fromLatin1("Domain/Name"))) {
diff --git a/src/policy-gen/policy-gen.h b/src/policy-gen/policy-gen.h
index 5bdda1cffcfbf9a2220d3f85f0b5ca621a9d26f5..113d59b1731a4d1028e4e7be48955fba42e14d57 100644
--- a/src/policy-gen/policy-gen.h
+++ b/src/policy-gen/policy-gen.h
@@ -28,14 +28,14 @@
struct Action {
QString name;
- QHash<QString, QString> descriptions;
- QHash<QString, QString> messages;
+ QMap<QString, QString> descriptions;
+ QMap<QString, QString> messages;
QString policy;
QString policyInactive;
QString persistence;
};
-extern void output(QList<Action> actions, QHash<QString, QString> domain);
+extern void output(QList<Action> actions, QMap<QString, QString> domain);
#endif
--
2.3.5

View File

@ -2,8 +2,10 @@
Sun Jun 7 19:07:11 UTC 2015 - hrvoje.senjan@gmail.com
- Update to 5.11.0
* Make KAUTH_HELPER_INSTALL_ABSOLUTE_DIR available to all KAuth users
* For more details please see:
https://www.kde.org/announcements/kde-frameworks-5.11.0.php
- Drop 0001-Create-reproducible-builds.patch, merged upstream
-------------------------------------------------------------------
Sun May 3 19:49:43 UTC 2015 - hrvoje.senjan@gmail.com