[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/sysadmin/shaman
From: David Arturo Palacio <dpalacio () uninorte ! edu ! co>
Date: 2010-01-13 4:48:00
Message-ID: 1263358080.255670.22932.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1073892 by davidp:
No more Apqt library.
D cmake/modules/FindApqt.cmake
A cmake/modules/FindAptPkg.cmake
M +12 -11 libshaman/BackendSelector.cmake
M +14 -4 libshaman/backends/apt/AptBackend.cpp
M +1 -1 libshaman/backends/apt/CMakeLists.txt
M +3 -2 libshaman/backends/apt/DebPackage.cpp
M +11 -5 libshaman/backends/apt/Helper.conf
M +1 -1 libshaman/backends/apt/Helper.cpp
A libshaman/backends/apt/OperationProgress.cpp [License: UNKNOWN]
A libshaman/backends/apt/OperationProgress.h [License: UNKNOWN]
--- trunk/playground/sysadmin/shaman/libshaman/BackendSelector.cmake #1073891:1073892
@@ -6,12 +6,12 @@
## 4.4: We leave polkit-0.9 having more priority over polkit-1. This will change \
from 4.5 on if(NOT SHAMAN_BACKEND)
macro_optional_find_package(Aqpm)
- macro_optional_find_package(Apqt)
+ macro_optional_find_package(AptPkg)
macro_optional_find_package(QPackageKit)
if (AQPM_FOUND)
set (SHAMAN_BACKEND "Aqpm")
- elseif (APQT_FOUND)
+ elseif (APTPKG_FOUND)
set (SHAMAN_BACKEND "Apt")
elseif (QPACKAGEKIT_FOUND)
set (SHAMAN_BACKEND "QPackageKit")
@@ -46,13 +46,13 @@
set (SHAMAN_BACKEND "FAKE")
endif (NOT AQPM_FOUND)
elseif (SHAMAN_BACKEND STREQUAL "APT")
- macro_optional_find_package(Apqt)
+ macro_optional_find_package(AptPkg)
- if (NOT APQT_FOUND)
- message ("WARNING: You chose the Aqpm Shaman backend but you don't have Aqpm \
installed.
- Falling back to Fake backend")
- set (SHAMAN_BACKEND "FAKE")
- endif (NOT APQT_FOUND)
+ if (NOT APTPKG_FOUND)
+ message ("WARNING: You chose the Apt Shaman backend but you don't have \
Aqpm installed. + Falling back to Fake backend")
+ set (SHAMAN_BACKEND "FAKE")
+ endif (NOT APTPKG_FOUND)
elseif (SHAMAN_BACKEND STREQUAL "QPACKAGEKIT")
macro_optional_find_package(QPackageKit)
@@ -96,17 +96,18 @@
endif (POLKITQT_FOUND)
elseif(SHAMAN_BACKEND STREQUAL "APT")
message(STATUS "Building Shaman Apt Backend")
- macro_log_feature(APQT_FOUND "Apqt" "Qt wrapper library around apt-pkg, Debian \
Advanced Package Tool." "http://wiki.debian.org/Apt" FALSE "" "Provides a backend for \
Shaman.") + macro_log_feature(APTPKG_FOUND "Apqt" "Qt wrapper library around \
apt-pkg, Debian Advanced Package Tool." "http://wiki.debian.org/Apt" FALSE "" \
"Provides a backend for Shaman.") set_source_files_properties( \
backends/apt/AptBackend.cpp PROPERTIES COMPILE_FLAGS -DQT_STATICPLUGIN )
#find_package(KDE4Workspace REQUIRED)
- include_directories(${APQT_INCLUDE_DIR})
+ include_directories(${APTPKG_INCLUDE_DIR})
set(BACKEND_SRCS
backends/apt/AptBackend.cpp
backends/apt/DebPackage.cpp
+ backends/apt/OperationProgress.cpp
)
set(BACKEND_LIBS
- ${APQT_LIBRARIES} apt-pkg
+ ${APTPKG_LIBRARIES}
)
add_subdirectory(backends/apt) #Helper
elseif(SHAMAN_BACKEND STREQUAL "QPACKAGEKIT")
--- trunk/playground/sysadmin/shaman/libshaman/backends/apt/AptBackend.cpp \
#1073891:1073892 @@ -10,6 +10,7 @@
#include "AptBackend.h"
#include "DebPackage.h"
+#include "OperationProgress.h"
#include <kicon.h>
#include <kdebug.h>
@@ -22,10 +23,11 @@
#include <apt-pkg/policy.h>
#include <apt-pkg/init.h>
-#include <apqt/operationprogress.h>
#include "shamantransactioninterface.h"
+using namespace KAuth;
+
AptBackend::AptBackend()
: Shaman::BackendInterface(), mList(0), mCache(0), mPolicy(0)
{
@@ -70,7 +72,7 @@
setAvailableProcessQueueOptions(options);
KAboutPerson person(ki18n("David Palacio"), ki18n("Maintainer"), \
"dpalacio@uninorte.edu.co", "http://bakalacio.blogspot.com/"); // TODO: Change \
package icon
- setProperties(i18n("Apt backend (not working)"), i18n("A backend that does \
nothing"), KIcon("applications-other"), + setProperties(i18n("Apt backend (not \
working)"), i18n("A backend that does almost nothing"), \
KIcon("applications-other"),
KIcon("application-x-deb"), QList<KAboutPerson>() << person, \
QStringList()); pkgInitConfig(*_config) && pkgInitSystem(*_config,_system);
setState(Shaman::Backend::Idling);
@@ -104,7 +106,7 @@
mList->ReadMainList();
MMap *m = 0;
- Apqt::OperationProgress *op = new Apqt::OperationProgress;
+ OperationProgress *op = new OperationProgress;
connect(op, SIGNAL(updated()), this, SLOT(reloadingSources()));
connect(op, SIGNAL(finished()), this, SLOT(reloadingSources()));
bool res = pkgMakeStatusCache(*mList, *op, &m, true);
@@ -226,11 +228,19 @@
void AptBackend::processQueue(const Shaman::AbstractPackage::List& packages, const \
Shaman::ProcessQueueOption::List &options) {
qDebug() << "Process queue." << packages.size() << "packages." << options.size() \
<<"options."; + Action install("org.shaman.apt.install");
+ ActionReply reply = install.execute();
+ if(reply.failed())
+ {
+ kdDebug() << "algo fallo ;)" << reply.errorCode() << \
reply.errorDescription(); + kdDebug() << (reply.type() == \
ActionReply::KAuthError) << (reply.errorCode() == ActionReply::AuthorizationDenied); \
+ } + setState(Shaman::Backend::Idling);
}
void AptBackend::reloadingSources()
{
- Apqt::OperationProgress *op = qobject_cast<Apqt::OperationProgress*>(sender());
+ OperationProgress *op = qobject_cast<OperationProgress*>(sender());
Q_ASSERT(op);
showOperationProgress(i18n("Reloading sources"), (int)op->percent());
}
--- trunk/playground/sysadmin/shaman/libshaman/backends/apt/CMakeLists.txt \
#1073891:1073892 @@ -3,6 +3,6 @@
target_link_libraries(shaman_apt_helper apt-pkg ${KDE4_KDECORE_LIBS})
kde4_install_auth_helper_files(shaman_apt_helper org.shaman.apt root)
-kde4_install_auth_actions(shaman_apt_helper Helper.conf)
+kde4_install_auth_actions(org.kde.shaman.apt Helper.conf)
install(TARGETS shaman_apt_helper DESTINATION ${LIBEXEC_INSTALL_DIR})
--- trunk/playground/sysadmin/shaman/libshaman/backends/apt/DebPackage.cpp \
#1073891:1073892 @@ -8,11 +8,12 @@
version 2 of the License, or (at your option) any later version.
*/
-#include <QtCore/QDebug>
+#include "DebPackage.h"
#include <apt-pkg/pkgcache.h>
-#include "DebPackage.h"
+#include <kdebug.h>
+
#include <shamanbackendinterface.h>
DebPackage::DebPackage(Shaman::BackendInterface* parent, const QString &name,
--- trunk/playground/sysadmin/shaman/libshaman/backends/apt/Helper.conf \
#1073891:1073892 @@ -1,5 +1,11 @@
- [org.shaman.apt.update]
- Name=Update
- Description=Update package index
- Policy=auth_admin
- Persistence=session
+[org.kde.shaman.apt.install]
+Name=Install packages
+Description=Install packages
+Policy=auth_admin
+Persistence=session
+
+[org.kde.shaman.apt.update]
+Name=Update package index
+Description=Update package index
+Policy=auth_admin
+Persistence=session
--- trunk/playground/sysadmin/shaman/libshaman/backends/apt/Helper.cpp \
#1073891:1073892 @@ -52,4 +52,4 @@
return ActionReply::HelperErrorReply;
}
-KDE4_AUTH_HELPER_MAIN("org.shaman.apt", AptHelper)
\ No newline at end of file
+KDE4_AUTH_HELPER_MAIN("org.kde.shaman.apt", AptHelper)
\ No newline at end of file
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic