Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dario Freddi <drf@kde.org>
- Loading branch information
Showing
7 changed files
with
371 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
[Domain] | ||
Name=Chakra Package Management | ||
Icon=chakra-shiny | ||
|
||
[org.chakraproject.aqpm.updatedatabase] | ||
Name=Update Database | ||
Description=Prevents the Package Manager from updating the Database | ||
Policy=auth_admin | ||
|
||
[org.chakraproject.aqpm.systemupgrade] | ||
Name=System Upgrade | ||
Description=Prevents the Package Manager from upgrading the system | ||
Policy=auth_admin | ||
Persistence=session | ||
|
||
[org.chakraproject.aqpm.processqueue] | ||
Name=Process queue | ||
Description=Prevents the Package Manager from processing a package queue | ||
Policy=auth_admin | ||
|
||
[org.chakraproject.aqpm.downloadqueue] | ||
Name=Process queue | ||
Description=Prevents the Package Manager from downloading a package queue | ||
Policy=yes | ||
|
||
[org.chakraproject.aqpm.saveconfiguration] | ||
Name=Save pacman configuration | ||
Description=Prevents the Package Manager from saving the configuration | ||
Policy=auth_admin | ||
|
||
[org.chakraproject.aqpm.convertconfiguration] | ||
Name=Convert pacman configuration | ||
Description=Prevents the Package Manager from converting Pacman configuration to Aqpm | ||
Policy=yes | ||
|
||
[org.chakraproject.aqpm.setmirrorlist] | ||
Name=Sets Aqpm mirrors | ||
Description=Prevents the Package Manager from modifying the mirrors | ||
Policy=auth_admin | ||
Persistence=always | ||
|
||
[org.chakraproject.aqpm.performmaintenance] | ||
Name=Performs a maintenance operation on the package system | ||
Description=Prevents the Package Manager from performing a maintenance action | ||
Policy=auth_admin | ||
|
||
[org.chakraproject.aqpm.setaqpmroot] | ||
Name=Changes the root directory for package management | ||
Description=Prevents the Package Manager from changing the root directory for package management | ||
Policy=yes | ||
|
||
[org.chakraproject.aqpm.retrievetargetsforqueue] | ||
Name=Retrieves additional targets for a queue | ||
Description=Prevents the Package Manager from retrieving additional targets for the current queue | ||
Policy=yes | ||
|
||
[org.chakraproject.aqpm.updateabs] | ||
Name=Updates the Abs tree | ||
Description=Prevents the Package Manager from updating the Abs tree | ||
Policy=auth_admin | ||
Persistence=session | ||
|
||
[org.chakraproject.aqpm.preparebuildenvironment] | ||
Name=Prepares a build environment in a privileged location | ||
Description=Prevents the Package Manager from preparing a build environment in a privileged location | ||
Policy=auth_admin |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright (C) 2008 Nicola Gigante <nicola.gigante@gmail.com> | ||
* Copyright (C) 2009 Dario Freddi <drf@kde.org> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the | ||
* Free Software Foundation, Inc., | ||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . | ||
*/ | ||
|
||
#include "policy-gen.h" | ||
|
||
#include <cstdio> | ||
#include <QDebug> | ||
#include <QTextStream> | ||
|
||
const char header[] = "" | ||
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" | ||
"<!DOCTYPE policyconfig PUBLIC\n" | ||
"\"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN\"\n" | ||
"\"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd\">\n" | ||
"<policyconfig>\n"; | ||
|
||
const char policy_tag[] = "" | ||
" <defaults>\n" | ||
" <allow_inactive>no</allow_inactive>\n" | ||
" <allow_active>%1</allow_active>\n" | ||
" </defaults>\n"; | ||
|
||
const char dent[] = " "; | ||
|
||
void output(QList<Action> actions, QHash<QString, QString> domain) | ||
{ | ||
QTextStream out(stdout); | ||
|
||
out << header; | ||
|
||
if (domain.contains("vendor")) { | ||
out << "<vendor>" << domain["vendor"] << "</vendor>\n"; | ||
} | ||
if (domain.contains("vendorurl")) { | ||
out << "<vendor_url>" << domain["vendorurl"] << "</vendor_url>\n"; | ||
} | ||
if (domain.contains("icon")) { | ||
out << "<icon_name>" << domain["icon"] << "</icon_name>\n"; | ||
} | ||
|
||
foreach (const Action &action, actions) { | ||
out << dent << "<action id=\"" << action.name << "\" >\n"; | ||
|
||
foreach (const QString &lang, action.descriptions.keys()) { | ||
out << dent << dent << "<description"; | ||
if (lang != "en") | ||
out << " xml:lang=\"" << lang << '"'; | ||
out << '>' << action.messages.value(lang) << "</description>\n"; | ||
} | ||
|
||
foreach (const QString &lang, action.messages.keys()) { | ||
out << dent << dent << "<message"; | ||
if (lang != "en") { | ||
out << " xml:lang=\"" << lang << '"'; | ||
} | ||
out << '>' << action.descriptions.value(lang) << "</message>\n"; | ||
} | ||
|
||
QString policy = action.policy; | ||
if (!action.persistence.isEmpty() && policy != "yes" && policy != "no") { | ||
policy += "_keep"; | ||
} | ||
|
||
out << QString(policy_tag).arg(policy); | ||
|
||
out << dent << "</action>\n"; | ||
} | ||
|
||
out << "</policyconfig>\n"; | ||
} |
Oops, something went wrong.