diff options
Diffstat (limited to 'packagekit/NuTyX.patch')
-rw-r--r-- | packagekit/NuTyX.patch | 268 |
1 files changed, 268 insertions, 0 deletions
diff --git a/packagekit/NuTyX.patch b/packagekit/NuTyX.patch new file mode 100644 index 000000000..7bc070d43 --- /dev/null +++ b/packagekit/NuTyX.patch @@ -0,0 +1,268 @@ +--- configure.ac.old 2012-07-15 23:04:19.083000000 +0200 ++++ configure.ac 2012-07-15 23:38:18.799000001 +0200 +@@ -516,6 +516,7 @@ + AC_ARG_ENABLE(entropy, AS_HELP_STRING([--enable-entropy],[use the entropy backend]),enable_entropy=$enableval,enable_entropy=no) + AC_ARG_ENABLE(opkg, AS_HELP_STRING([--enable-opkg],[use the OPKG backend]),enable_opkg=$enableval,enable_opkg=no) + AC_ARG_ENABLE(pisi, AS_HELP_STRING([--enable-pisi],[use the PiSi backend]),enable_pisi=$enableval,enable_pisi=no) ++AC_ARG_ENABLE(pkg-get, AS_HELP_STRING([--enable-pkg-get],[use the pkg-get backend]),enable_pkg_get=$enableval,enable_pkg_get=yes) + AC_ARG_ENABLE(poldek, AS_HELP_STRING([--enable-poldek],[use the poldek backend]),enable_poldek=$enableval,enable_poldek=no) + AC_ARG_ENABLE(portage, AS_HELP_STRING([--enable-portage],[use the portage backend]),enable_portage=$enableval,enable_portage=no) + AC_ARG_ENABLE(ports, AS_HELP_STRING([--enable-ports],[use the ports backend]),enable_ports=$enableval,enable_ports=no) +@@ -536,6 +537,7 @@ + AM_CONDITIONAL(BACKEND_TYPE_ENTROPY, [test x$enable_entropy = xyes]) + AM_CONDITIONAL(BACKEND_TYPE_OPKG, [test x$enable_opkg = xyes]) + AM_CONDITIONAL(BACKEND_TYPE_PISI, [test x$enable_pisi = xyes]) ++AM_CONDITIONAL(BACKEND_TYPE_PKG_GET, [test x$enable_pkg_get = xyes]) + AM_CONDITIONAL(BACKEND_TYPE_POLDEK, [test x$enable_poldek = xyes]) + AM_CONDITIONAL(BACKEND_TYPE_PORTAGE, [test x$enable_portage = xyes]) + AM_CONDITIONAL(BACKEND_TYPE_PORTS, [test x$enable_ports = xyes]) +@@ -603,7 +605,7 @@ + AC_ARG_WITH([default_backend], + AS_HELP_STRING([--with-default-backend=<option>], + [Default backend to use +- auto,alpm,apt,aptcc,box,conary,dummy,entropy,opkg,pisi,portage,ports,slapt,smart,urpmi,yum,zif,zypp (dummy)])) ++ auto,alpm,apt,aptcc,box,conary,dummy,entropy,opkg,pisi,pkg-get,portage,ports,slapt,smart,urpmi,yum,zif,zypp (dummy)])) + # default to a sane option for the installed tool + if test x$with_default_backend = x; then + if test -f /usr/bin/yum ; then +@@ -624,6 +626,8 @@ + with_default_backend=smart + elif test -f /usr/bin/pisi ; then + with_default_backend=pisi ++ elif test -f /usr/bin/pkg-get ; then ++ with_default_backend=pkg-get + elif test -f /usr/bin/poldek ; then + with_default_backend=poldek + elif test -f /usr/bin/urpmq ; then +@@ -823,6 +827,7 @@ + backends/ports/Makefile + backends/ports/ruby_packagekit/Makefile + backends/zypp/Makefile ++backends/pkg-get/Makefile + data/Makefile + data/org.freedesktop.PackageKit.conf + data/tests/Makefile +@@ -884,6 +889,7 @@ + Entropy backend: ${enable_entropy} + OPKG backend: ${enable_opkg} + PiSi backend: ${enable_pisi} ++ pkg-get backend: ${enable_pkg_get} + poldek backend: ${enable_poldek} + Portage backend: ${enable_portage} + Ports backend: ${enable_ports} +--- backends/Makefile.am.old 2012-07-15 23:07:35.929000000 +0200 ++++ backends/Makefile.am 2012-07-15 23:08:56.864000000 +0200 +@@ -72,6 +72,10 @@ + SUBDIRS += ports + endif + ++if BACKEND_TYPE_PKG_GET ++SUBDIRS += pkg-get ++endif ++ + clean-local : + rm -f *~ + +diff -u -r -N -x .deps backends.old/pkg-get/Makefile.am backends/pkg-get/Makefile.am +--- backends.old/pkg-get/Makefile.am 1970-01-01 01:00:00.000000000 +0100 ++++ backends/pkg-get/Makefile.am 2012-07-16 05:06:28.817999996 +0200 +@@ -0,0 +1,12 @@ ++INCLUDES = \ ++ -DG_LOG_DOMAIN=\"PackageKit-pkg-get\" ++ ++plugindir = $(PK_PLUGIN_DIR) ++plugin_LTLIBRARIES = libpk_backend_pkg-get.la ++libpk_backend_pkg_get_la_SOURCES = pk-backend-pkg-get.c ++libpk_backend_pkg_get_la_LIBADD = $(PK_PLUGIN_LIBS) -lpkg-get -lcurl ++libpk_backend_pkg_get_la_LDFLAGS = -module -avoid-version ++libpk_backend_pkg_get_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) ++ ++ ++-include $(top_srcdir)/git.mk +diff -u -r -N -x .deps backends.old/pkg-get/pk-backend-pkg-get.c backends/pkg-get/pk-backend-pkg-get.c +--- backends.old/pkg-get/pk-backend-pkg-get.c 1970-01-01 01:00:00.000000000 +0100 ++++ backends/pkg-get/pk-backend-pkg-get.c 2012-07-16 05:06:15.193999996 +0200 +@@ -0,0 +1,183 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2012 piernov <piernov@piernov.org> ++ * ++ * Licensed under the GNU General Public License Version 2 ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 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 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 <gmodule.h> ++#include <glib.h> ++#include <pk-backend.h> ++ ++#include <pkg-get.h> ++ ++static void ++common_progress(int value, gpointer user_data) ++{ ++ PkBackend* backend = (PkBackend *) user_data; ++ pk_backend_set_percentage (backend, value); ++} ++ ++static void ++backend_get_updates_thread (PkBackend *backend, gpointer user_data) ++{ ++ unsigned int i,j; ++ mirList *listOfMirrors=NULL; ++ pkgList *listOfInstPackages=NULL; ++ pkgList *listOfPackages=NULL; ++ pkgInfo *pkg=NULL; ++ gchar *pkg_string = NULL; ++ listOfMirrors = getAvailableMirrors(""); ++ listOfPackages = getAvailablePackages(listOfMirrors); ++ if ( listOfPackages != NULL ) ++ { ++ listOfInstPackages=getInstalledPackages(); ++ addLockStatusToPkgList(listOfInstPackages); ++ ++ for (i=0;i<listOfInstPackages->count;i++) ++ { ++ for (j=0;j<listOfPackages->count;j++) ++ { ++ if ( ! strcmp (listOfInstPackages->pkgs[i]->name,listOfPackages->pkgs[j]->name ) ) ++ { ++ if (listOfInstPackages->pkgs[i]->isLocked==PKGET_TRUE) ++ { ++ pkg_string = pk_package_id_build(listOfInstPackages->pkgs[i]->name,"locked",NULL,listOfMirrors->mirs[listOfInstPackages->pkgs[i]->mirrorIndex]->url); ++ pk_backend_package (backend, PK_INFO_ENUM_NORMAL, pkg_string, listOfInstPackages->pkgs[i]->description); ++ break; ++ } ++ else ++ { ++ pkg=getNewestPackageFromList(listOfPackages,listOfInstPackages->pkgs[i]->name); ++ if (compareVersionString(listOfInstPackages->pkgs[i]->version,pkg->version) < 0) ++ { ++ pkg_string = pk_package_id_build(listOfInstPackages->pkgs[i]->name,pkg->version,NULL,listOfMirrors->mirs[listOfInstPackages->pkgs[i]->mirrorIndex]->url); ++ pk_backend_package (backend, PK_INFO_ENUM_NORMAL, pkg_string, listOfInstPackages->pkgs[i]->description); ++ break; ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ if (listOfMirrors!=NULL) ++ freeMirrorList(listOfMirrors); ++ if (listOfPackages !=NULL) ++ freePkgList(listOfPackages); ++ if (listOfInstPackages !=NULL) ++ freePkgList(listOfInstPackages); ++ if (pkg !=NULL) ++ freePkgInfo(pkg); ++ if (pkg_string !=NULL) ++ g_free (pkg_string); ++ ++ pk_backend_finished (backend); ++} ++ ++static void ++backend_refresh_cache_thread (PkBackend *backend, gpointer user_data) ++{ ++ mirList *listOfMirrors=NULL; ++ ++ pk_backend_set_status (backend, PK_STATUS_ENUM_REFRESH_CACHE); ++ ++ listOfMirrors = getAvailableMirrors(""); ++ ++ if (listOfMirrors!=NULL) ++ { ++ pkg_get_sync(listOfMirrors); ++ freeMirrorList(listOfMirrors); ++ } ++ ++ pk_backend_finished (backend); ++} ++ ++/* ===================================================================== */ ++ ++/** ++ * pk_backend_initialize: ++ */ ++void ++pk_backend_initialize (PkBackend *backend) ++{ ++} ++ ++/** ++ * pk_backend_destroy: ++ */ ++void ++pk_backend_destroy (PkBackend *backend) ++{ ++} ++ ++/** ++ * pk_backend_get_filters: ++ */ ++PkBitfield ++pk_backend_get_filters (PkBackend *backend) ++{ ++ return pk_bitfield_from_enums ( ++ PK_FILTER_ENUM_GUI, ++ PK_FILTER_ENUM_INSTALLED, ++ PK_FILTER_ENUM_DEVELOPMENT, ++ -1); ++} ++ ++/** ++ * pk_backend_get_updates: ++ */ ++void ++pk_backend_get_updates (PkBackend *backend, PkBitfield filters) ++{ ++ /* TODO: filters */ ++ pk_backend_thread_create (backend, backend_get_updates_thread, NULL, NULL); ++} ++ ++/** ++ * pk_backend_refresh_cache: ++ */ ++void ++pk_backend_refresh_cache (PkBackend *backend, gboolean force) ++{ ++ /* check network state */ ++ if (!pk_backend_is_online (backend)) { ++ pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline"); ++ pk_backend_finished (backend); ++ return; ++ } ++ /* FIXME: support force */ ++ pk_backend_thread_create (backend, backend_refresh_cache_thread, NULL, NULL); ++} ++ ++/** ++ * pk_backend_get_description: ++ */ ++const gchar * ++pk_backend_get_description (PkBackend *backend) ++{ ++ return "pkg-get"; ++} ++ ++/** ++ * pk_backend_get_author: ++ */ ++const gchar * ++pk_backend_get_author (PkBackend *backend) ++{ ++ return "piernov <piernov@piernov.org>"; ++} |