[PackageKit-commit] packagekit: Branch 'master' - 22 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Fri Nov 27 09:59:36 PST 2009
client/pk-generate-pack.c | 17 ++
docs/example.catalog | 6
docs/html/pk-faq.html | 21 ++-
docs/html/upload.sh | 1
lib/packagekit-glib/pk-version.h.in | 45 ------
lib/packagekit-glib2/pk-catalog.c | 21 ++-
lib/packagekit-glib2/pk-common.c | 216 -------------------------------
lib/packagekit-glib2/pk-common.h | 2
lib/packagekit-glib2/pk-control.c | 34 ++++
lib/packagekit-glib2/pk-service-pack.c | 33 ++++
lib/packagekit-glib2/pk-task.c | 2
lib/packagekit-glib2/pk-version.h.in | 45 ++++++
lib/packagekit-qt/src/Makefile.am | 1
lib/packagekit-qt/src/client.cpp | 19 ++
lib/packagekit-qt/src/client.h | 9 +
lib/packagekit-qt/src/daemonproxy.h | 4
lib/packagekit-qt/src/package.cpp | 41 +++++
lib/packagekit-qt/src/package.h | 7 +
lib/packagekit-qt/src/transaction.cpp | 5
lib/packagekit-qt/src/transaction.h | 1
po/pl.po | 209 +++++++++++++++++-------------
src/org.freedesktop.PackageKit.xml | 13 +
src/pk-engine.c | 229 +++++++++++++++++++++++++++++++--
src/pk-transaction-extra.c | 89 +++++++-----
24 files changed, 652 insertions(+), 418 deletions(-)
New commits:
commit dbd660027f79bdadb3ce688a48b64294c9453e58
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Fri Nov 27 12:48:31 2009 -0200
Updated the Faq and example.catalog to match the new distro id
diff --git a/docs/example.catalog b/docs/example.catalog
index b044de4..2d01f85 100644
--- a/docs/example.catalog
+++ b/docs/example.catalog
@@ -5,12 +5,12 @@
InstallProvides(fedora)=audio/QCELP
# Just for Fedora 9, install two development files
-InstallPackages(fedora-9.90)=glib2-devel;PolicyKit-gnome-devel;ocaml-json-wheel-devel
+InstallPackages(fedora;9.90)=glib2-devel;PolicyKit-gnome-devel;ocaml-json-wheel-devel
# On any distro, install the package with this file
InstallFiles=/usr/bin/fontinst
# For each architecture on Fedora 8, install one of the two different files
-InstallFiles(fedora-8-i686)=/usr/lib/pango/1.6.0/modules/pango-arabic-fc.so
-InstallFiles(fedora-8-x64)=/usr/lib64/pango/1.6.0/modules/pango-arabic-fc.so
+InstallFiles(fedora;8;i686)=/usr/lib/pango/1.6.0/modules/pango-arabic-fc.so
+InstallFiles(fedora;8;x64)=/usr/lib64/pango/1.6.0/modules/pango-arabic-fc.so
diff --git a/docs/html/pk-faq.html b/docs/html/pk-faq.html
index 55dd830..8d42a3c 100644
--- a/docs/html/pk-faq.html
+++ b/docs/html/pk-faq.html
@@ -99,21 +99,21 @@ So, what does a .catalog file look like?
InstallProvides(fedora)=audio/QCELP
# Just for Fedora 9, install two development files
-InstallPackages(fedora-9)=glib2-devel;PolicyKit-gnome-devel
+InstallPackages(fedora;9)=glib2-devel;PolicyKit-gnome-devel
# On any distro, install the package with this file
InstallFiles=/usr/bin/fontinst
# For each architecture on Fedora 8, install one of the two different compat files
-InstallFiles(fedora-8-i686)=/usr/lib/pango/1.6.0/modules/pango-arabic-fc.so
-InstallFiles(fedora-8-x64)=/usr/lib64/pango/1.6.0/modules/pango-arabic-fc.so
+InstallFiles(fedora;8;i686)=/usr/lib/pango/1.6.0/modules/pango-arabic-fc.so
+InstallFiles(fedora;8;x64)=/usr/lib64/pango/1.6.0/modules/pango-arabic-fc.so
</pre>
<p>
You'll notice the <code>distro-id</code> in between the <code>()</code>'s - this lets a packager
fine tune the package name, where for instance in Debian the package is called <code>policykit</code>
and Fedora <code>PolicyKit</code>.
-You can specify a granularity of distribution, distribution-version or
-distribution-version-architecture - PackageKit will process all the entries that apply.
+You can specify a granularity of distribution, distribution;version or
+distribution;version;architecture - PackageKit will process all the entries that apply.
It's of course better to not specify a <code>()</code> if possible, as this lets the file work on
as many distributions as possible out of the box.
</p>
@@ -126,10 +126,10 @@ If there's an optional package not in earlier versions then you can do something
[PackageKit Catalog]
# Fedora 9 does not have Unique
-InstallPackages(fedora-9)=glib2-devel;PolicyKit-gnome-devel
+InstallPackages(fedora;9)=glib2-devel;PolicyKit-gnome-devel
# Rawhide is fedora 9.90
-InstallPackages(fedora-9.90)=glib2-devel;PolicyKit-gnome-devel;unique-devel
+InstallPackages(fedora;9.90)=glib2-devel;PolicyKit-gnome-devel;unique-devel
</pre>
<p>
There's also no description of the catalog that needs translating and verifying - they are just
@@ -138,6 +138,13 @@ All the translations come from the distributions metadata, and it's up to the us
package lists that are asked to be installed, so there are no signing or trust issues.
</p>
<p>
+The supported methods are InstallPackages, InstallProvides and InstallFiles. Any line
+that does not start with these key words will be descarted.
+</p>
+<p>
+InstallCatalog is also available on the session interface.
+</p>
+<p>
Note: this isn't designed to replace one click install, it just does something that is similar in
a different way.
</p>
diff --git a/docs/html/upload.sh b/docs/html/upload.sh
index 9b92984..cb549a1 100755
--- a/docs/html/upload.sh
+++ b/docs/html/upload.sh
@@ -30,4 +30,5 @@ scp api-reference-session.html $USER@$SERVER:/$LOCATION/gtk-doc/
rm api-reference-session.html
doxygen ../../lib/packagekit-qt/Doxyfile
scp ../packagekit-qt/html/* $USER@$SERVER:/$LOCATION/qt-doc/
+scp ../example.catalog $USER@$SERVER:/$LOCATION/packagekit.catalog
commit 37d420fbe55b56eb61c38eac7aac39c3f1299a1f
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 17:38:19 2009 -0200
Removed the get_distro_id test
diff --git a/lib/packagekit-glib2/pk-common.c b/lib/packagekit-glib2/pk-common.c
index 9e01e4e..10c2a39 100644
--- a/lib/packagekit-glib2/pk-common.c
+++ b/lib/packagekit-glib2/pk-common.c
@@ -174,17 +174,6 @@ pk_common_test (gpointer user_data)
return;
/************************************************************
- **************** test distro-id **************
- ************************************************************/
- egg_test_title (test, "get distro id");
- text_safe = pk_get_distro_id ();
- if (text_safe != NULL)
- egg_test_success (test, "distro_id=%s", text_safe);
- else
- egg_test_failed (test, NULL);
- g_free (text_safe);
-
- /************************************************************
************** iso8601 ****************
************************************************************/
egg_test_title (test, "get present iso8601");
commit 0187fd11625cc111c362c5e61ecd4ced8715607e
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 17:07:05 2009 -0200
packagekit-qt: fix icon loading
diff --git a/lib/packagekit-qt/src/package.cpp b/lib/packagekit-qt/src/package.cpp
index 7c50361..f5a78f6 100644
--- a/lib/packagekit-qt/src/package.cpp
+++ b/lib/packagekit-qt/src/package.cpp
@@ -193,7 +193,7 @@ QString Package::iconPath ()
while (!desktopFile.atEnd ()) {
QByteArray line = desktopFile.readLine ().trimmed ();
if (line.startsWith ("Icon=")) {
- d->iconPath = line.mid (6);
+ d->iconPath = line.mid (5);
break;
}
}
commit 4e978220fdef701261e380ab2bc936d5d7e5759d
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 15:59:40 2009 -0200
packagekit-qt: fix and update typo in docs
diff --git a/lib/packagekit-qt/src/client.h b/lib/packagekit-qt/src/client.h
index 3452650..8921257 100644
--- a/lib/packagekit-qt/src/client.h
+++ b/lib/packagekit-qt/src/client.h
@@ -272,7 +272,9 @@ public:
NetworkState getNetworkState() const;
/**
- * The distributed identifier, e.g. "debian-(squeeze/sid)".
+ * The distribution identifier in the
+ * distro;version;arch form,
+ * e.g. "debian;squeeze/sid;x86_64".
*/
QString distroId() const;
commit c3609e95c0091cc1d86e9990a9cf92fd45ff6b6d
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 15:42:08 2009 -0200
updating the o.f.p.xml description
diff --git a/src/org.freedesktop.PackageKit.xml b/src/org.freedesktop.PackageKit.xml
index bd5e281..49c702d 100644
--- a/src/org.freedesktop.PackageKit.xml
+++ b/src/org.freedesktop.PackageKit.xml
@@ -156,8 +156,9 @@
<doc:doc>
<doc:description>
<doc:para>
- The distribution identification, e.g.
- <doc:tt>"debian-(squeeze/sid)"</doc:tt>.
+ The distribution identification, in the
+ distro;version;arch form e.g.
+ <doc:tt>"debian;squeeze/sid;x86_64"</doc:tt>.
</doc:para>
</doc:description>
</doc:doc>
commit 0a488154bcbf19c6cbdf6913be1a48a53282fae0
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Nov 26 17:30:10 2009 +0000
trivial: Fix up some bugs spotted by clang
diff --git a/lib/packagekit-glib2/pk-service-pack.c b/lib/packagekit-glib2/pk-service-pack.c
index ccffe95..989bd62 100644
--- a/lib/packagekit-glib2/pk-service-pack.c
+++ b/lib/packagekit-glib2/pk-service-pack.c
@@ -145,7 +145,7 @@ pk_service_pack_check_metadata_file (const gchar *full_path, GError **error)
gchar *type = NULL;
gchar *distro_id = NULL;
gchar *distro_id_us = NULL;
- PkControl *control;
+ PkControl *control = NULL;
/* load the file */
file = g_key_file_new ();
@@ -201,7 +201,8 @@ pk_service_pack_check_metadata_file (const gchar *full_path, GError **error)
*error = g_error_new (1, 0, "distro id did not match %s == %s", distro_id_us, distro_id);
out:
- g_object_unref (control);
+ if (control != NULL)
+ g_object_unref (control);
g_key_file_free (file);
g_free (type);
g_free (distro_id);
diff --git a/lib/packagekit-glib2/pk-task.c b/lib/packagekit-glib2/pk-task.c
index 62b960d..5afb76c 100644
--- a/lib/packagekit-glib2/pk-task.c
+++ b/lib/packagekit-glib2/pk-task.c
@@ -412,7 +412,7 @@ pk_task_install_signatures (PkTaskState *state)
GError *error = NULL;
GPtrArray *array;
PkRepoSignatureRequired *item;
- gchar *key_id;
+ gchar *key_id = NULL;
gchar *package_id = NULL;
PkSigTypeEnum type;
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 77eff6c..9b289b6 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -368,7 +368,8 @@ pk_engine_get_distro_id (PkEngine *engine)
gchar *arch = NULL;
gchar *version = NULL;
gchar **split = NULL;
- gchar *distro;
+ gchar *distro = NULL;
+ gchar *distro_id = NULL;
g_return_val_if_fail (PK_IS_ENGINE (engine), NULL);
@@ -392,7 +393,7 @@ pk_engine_get_distro_id (PkEngine *engine)
goto out;
/* complete! */
- distro = g_strdup_printf ("fedora;%s;%s", split[2], arch);
+ distro_id = g_strdup_printf ("fedora;%s;%s", split[2], arch);
goto out;
}
@@ -408,7 +409,7 @@ pk_engine_get_distro_id (PkEngine *engine)
goto out;
/* complete! */
- distro = g_strdup_printf ("suse;%s-%s;%s", split[1], split[3], arch);
+ distro_id = g_strdup_printf ("suse;%s-%s;%s", split[1], split[3], arch);
goto out;
}
@@ -421,7 +422,7 @@ pk_engine_get_distro_id (PkEngine *engine)
goto out;
/* complete! */
- distro = g_strdup_printf ("foresight;%s;%s", split[2], arch);
+ distro_id = g_strdup_printf ("foresight;%s;%s", split[2], arch);
goto out;
}
@@ -434,7 +435,7 @@ pk_engine_get_distro_id (PkEngine *engine)
goto out;
/* complete! */
- distro = g_strdup_printf ("pld;%s;%s", split[0], arch);
+ distro_id = g_strdup_printf ("pld;%s;%s", split[0], arch);
goto out;
}
@@ -442,7 +443,7 @@ pk_engine_get_distro_id (PkEngine *engine)
ret = g_file_test ("/etc/arch-release", G_FILE_TEST_EXISTS);
if (ret) {
/* complete! */
- distro = g_strdup_printf ("arch;current;%s", arch);
+ distro_id = g_strdup_printf ("arch;current;%s", arch);
goto out;
}
@@ -459,7 +460,7 @@ pk_engine_get_distro_id (PkEngine *engine)
}
/* complete! */
- distro = g_strdup_printf ("%s;%s;%s", distro, version, arch);
+ distro_id = g_strdup_printf ("%s;%s;%s", distro, version, arch);
goto out;
}
@@ -472,7 +473,7 @@ pk_engine_get_distro_id (PkEngine *engine)
g_strstrip (contents);
/* complete! */
- distro = g_strdup_printf ("debian;%s;%s", contents, arch);
+ distro_id = g_strdup_printf ("debian;%s;%s", contents, arch);
goto out;
}
@@ -492,15 +493,16 @@ pk_engine_get_distro_id (PkEngine *engine)
goto out;
/* complete! */
- distro = g_strdup_printf ("freebsd;%s;%s", split[0], arch);
+ distro_id = g_strdup_printf ("freebsd;%s;%s", split[0], arch);
goto out;
}
out:
g_strfreev (split);
g_free (version);
+ g_free (distro);
g_free (arch);
g_free (contents);
- return distro;
+ return distro_id;
}
/**
commit 6407a1f5495ea004eacfd3f9e0544b6ebbe29e41
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 15:13:00 2009 -0200
Fixed one old call to get_distro_id and changed all identifiers to distro;version;arch
diff --git a/lib/packagekit-glib2/pk-service-pack.c b/lib/packagekit-glib2/pk-service-pack.c
index 3cc02a9..ccffe95 100644
--- a/lib/packagekit-glib2/pk-service-pack.c
+++ b/lib/packagekit-glib2/pk-service-pack.c
@@ -460,14 +460,27 @@ pk_service_pack_create_metadata_file (PkServicePackState *state, const gchar *fi
GError *error = NULL;
GKeyFile *file = NULL;
gchar *data = NULL;
+ PkControl *control;
+ GError *error_local = NULL;
g_return_val_if_fail (state->filename != NULL, FALSE);
g_return_val_if_fail (state->type != PK_SERVICE_PACK_TYPE_UNKNOWN, FALSE);
file = g_key_file_new ();
+ /* get this system id */
+ control = pk_control_new ();
+ ret = pk_control_get_properties (control, NULL, &error_local);
+ if (!ret) {
+ egg_error ("Failed to contact PackageKit: %s", error_local->message);
+ g_error_free (error_local);
+ goto out;
+ }
+
/* get needed data */
- distro_id = pk_get_distro_id ();
+ g_object_get (control,
+ "distro-id", &distro_id,
+ NULL);
if (distro_id == NULL)
goto out;
iso_time = pk_iso8601_present ();
@@ -498,6 +511,7 @@ pk_service_pack_create_metadata_file (PkServicePackState *state, const gchar *fi
goto out;
}
out:
+ g_object_unref (control);
g_key_file_free (file);
g_free (data);
g_free (distro_id);
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 7f9fb0b..77eff6c 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -372,6 +372,17 @@ pk_engine_get_distro_id (PkEngine *engine)
g_return_val_if_fail (PK_IS_ENGINE (engine), NULL);
+ /* The distro id property should have the
+ format "distro;version;arch" as this is
+ used to determine if a specific package
+ can be installed on a certain machine.
+ For instance, x86_64 packages cannot be
+ installed on a i386 machine.
+ */
+
+ /* we can't get arch from /etc */
+ arch = pk_engine_get_machine_type ();
+
/* check for fedora */
ret = g_file_get_contents ("/etc/fedora-release", &contents, NULL, NULL);
if (ret) {
@@ -380,13 +391,8 @@ pk_engine_get_distro_id (PkEngine *engine)
if (split == NULL)
goto out;
- /* we can't get arch from /etc */
- arch = pk_engine_get_machine_type ();
- if (arch == NULL)
- goto out;
-
/* complete! */
- distro = g_strdup_printf ("fedora-%s-%s", split[2], arch);
+ distro = g_strdup_printf ("fedora;%s;%s", split[2], arch);
goto out;
}
@@ -402,7 +408,7 @@ pk_engine_get_distro_id (PkEngine *engine)
goto out;
/* complete! */
- distro = g_strdup_printf ("suse-%s-%s", split[1], split[3]);
+ distro = g_strdup_printf ("suse;%s-%s;%s", split[1], split[3], arch);
goto out;
}
@@ -415,7 +421,7 @@ pk_engine_get_distro_id (PkEngine *engine)
goto out;
/* complete! */
- distro = g_strdup_printf ("foresight-%s", split[2]);
+ distro = g_strdup_printf ("foresight;%s;%s", split[2], arch);
goto out;
}
@@ -427,37 +433,22 @@ pk_engine_get_distro_id (PkEngine *engine)
if (split == NULL)
goto out;
- /* we can't get arch from /etc */
- arch = pk_engine_get_machine_type ();
- if (arch == NULL)
- goto out;
-
/* complete! */
- distro = g_strdup_printf ("pld-%s-%s", split[0], arch);
+ distro = g_strdup_printf ("pld;%s;%s", split[0], arch);
goto out;
}
/* check for Arch */
ret = g_file_test ("/etc/arch-release", G_FILE_TEST_EXISTS);
if (ret) {
- /* we can't get arch from /etc */
- arch = pk_engine_get_machine_type ();
- if (arch == NULL)
- goto out;
-
/* complete! */
- distro = g_strdup_printf ("arch-current-%s", arch);
+ distro = g_strdup_printf ("arch;current;%s", arch);
goto out;
}
/* check for LSB */
ret = g_file_get_contents ("/etc/lsb-release", &contents, NULL, NULL);
if (ret) {
- /* we can't get arch from /etc */
- arch = pk_engine_get_machine_type ();
- if (arch == NULL)
- goto out;
-
/* split by lines */
split = g_strsplit (contents, "\n", -1);
for (i=0; split[i] != NULL; i++) {
@@ -468,7 +459,7 @@ pk_engine_get_distro_id (PkEngine *engine)
}
/* complete! */
- distro = g_strdup_printf ("%s-%s-%s", distro, version, arch);
+ distro = g_strdup_printf ("%s;%s;%s", distro, version, arch);
goto out;
}
@@ -481,7 +472,7 @@ pk_engine_get_distro_id (PkEngine *engine)
g_strstrip (contents);
/* complete! */
- distro = g_strdup_printf ("debian-(%s)", contents);
+ distro = g_strdup_printf ("debian;%s;%s", contents, arch);
goto out;
}
@@ -500,13 +491,8 @@ pk_engine_get_distro_id (PkEngine *engine)
if (split == NULL)
goto out;
- /* we can't get arch from /etc */
- arch = pk_engine_get_machine_type ();
- if (arch == NULL)
- goto out;
-
/* complete! */
- distro = g_strdup_printf ("freebsd-%s-%s", split[0], arch);
+ distro = g_strdup_printf ("freebsd;%s;%s", split[0], arch);
goto out;
}
out:
commit 0a2a8b7af684b423324cdf58fe1c505a71060400
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 14:04:05 2009 -0200
Forgot a break in pk-engine.c
diff --git a/src/pk-engine.c b/src/pk-engine.c
index f94126f..7f9fb0b 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -1168,6 +1168,7 @@ pk_engine_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
break;
case PROP_DISTRO_ID:
g_value_set_string (value, engine->priv->distro_id);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
commit 62ed38d000b7f4b55f5e3329bf1d15bd939ac273
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 14:00:26 2009 -0200
Moved get_distro id to a daemon property
diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c
index 36defea..0b2b40f 100644
--- a/client/pk-generate-pack.c
+++ b/client/pk-generate-pack.c
@@ -47,8 +47,23 @@ pk_generate_pack_get_filename (const gchar *name, const gchar *directory)
gchar *filename = NULL;
gchar *distro_id;
gchar *iso_time = NULL;
+ PkControl *control;
+ gboolean ret;
+ GError *error = NULL;
+
+ control = pk_control_new ();
+ ret = pk_control_get_properties (control, NULL, &error);
+ if (!ret) {
+ egg_error ("Failed to contact PackageKit: %s", error->message);
+ g_error_free (error);
+ return NULL;
+ }
+
+ /* get data */
+ g_object_get (control,
+ "distro-id", &distro_id,
+ NULL);
- distro_id = pk_get_distro_id ();
if (name != NULL) {
filename = g_strdup_printf ("%s/%s-%s.%s", directory, name, distro_id, PK_SERVICE_PACK_FILE_EXTENSION);
} else {
diff --git a/lib/packagekit-glib2/pk-catalog.c b/lib/packagekit-glib2/pk-catalog.c
index 5b9cdbf..bee6ca9 100644
--- a/lib/packagekit-glib2/pk-catalog.c
+++ b/lib/packagekit-glib2/pk-catalog.c
@@ -43,6 +43,7 @@
#include <packagekit-glib2/pk-client.h>
#include <packagekit-glib2/pk-package-id.h>
#include <packagekit-glib2/pk-package-ids.h>
+#include <packagekit-glib2/pk-control-sync.h>
#include "egg-debug.h"
#include "egg-string.h"
@@ -604,11 +605,27 @@ pk_catalog_class_init (PkCatalogClass *klass)
static void
pk_catalog_init (PkCatalog *catalog)
{
+ PkControl *control;
+ gboolean ret;
+ GError *error = NULL;
+
catalog->priv = PK_CATALOG_GET_PRIVATE (catalog);
catalog->priv->client = pk_client_new ();
- catalog->priv->distro_id = pk_get_distro_id ();
+ control = pk_control_new ();
+ ret = pk_control_get_properties (control, NULL, &error);
+ if (!ret) {
+ egg_error ("Failed to contact PackageKit: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ /* get data */
+ g_object_get (control,
+ "distro-id", &catalog->priv->distro_id,
+ NULL);
+
if (catalog->priv->distro_id == NULL)
- egg_error ("no distro_id, your distro needs to implement this in pk-common.c!");
+ egg_error ("no distro_id, your distro needs to implement this in pk-engine.c!");
}
/**
diff --git a/lib/packagekit-glib2/pk-common.c b/lib/packagekit-glib2/pk-common.c
index 90be01d..9e01e4e 100644
--- a/lib/packagekit-glib2/pk-common.c
+++ b/lib/packagekit-glib2/pk-common.c
@@ -32,13 +32,6 @@
#include <stdio.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/utsname.h>
-#include <sys/stat.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
#include <glib.h>
#include <packagekit-glib2/pk-common.h>
@@ -48,204 +41,6 @@
#include "egg-string.h"
/**
- * pk_get_os_release:
- *
- * Return value: The current OS release, e.g. "7.2-RELEASE"
- * Note: Don't use this function if you can get this data from /etc/foo
- **/
-static gchar *
-pk_get_os_release (void)
-{
- gint retval;
- struct utsname buf;
-
- retval = uname (&buf);
- if (retval != 0)
- return g_strdup ("unknown");
- return g_strdup (buf.release);
-}
-
-/**
- * pk_get_machine_type:
- *
- * Return value: The current machine ID, e.g. "i386"
- * Note: Don't use this function if you can get this data from /etc/foo
- **/
-static gchar *
-pk_get_machine_type (void)
-{
- gint retval;
- struct utsname buf;
-
- retval = uname (&buf);
- if (retval != 0)
- return g_strdup ("unknown");
- return g_strdup (buf.machine);
-}
-
-/**
- * pk_get_distro_id:
- *
- * Return value: The current distro-id, e.g. fedora-8-i386, or %NULL for an
- * error or not known
- **/
-gchar *
-pk_get_distro_id (void)
-{
- guint i;
- gboolean ret;
- gchar *contents = NULL;
- gchar *distro = NULL;
- gchar *arch = NULL;
- gchar *version = NULL;
- gchar **split = NULL;
-
- /* check for fedora */
- ret = g_file_get_contents ("/etc/fedora-release", &contents, NULL, NULL);
- if (ret) {
- /* Fedora release 8.92 (Rawhide) */
- split = g_strsplit (contents, " ", 0);
- if (split == NULL)
- goto out;
-
- /* we can't get arch from /etc */
- arch = pk_get_machine_type ();
- if (arch == NULL)
- goto out;
-
- /* complete! */
- distro = g_strdup_printf ("fedora-%s-%s", split[2], arch);
- goto out;
- }
-
- /* check for suse */
- ret = g_file_get_contents ("/etc/SuSE-release", &contents, NULL, NULL);
- if (ret) {
- /* replace with spaces: openSUSE 11.0 (i586) Alpha3\nVERSION = 11.0 */
- g_strdelimit (contents, "()\n", ' ');
-
- /* openSUSE 11.0 i586 Alpha3 VERSION = 11.0 */
- split = g_strsplit (contents, " ", 0);
- if (split == NULL)
- goto out;
-
- /* complete! */
- distro = g_strdup_printf ("suse-%s-%s", split[1], split[3]);
- goto out;
- }
-
- /* check for foresight or foresight derivatives */
- ret = g_file_get_contents ("/etc/distro-release", &contents, NULL, NULL);
- if (ret) {
- /* Foresight Linux 2 */
- split = g_strsplit (contents, " ", 0);
- if (split == NULL)
- goto out;
-
- /* complete! */
- distro = g_strdup_printf ("foresight-%s", split[2]);
- goto out;
- }
-
- /* check for PLD */
- ret = g_file_get_contents ("/etc/pld-release", &contents, NULL, NULL);
- if (ret) {
- /* 2.99 PLD Linux (Th) */
- split = g_strsplit (contents, " ", 0);
- if (split == NULL)
- goto out;
-
- /* we can't get arch from /etc */
- arch = pk_get_machine_type ();
- if (arch == NULL)
- goto out;
-
- /* complete! */
- distro = g_strdup_printf ("pld-%s-%s", split[0], arch);
- goto out;
- }
-
- /* check for Arch */
- ret = g_file_test ("/etc/arch-release", G_FILE_TEST_EXISTS);
- if (ret) {
- /* we can't get arch from /etc */
- arch = pk_get_machine_type ();
- if (arch == NULL)
- goto out;
-
- /* complete! */
- distro = g_strdup_printf ("arch-current-%s", arch);
- goto out;
- }
-
- /* check for LSB */
- ret = g_file_get_contents ("/etc/lsb-release", &contents, NULL, NULL);
- if (ret) {
- /* we can't get arch from /etc */
- arch = pk_get_machine_type ();
- if (arch == NULL)
- goto out;
-
- /* split by lines */
- split = g_strsplit (contents, "\n", -1);
- for (i=0; split[i] != NULL; i++) {
- if (g_str_has_prefix (split[i], "DISTRIB_ID="))
- distro = g_ascii_strdown (&split[i][11], -1);
- if (g_str_has_prefix (split[i], "DISTRIB_RELEASE="))
- version = g_ascii_strdown (&split[i][16], -1);
- }
-
- /* complete! */
- distro = g_strdup_printf ("%s-%s-%s", distro, version, arch);
- goto out;
- }
-
- /* check for Debian or Debian derivatives */
- ret = g_file_get_contents ("/etc/debian_version", &contents, NULL, NULL);
- if (ret) {
- /* remove "\n": "squeeze/sid\n" */
- g_strdelimit (contents, "\n", '\0');
- /* removes leading and trailing whitespace */
- g_strstrip (contents);
-
- /* complete! */
- distro = g_strdup_printf ("debian-(%s)", contents);
- goto out;
- }
-
-#ifdef __FreeBSD__
- ret = TRUE;
-#endif
- /* FreeBSD */
- if (ret) {
- /* we can't get version from /etc */
- version = pk_get_os_release ();
- if (version == NULL)
- goto out;
-
- /* 7.2-RELEASE */
- split = g_strsplit (version, "-", 0);
- if (split == NULL)
- goto out;
-
- /* we can't get arch from /etc */
- arch = pk_get_machine_type ();
- if (arch == NULL)
- goto out;
-
- /* complete! */
- distro = g_strdup_printf ("freebsd-%s-%s", split[0], arch);
- goto out;
- }
-out:
- g_strfreev (split);
- g_free (version);
- g_free (arch);
- g_free (contents);
- return distro;
-}
-
-/**
* pk_iso8601_present:
*
* Return value: The current iso8601 date and time
diff --git a/lib/packagekit-glib2/pk-common.h b/lib/packagekit-glib2/pk-common.h
index 996608a..b30712a 100644
--- a/lib/packagekit-glib2/pk-common.h
+++ b/lib/packagekit-glib2/pk-common.h
@@ -88,8 +88,6 @@ gchar *pk_iso8601_present (void)
G_GNUC_WARN_UNUSED_RESULT;
gchar *pk_iso8601_from_date (const GDate *date);
GDate *pk_iso8601_to_date (const gchar *iso_date);
-gchar *pk_get_distro_id (void)
- G_GNUC_WARN_UNUSED_RESULT;
G_END_DECLS
diff --git a/lib/packagekit-glib2/pk-control.c b/lib/packagekit-glib2/pk-control.c
index 9d6b072..452d911 100644
--- a/lib/packagekit-glib2/pk-control.c
+++ b/lib/packagekit-glib2/pk-control.c
@@ -72,6 +72,7 @@ struct _PkControlPrivate
gboolean connected;
gboolean locked;
PkNetworkEnum network_state;
+ gchar *distro_id;
guint transaction_list_changed_id;
guint restart_schedule_id;
guint updates_changed_id;
@@ -101,6 +102,7 @@ enum {
PROP_LOCKED,
PROP_NETWORK_STATE,
PROP_CONNECTED,
+ PROP_DISTRO_ID,
PROP_LAST
};
@@ -1456,6 +1458,23 @@ pk_control_set_network_state (PkControl *control, PkNetworkEnum network_state)
}
/**
+ * pk_control_set_distro_id:
+ **/
+static void
+pk_control_set_distro_id (PkControl *control, const gchar *distro_id)
+{
+ /* is the same as before */
+ if (g_strcmp0 (control->priv->distro_id, distro_id) == 0)
+ return;
+ g_free (control->priv->distro_id);
+ control->priv->distro_id = g_strdup (distro_id);
+
+ /* notify we're changed */
+ egg_debug ("notify::distro-id");
+ g_object_notify (G_OBJECT(control), "distro-id");
+}
+
+/**
* pk_control_get_properties_collect_cb:
**/
static void
@@ -1485,6 +1504,8 @@ pk_control_get_properties_collect_cb (const char *key, const GValue *value, PkCo
pk_control_set_locked (control, g_value_get_boolean (value));
} else if (g_strcmp0 (key, "NetworkState") == 0) {
pk_control_set_network_state (control, pk_network_enum_from_text (g_value_get_string (value)));
+ } else if (g_strcmp0 (key, "DistroId") == 0) {
+ pk_control_set_distro_id (control, g_value_get_string (value));
} else {
egg_warning ("unhandled property '%s'", key);
}
@@ -1943,6 +1964,9 @@ pk_control_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
case PROP_NETWORK_STATE:
g_value_set_uint (value, priv->network_state);
break;
+ case PROP_DISTRO_ID:
+ g_value_set_string (value, priv->distro_id);
+ break;
case PROP_CONNECTED:
g_value_set_boolean (value, priv->connected);
break;
@@ -2075,6 +2099,14 @@ pk_control_class_init (PkControlClass *klass)
g_object_class_install_property (object_class, PROP_NETWORK_STATE, pspec);
/**
+ * PkControl:distro-id:
+ */
+ pspec = g_param_spec_string ("distro-id", NULL, NULL,
+ NULL,
+ G_PARAM_READWRITE);
+ g_object_class_install_property (object_class, PROP_DISTRO_ID, pspec);
+
+ /**
* PkControl:connected:
*/
pspec = g_param_spec_boolean ("connected", NULL, NULL,
@@ -2161,6 +2193,7 @@ pk_control_init (PkControl *control)
control->priv->updates_changed_id = 0;
control->priv->repo_list_changed_id = 0;
control->priv->network_state = PK_NETWORK_ENUM_UNKNOWN;
+ control->priv->distro_id = NULL;
control->priv->calls = g_ptr_array_new ();
/* check dbus connections, exit if not valid */
@@ -2274,6 +2307,7 @@ pk_control_finalize (GObject *object)
g_free (priv->backend_description);
g_free (priv->backend_author);
g_free (priv->mime_types);
+ g_free (priv->distro_id);
g_object_unref (G_OBJECT (priv->proxy));
g_object_unref (G_OBJECT (priv->proxy_props));
g_object_unref (G_OBJECT (priv->proxy_dbus));
diff --git a/lib/packagekit-glib2/pk-service-pack.c b/lib/packagekit-glib2/pk-service-pack.c
index 2ed64e0..3cc02a9 100644
--- a/lib/packagekit-glib2/pk-service-pack.c
+++ b/lib/packagekit-glib2/pk-service-pack.c
@@ -49,6 +49,7 @@
#include <packagekit-glib2/pk-client.h>
#include <packagekit-glib2/pk-package-id.h>
#include <packagekit-glib2/pk-package-ids.h>
+#include <packagekit-glib2/pk-control-sync.h>
#include "egg-debug.h"
#include "egg-string.h"
@@ -144,6 +145,7 @@ pk_service_pack_check_metadata_file (const gchar *full_path, GError **error)
gchar *type = NULL;
gchar *distro_id = NULL;
gchar *distro_id_us = NULL;
+ PkControl *control;
/* load the file */
file = g_key_file_new ();
@@ -180,7 +182,18 @@ pk_service_pack_check_metadata_file (const gchar *full_path, GError **error)
}
/* get this system id */
- distro_id_us = pk_get_distro_id ();
+ control = pk_control_new ();
+ ret = pk_control_get_properties (control, NULL, &error_local);
+ if (!ret) {
+ egg_error ("Failed to contact PackageKit: %s", error_local->message);
+ g_error_free (error_local);
+ goto out;
+ }
+
+ /* get data */
+ g_object_get (control,
+ "distro-id", &distro_id_us,
+ NULL);
/* do we match? */
ret = (g_strcmp0 (distro_id_us, distro_id) == 0);
@@ -188,6 +201,7 @@ pk_service_pack_check_metadata_file (const gchar *full_path, GError **error)
*error = g_error_new (1, 0, "distro id did not match %s == %s", distro_id_us, distro_id);
out:
+ g_object_unref (control);
g_key_file_free (file);
g_free (type);
g_free (distro_id);
diff --git a/lib/packagekit-qt/src/client.cpp b/lib/packagekit-qt/src/client.cpp
index 987c6ba..9cd8a8c 100644
--- a/lib/packagekit-qt/src/client.cpp
+++ b/lib/packagekit-qt/src/client.cpp
@@ -174,6 +174,11 @@ Client::NetworkState Client::getNetworkState() const
return (NetworkState) Util::enumFromString<Client>(state, "NetworkState", "Network");
}
+QString Client::distroId() const
+{
+ return d->daemon->distroId();
+}
+
uint Client::getTimeSinceAction(Action action) const
{
QString pkName = Util::enumToString<Client>(action, "Action", "Action");
diff --git a/lib/packagekit-qt/src/client.h b/lib/packagekit-qt/src/client.h
index e77aaec..3452650 100644
--- a/lib/packagekit-qt/src/client.h
+++ b/lib/packagekit-qt/src/client.h
@@ -272,6 +272,11 @@ public:
NetworkState getNetworkState() const;
/**
+ * The distributed identifier, e.g. "debian-(squeeze/sid)".
+ */
+ QString distroId() const;
+
+ /**
* Returns the time (in seconds) since the specified \p action
*/
uint getTimeSinceAction(Action action) const;
diff --git a/lib/packagekit-qt/src/daemonproxy.h b/lib/packagekit-qt/src/daemonproxy.h
index cc19390..728983a 100644
--- a/lib/packagekit-qt/src/daemonproxy.h
+++ b/lib/packagekit-qt/src/daemonproxy.h
@@ -69,6 +69,10 @@ public:
inline QString networkState() const
{ return qvariant_cast< QString >(internalPropGet("NetworkState")); }
+ Q_PROPERTY(QString DistroId READ distroId)
+ inline QString distroId() const
+ { return qvariant_cast< QString >(internalPropGet("DistroId")); }
+
Q_PROPERTY(QString Roles READ roles)
inline QString roles() const
{ return qvariant_cast< QString >(internalPropGet("Roles")); }
diff --git a/src/org.freedesktop.PackageKit.xml b/src/org.freedesktop.PackageKit.xml
index 7dffc41..bd5e281 100644
--- a/src/org.freedesktop.PackageKit.xml
+++ b/src/org.freedesktop.PackageKit.xml
@@ -152,6 +152,18 @@
</property>
<!--*****************************************************************************************-->
+ <property name="DistroId" type="s" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The distribution identification, e.g.
+ <doc:tt>"debian-(squeeze/sid)"</doc:tt>.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
+ <!--*****************************************************************************************-->
<method name="CanAuthorize">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<doc:doc>
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 2050902..f94126f 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -29,6 +29,8 @@
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <sys/utsname.h>
+#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
@@ -88,6 +90,7 @@ struct PkEnginePrivate
gchar *backend_name;
gchar *backend_description;
gchar *backend_author;
+ gchar *distro_id;
guint timeout_priority;
guint timeout_normal;
guint timeout_priority_id;
@@ -128,6 +131,7 @@ enum {
PROP_MIME_TYPES,
PROP_LOCKED,
PROP_NETWORK_STATE,
+ PROP_DISTRO_ID,
PROP_LAST,
};
@@ -317,6 +321,203 @@ pk_engine_get_network_state (PkEngine *engine, gchar **state, GError **error)
}
/**
+ * pk_get_os_release:
+ *
+ * Return value: The current OS release, e.g. "7.2-RELEASE"
+ * Note: Don't use this function if you can get this data from /etc/foo
+ **/
+static gchar *
+pk_engine_get_os_release (void)
+{
+ gint retval;
+ struct utsname buf;
+
+ retval = uname (&buf);
+ if (retval != 0)
+ return g_strdup ("unknown");
+ return g_strdup (buf.release);
+}
+
+/**
+ * pk_get_machine_type:
+ *
+ * Return value: The current machine ID, e.g. "i386"
+ * Note: Don't use this function if you can get this data from /etc/foo
+ **/
+static gchar *
+pk_engine_get_machine_type (void)
+{
+ gint retval;
+ struct utsname buf;
+
+ retval = uname (&buf);
+ if (retval != 0)
+ return g_strdup ("unknown");
+ return g_strdup (buf.machine);
+}
+
+/**
+ * pk_engine_get_distro_id:
+ **/
+static gchar *
+pk_engine_get_distro_id (PkEngine *engine)
+{
+ guint i;
+ gboolean ret;
+ gchar *contents = NULL;
+ gchar *arch = NULL;
+ gchar *version = NULL;
+ gchar **split = NULL;
+ gchar *distro;
+
+ g_return_val_if_fail (PK_IS_ENGINE (engine), NULL);
+
+ /* check for fedora */
+ ret = g_file_get_contents ("/etc/fedora-release", &contents, NULL, NULL);
+ if (ret) {
+ /* Fedora release 8.92 (Rawhide) */
+ split = g_strsplit (contents, " ", 0);
+ if (split == NULL)
+ goto out;
+
+ /* we can't get arch from /etc */
+ arch = pk_engine_get_machine_type ();
+ if (arch == NULL)
+ goto out;
+
+ /* complete! */
+ distro = g_strdup_printf ("fedora-%s-%s", split[2], arch);
+ goto out;
+ }
+
+ /* check for suse */
+ ret = g_file_get_contents ("/etc/SuSE-release", &contents, NULL, NULL);
+ if (ret) {
+ /* replace with spaces: openSUSE 11.0 (i586) Alpha3\nVERSION = 11.0 */
+ g_strdelimit (contents, "()\n", ' ');
+
+ /* openSUSE 11.0 i586 Alpha3 VERSION = 11.0 */
+ split = g_strsplit (contents, " ", 0);
+ if (split == NULL)
+ goto out;
+
+ /* complete! */
+ distro = g_strdup_printf ("suse-%s-%s", split[1], split[3]);
+ goto out;
+ }
+
+ /* check for foresight or foresight derivatives */
+ ret = g_file_get_contents ("/etc/distro-release", &contents, NULL, NULL);
+ if (ret) {
+ /* Foresight Linux 2 */
+ split = g_strsplit (contents, " ", 0);
+ if (split == NULL)
+ goto out;
+
+ /* complete! */
+ distro = g_strdup_printf ("foresight-%s", split[2]);
+ goto out;
+ }
+
+ /* check for PLD */
+ ret = g_file_get_contents ("/etc/pld-release", &contents, NULL, NULL);
+ if (ret) {
+ /* 2.99 PLD Linux (Th) */
+ split = g_strsplit (contents, " ", 0);
+ if (split == NULL)
+ goto out;
+
+ /* we can't get arch from /etc */
+ arch = pk_engine_get_machine_type ();
+ if (arch == NULL)
+ goto out;
+
+ /* complete! */
+ distro = g_strdup_printf ("pld-%s-%s", split[0], arch);
+ goto out;
+ }
+
+ /* check for Arch */
+ ret = g_file_test ("/etc/arch-release", G_FILE_TEST_EXISTS);
+ if (ret) {
+ /* we can't get arch from /etc */
+ arch = pk_engine_get_machine_type ();
+ if (arch == NULL)
+ goto out;
+
+ /* complete! */
+ distro = g_strdup_printf ("arch-current-%s", arch);
+ goto out;
+ }
+
+ /* check for LSB */
+ ret = g_file_get_contents ("/etc/lsb-release", &contents, NULL, NULL);
+ if (ret) {
+ /* we can't get arch from /etc */
+ arch = pk_engine_get_machine_type ();
+ if (arch == NULL)
+ goto out;
+
+ /* split by lines */
+ split = g_strsplit (contents, "\n", -1);
+ for (i=0; split[i] != NULL; i++) {
+ if (g_str_has_prefix (split[i], "DISTRIB_ID="))
+ distro = g_ascii_strdown (&split[i][11], -1);
+ if (g_str_has_prefix (split[i], "DISTRIB_RELEASE="))
+ version = g_ascii_strdown (&split[i][16], -1);
+ }
+
+ /* complete! */
+ distro = g_strdup_printf ("%s-%s-%s", distro, version, arch);
+ goto out;
+ }
+
+ /* check for Debian or Debian derivatives */
+ ret = g_file_get_contents ("/etc/debian_version", &contents, NULL, NULL);
+ if (ret) {
+ /* remove "\n": "squeeze/sid\n" */
+ g_strdelimit (contents, "\n", '\0');
+ /* removes leading and trailing whitespace */
+ g_strstrip (contents);
+
+ /* complete! */
+ distro = g_strdup_printf ("debian-(%s)", contents);
+ goto out;
+ }
+
+#ifdef __FreeBSD__
+ ret = TRUE;
+#endif
+ /* FreeBSD */
+ if (ret) {
+ /* we can't get version from /etc */
+ version = pk_engine_get_os_release ();
+ if (version == NULL)
+ goto out;
+
+ /* 7.2-RELEASE */
+ split = g_strsplit (version, "-", 0);
+ if (split == NULL)
+ goto out;
+
+ /* we can't get arch from /etc */
+ arch = pk_engine_get_machine_type ();
+ if (arch == NULL)
+ goto out;
+
+ /* complete! */
+ distro = g_strdup_printf ("freebsd-%s-%s", split[0], arch);
+ goto out;
+ }
+out:
+ g_strfreev (split);
+ g_free (version);
+ g_free (arch);
+ g_free (contents);
+ return distro;
+}
+
+/**
* pk_engine_get_daemon_state:
**/
gboolean
@@ -965,6 +1166,8 @@ pk_engine_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
case PROP_NETWORK_STATE:
g_value_set_string (value, pk_network_enum_to_text (engine->priv->network_state));
break;
+ case PROP_DISTRO_ID:
+ g_value_set_string (value, engine->priv->distro_id);
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1004,7 +1207,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_uint ("version-major", NULL, NULL,
0, G_MAXUINT, 0,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_VERSION_MAJOR, pspec);
/**
@@ -1012,7 +1215,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_uint ("version-minor", NULL, NULL,
0, G_MAXUINT, 0,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_VERSION_MINOR, pspec);
/**
@@ -1020,7 +1223,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_uint ("version-micro", NULL, NULL,
0, G_MAXUINT, 0,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_VERSION_MICRO, pspec);
/**
@@ -1028,7 +1231,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_string ("backend-name", NULL, NULL,
NULL,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_BACKEND_NAME, pspec);
/**
@@ -1036,7 +1239,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_string ("backend-description", NULL, NULL,
NULL,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_BACKEND_DESCRIPTION, pspec);
/**
@@ -1044,7 +1247,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_string ("backend-author", NULL, NULL,
NULL,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_BACKEND_AUTHOR, pspec);
/**
@@ -1052,7 +1255,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_string ("roles", NULL, NULL,
NULL,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_ROLES, pspec);
/**
@@ -1060,7 +1263,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_string ("groups", NULL, NULL,
NULL,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_GROUPS, pspec);
/**
@@ -1068,7 +1271,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_string ("filters", NULL, NULL,
NULL,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_FILTERS, pspec);
/**
@@ -1076,7 +1279,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_string ("mime-types", NULL, NULL,
NULL,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_MIME_TYPES, pspec);
/**
@@ -1084,7 +1287,7 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_boolean ("locked", NULL, NULL,
FALSE,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_LOCKED, pspec);
/**
@@ -1092,9 +1295,17 @@ pk_engine_class_init (PkEngineClass *klass)
*/
pspec = g_param_spec_string ("network-state", NULL, NULL,
NULL,
- G_PARAM_READWRITE);
+ G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_NETWORK_STATE, pspec);
+ /**
+ * PkEngine:distro-id:
+ */
+ pspec = g_param_spec_string ("distro-id", NULL, NULL,
+ NULL,
+ G_PARAM_READABLE);
+ g_object_class_install_property (object_class, PROP_DISTRO_ID, pspec);
+
/* signals */
signals[SIGNAL_LOCKED] =
g_signal_new ("locked",
@@ -1206,6 +1417,7 @@ pk_engine_init (PkEngine *engine)
engine->priv->backend_author = NULL;
engine->priv->sender = NULL;
engine->priv->locked = FALSE;
+ engine->priv->distro_id = NULL;
/* use the config file */
engine->priv->conf = pk_conf_new ();
@@ -1241,6 +1453,9 @@ pk_engine_init (PkEngine *engine)
engine->priv->backend_description = pk_backend_get_description (engine->priv->backend);
engine->priv->backend_author = pk_backend_get_author (engine->priv->backend);
+ /* try to get the distro id */
+ engine->priv->distro_id = pk_engine_get_distro_id (engine);
+
/* we allow fallback to these legacy methods */
if (pk_bitfield_contain (engine->priv->roles, PK_ROLE_ENUM_GET_DEPENDS))
pk_bitfield_add (engine->priv->roles, PK_ROLE_ENUM_SIMULATE_INSTALL_PACKAGES);
@@ -1368,6 +1583,7 @@ pk_engine_finalize (GObject *object)
g_free (engine->priv->backend_name);
g_free (engine->priv->backend_description);
g_free (engine->priv->backend_author);
+ g_free (engine->priv->distro_id);
G_OBJECT_CLASS (pk_engine_parent_class)->finalize (object);
}
commit ab79229988470391b4adb1e890540e48b4ba8bf8
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 12:32:26 2009 -0200
Make the scan for desktop files be recursive
diff --git a/src/pk-transaction-extra.c b/src/pk-transaction-extra.c
index 82f5206..3a1dd7a 100644
--- a/src/pk-transaction-extra.c
+++ b/src/pk-transaction-extra.c
@@ -338,6 +338,47 @@ out:
}
/**
+ * pk_transaction_extra_get_desktop_files:
+ **/
+static void
+pk_transaction_extra_get_desktop_files (PkTransactionExtra *extra,
+ const gchar *app_dir,
+ GPtrArray *array)
+{
+ GError *error = NULL;
+ GDir *dir;
+ const gchar *filename;
+ gpointer data;
+ gchar *path;
+
+ /* open directory */
+ dir = g_dir_open (app_dir, 0, &error);
+ if (dir == NULL) {
+ egg_warning ("failed to open directory %s: %s", app_dir, error->message);
+ g_error_free (error);
+ return;
+ }
+
+ /* go through desktop files and add them to an array if not present */
+ filename = g_dir_read_name (dir);
+ while (filename != NULL) {
+ path = g_build_filename (app_dir, filename, NULL);
+ if (g_file_test (path, G_FILE_TEST_IS_DIR)) {
+ pk_transaction_extra_get_desktop_files (extra, path, array);
+ } else if (g_str_has_suffix (filename, ".desktop")) {
+ data = g_hash_table_lookup (extra->priv->hash, path);
+ if (data == NULL) {
+ egg_debug ("add of %s as not present in db", path);
+ g_ptr_array_add (array, g_strdup (path));
+ }
+ }
+ g_free (path);
+ filename = g_dir_read_name (dir);
+ }
+ g_dir_close (dir);
+}
+
+/**
* pk_transaction_extra_import_desktop_files:
**/
gboolean
@@ -346,10 +387,6 @@ pk_transaction_extra_import_desktop_files (PkTransactionExtra *extra)
gchar *statement;
gchar *error_msg = NULL;
gint rc;
- GError *error = NULL;
- GDir *dir;
- const gchar *filename;
- gpointer data;
gchar *path;
GPtrArray *array;
gfloat step;
@@ -380,44 +417,22 @@ pk_transaction_extra_import_desktop_files (PkTransactionExtra *extra)
sqlite3_free (error_msg);
}
- /* open directory */
- dir = g_dir_open (PK_DESKTOP_DEFAULT_APPLICATION_DIR, 0, &error);
- if (dir == NULL) {
- egg_warning ("failed to open file %s: %s", PK_DESKTOP_DEFAULT_APPLICATION_DIR, error->message);
- g_error_free (error);
- goto out;
- }
-
- /* go through desktop files and add them to an array if not present */
- filename = g_dir_read_name (dir);
- array = g_ptr_array_new ();
- while (filename != NULL) {
- if (g_str_has_suffix (filename, ".desktop")) {
- path = g_build_filename (PK_DESKTOP_DEFAULT_APPLICATION_DIR, filename, NULL);
- data = g_hash_table_lookup (extra->priv->hash, path);
- if (data == NULL) {
- egg_debug ("add of %s as not present in db", path);
- g_ptr_array_add (array, g_strdup (path));
- }
- g_free (path);
- }
- filename = g_dir_read_name (dir);
- }
- g_dir_close (dir);
+ array = g_ptr_array_new_with_free_func (g_free);
+ pk_transaction_extra_get_desktop_files (extra, PK_DESKTOP_DEFAULT_APPLICATION_DIR, array);
- step = 100.0f / array->len;
- pk_transaction_extra_set_status_changed (extra, PK_STATUS_ENUM_GENERATE_PACKAGE_LIST);
+ if (array->len) {
+ step = 100.0f / array->len;
+ pk_transaction_extra_set_status_changed (extra, PK_STATUS_ENUM_GENERATE_PACKAGE_LIST);
- /* process files in an array */
- for (i=0; i<array->len; i++) {
- pk_transaction_extra_set_progress_changed (extra, i * step);
- path = g_ptr_array_index (array, i);
- pk_transaction_extra_sqlite_add_filename (extra, path, NULL);
+ /* process files in an array */
+ for (i=0; i<array->len; i++) {
+ pk_transaction_extra_set_progress_changed (extra, i * step);
+ path = g_ptr_array_index (array, i);
+ pk_transaction_extra_sqlite_add_filename (extra, path, NULL);
+ }
}
- g_ptr_array_foreach (array, (GFunc) g_free, NULL);
g_ptr_array_free (array, TRUE);
-out:
pk_transaction_extra_set_progress_changed (extra, 100);
pk_transaction_extra_set_status_changed (extra, PK_STATUS_ENUM_FINISHED);
return TRUE;
commit e83d3a9385f37bf1414e5a40a63e9c9737dbc434
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 10:37:45 2009 -0200
packagekit-qt: A few improvements to getIcon()
diff --git a/lib/packagekit-qt/src/package.cpp b/lib/packagekit-qt/src/package.cpp
index 54f96e2..7c50361 100644
--- a/lib/packagekit-qt/src/package.cpp
+++ b/lib/packagekit-qt/src/package.cpp
@@ -176,10 +176,10 @@ void Package::setDetails(Package::Details* det)
QString Package::iconPath ()
{
if (d->iconPath.isNull ()) {
+ d->iconPath = QString("");
QSqlDatabase db = QSqlDatabase::database();
if (!db.isOpen()) {
qDebug() << "Desktop files database is not open";
- d->iconPath = QString ("");
return d->iconPath;
}
@@ -187,15 +187,14 @@ QString Package::iconPath ()
q.prepare("SELECT filename FROM cache WHERE package = :name");
q.bindValue(":name", d->name);
if(q.exec()) {
- d->iconPath = QString("");
if (q.next()) {
QFile desktopFile (q.value(0).toString());
if (desktopFile.open (QIODevice::ReadOnly | QIODevice::Text)) {
while (!desktopFile.atEnd ()) {
QByteArray line = desktopFile.readLine ().trimmed ();
- if (line.startsWith ("Icon=") && line.length () > 5 /* strlen("Icon=") */) {
- int startChar = line.indexOf ('=')+1;
- d->iconPath = line.mid (startChar);
+ if (line.startsWith ("Icon=")) {
+ d->iconPath = line.mid (6);
+ break;
}
}
desktopFile.close ();
commit 596b5672455c7da4a19b2c5b9bd708fdd1943f67
Author: Adrien Bustany <madcat at mymadcat.com>
Date: Thu Nov 26 08:33:51 2009 -0300
PackageKit-Qt: Fix behaviour on failed desktop database open
diff --git a/lib/packagekit-qt/src/package.cpp b/lib/packagekit-qt/src/package.cpp
index 989db9b..54f96e2 100644
--- a/lib/packagekit-qt/src/package.cpp
+++ b/lib/packagekit-qt/src/package.cpp
@@ -179,12 +179,13 @@ QString Package::iconPath ()
QSqlDatabase db = QSqlDatabase::database();
if (!db.isOpen()) {
qDebug() << "Desktop files database is not open";
- return NULL;
+ d->iconPath = QString ("");
+ return d->iconPath;
}
QSqlQuery q(db);
- q.prepare("SELECT filename FROM cache WHERE package = :pid");
- q.bindValue(":pid", d->id);
+ q.prepare("SELECT filename FROM cache WHERE package = :name");
+ q.bindValue(":name", d->name);
if(q.exec()) {
d->iconPath = QString("");
if (q.next()) {
commit e63bf5aab7216bb8042f74bdd67daf02e744079d
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 09:26:22 2009 -0200
packagekit-qt: Fix the open desktopdb path
diff --git a/lib/packagekit-qt/src/client.cpp b/lib/packagekit-qt/src/client.cpp
index 3886902..987c6ba 100644
--- a/lib/packagekit-qt/src/client.cpp
+++ b/lib/packagekit-qt/src/client.cpp
@@ -49,6 +49,8 @@
CHECK_TRANSACTION \
return t; \
+#define PK_DESKTOP_DEFAULT_DATABASE LOCALSTATEDIR "/lib/PackageKit/desktop-files.db"
+
using namespace PackageKit;
Client* Client::m_instance = 0;
@@ -84,7 +86,7 @@ Client::Client(QObject* parent) : QObject(parent)
// Set up database for desktop files
QSqlDatabase db;
db = QSqlDatabase::addDatabase("QSQLITE");
- db.setDatabaseName ("/var/lib/PackageKit/desktop-files.db");
+ db.setDatabaseName (PK_DESKTOP_DEFAULT_DATABASE);
if (!db.open()) {
qDebug() << "Failed to initialize the desktop files database";
}
commit 259c5939f9c13b511e27e30b0e950f2c3d24e05d
Merge: d1c5b97... 9b6d997...
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Thu Nov 26 09:26:13 2009 -0200
Merge branch 'master' of git+ssh://git.packagekit.org/srv/git/PackageKit
commit 9b6d9974f47a98dfa93d41522859c201d043c07c
Author: Adrien Bustany <madcat at mymadcat.com>
Date: Wed Nov 25 18:37:40 2009 -0300
PackageKit-Qt: Add function in Package class to get icon path
This commit adds the Package::iconPath function that searches
in the local sqlite database for the desktop file associated
to a package and extracts the icon path.
diff --git a/lib/packagekit-qt/src/package.cpp b/lib/packagekit-qt/src/package.cpp
index e81fb0e..989db9b 100644
--- a/lib/packagekit-qt/src/package.cpp
+++ b/lib/packagekit-qt/src/package.cpp
@@ -18,6 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
+#include <QtSql>
+
#include "package.h"
#include "util.h"
@@ -93,6 +95,7 @@ public:
QString summary;
Package::State state;
Package::Details* details;
+ QString iconPath;
};
Package::Package(const QString& packageId, const QString& state, const QString& summary) : QObject(NULL), d(new Private)
@@ -111,6 +114,7 @@ Package::Package(const QString& packageId, const QString& state, const QString&
d->state = (State)Util::enumFromString<Package>(state, "State", "State");
d->summary = summary;
d->details = NULL;
+ d->iconPath = QString ();
}
Package::~Package()
@@ -169,6 +173,43 @@ void Package::setDetails(Package::Details* det)
d->details = det;
}
+QString Package::iconPath ()
+{
+ if (d->iconPath.isNull ()) {
+ QSqlDatabase db = QSqlDatabase::database();
+ if (!db.isOpen()) {
+ qDebug() << "Desktop files database is not open";
+ return NULL;
+ }
+
+ QSqlQuery q(db);
+ q.prepare("SELECT filename FROM cache WHERE package = :pid");
+ q.bindValue(":pid", d->id);
+ if(q.exec()) {
+ d->iconPath = QString("");
+ if (q.next()) {
+ QFile desktopFile (q.value(0).toString());
+ if (desktopFile.open (QIODevice::ReadOnly | QIODevice::Text)) {
+ while (!desktopFile.atEnd ()) {
+ QByteArray line = desktopFile.readLine ().trimmed ();
+ if (line.startsWith ("Icon=") && line.length () > 5 /* strlen("Icon=") */) {
+ int startChar = line.indexOf ('=')+1;
+ d->iconPath = line.mid (startChar);
+ }
+ }
+ desktopFile.close ();
+ } else {
+ qDebug() << "Cannot open desktop file " << q.value(0).toString ();
+ }
+ }
+ } else {
+ qDebug() << "Error while running query " << q.executedQuery();
+ }
+ }
+
+ return d->iconPath;
+}
+
bool Package::operator==(const Package *package) const
{
return d->id == package->id();
diff --git a/lib/packagekit-qt/src/package.h b/lib/packagekit-qt/src/package.h
index 28101c9..077345a 100644
--- a/lib/packagekit-qt/src/package.h
+++ b/lib/packagekit-qt/src/package.h
@@ -311,6 +311,13 @@ public:
*/
Details* details() const;
+ /**
+ * \brief Returns the path to the package icon, if known
+ *
+ * \return A QString holding the path to the package icon if known, an empty QString else
+ */
+ QString iconPath ();
+
bool operator==(const Package *package) const;
private:
commit d1c5b97fb4fea282eec7c87e9efab5cc1170b28c
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Wed Nov 25 17:35:02 2009 -0200
packagekit-qt: Fix compilation path of desktop.db
diff --git a/lib/packagekit-qt/src/Makefile.am b/lib/packagekit-qt/src/Makefile.am
index 53695f1..58aade6 100644
--- a/lib/packagekit-qt/src/Makefile.am
+++ b/lib/packagekit-qt/src/Makefile.am
@@ -6,6 +6,7 @@ INCLUDES = \
$(QTCORE_CFLAGS) \
$(QTDBUS_CFLAGS) \
$(QTSQL_CFLAGS) \
+ -DLOCALSTATEDIR=\""$(localstatedir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
METASOURCES = AUTO
commit 83ebe6b41ad81d42134cf43ec912ca070cb14792
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Wed Nov 25 15:39:39 2009 -0200
packagekit-qt: Added setHints(QString) conveniece function
diff --git a/lib/packagekit-qt/src/client.cpp b/lib/packagekit-qt/src/client.cpp
index 749e255..3886902 100644
--- a/lib/packagekit-qt/src/client.cpp
+++ b/lib/packagekit-qt/src/client.cpp
@@ -199,6 +199,11 @@ void Client::setHints(const QStringList& hints)
d->hints = hints;
}
+void Client::setHints(const QString& hints)
+{
+ d->hints = QStringList() << hints;
+}
+
bool Client::setProxy(const QString& http_proxy, const QString& ftp_proxy)
{
QDBusReply<void> r = d->daemon->SetProxy(http_proxy, ftp_proxy);
diff --git a/lib/packagekit-qt/src/client.h b/lib/packagekit-qt/src/client.h
index 1174a00..e77aaec 100644
--- a/lib/packagekit-qt/src/client.h
+++ b/lib/packagekit-qt/src/client.h
@@ -306,6 +306,7 @@ public:
*
* \sa Transaction::setHints
*/
+ void setHints(const QString& hints);
void setHints(const QStringList& hints);
/**
diff --git a/lib/packagekit-qt/src/transaction.cpp b/lib/packagekit-qt/src/transaction.cpp
index 3dd973b..593b762 100644
--- a/lib/packagekit-qt/src/transaction.cpp
+++ b/lib/packagekit-qt/src/transaction.cpp
@@ -173,6 +173,11 @@ void Transaction::setHints(const QStringList& hints)
d->p->SetHints(hints);
}
+void Transaction::setHints(const QString& hints)
+{
+ setHints(QStringList() << hints);
+}
+
Transaction::Status Transaction::status() const
{
return (Transaction::Status) Util::enumFromString<Transaction>(d->p->status (), "Status", "Status");
diff --git a/lib/packagekit-qt/src/transaction.h b/lib/packagekit-qt/src/transaction.h
index 6cab91a..7f0c76b 100644
--- a/lib/packagekit-qt/src/transaction.h
+++ b/lib/packagekit-qt/src/transaction.h
@@ -192,6 +192,7 @@ public:
*
* \sa Client::setHints
*/
+ void setHints(const QString& hints);
void setHints(const QStringList& hints);
/**
commit 529549faa5af6121209262d2d926f48a1ce40679
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Wed Nov 25 13:16:53 2009 -0200
packagekit-qt: fix indentation
diff --git a/lib/packagekit-qt/src/client.cpp b/lib/packagekit-qt/src/client.cpp
index 40297f5..749e255 100644
--- a/lib/packagekit-qt/src/client.cpp
+++ b/lib/packagekit-qt/src/client.cpp
@@ -414,7 +414,7 @@ Transaction* Client::searchFile(const QString& search, Filters filters)
Transaction* Client::searchFile(const QStringList& search, Filters filters)
{
- searchFile(search.join("&"), filters);
+ searchFile(search.join("&"), filters);
}
Transaction* Client::searchDetails(const QString& search, Filters filters)
commit f98501fdfa0b7074b3c430ba6f8e2c84ca43b85c
Merge: 8123492... 617e266...
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Wed Nov 25 13:15:38 2009 -0200
Merge branch 'master' of git+ssh://git.packagekit.org/srv/git/PackageKit
commit 8123492232b45f599caad72062bc1da1073c9c52
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date: Wed Nov 25 13:14:34 2009 -0200
packagekit-qt: Added multiple files support to searchFile
diff --git a/lib/packagekit-qt/src/client.cpp b/lib/packagekit-qt/src/client.cpp
index 00ecf0c..40297f5 100644
--- a/lib/packagekit-qt/src/client.cpp
+++ b/lib/packagekit-qt/src/client.cpp
@@ -412,6 +412,11 @@ Transaction* Client::searchFile(const QString& search, Filters filters)
RUN_TRANSACTION(SearchFile(Util::filtersToString(filters), search))
}
+Transaction* Client::searchFile(const QStringList& search, Filters filters)
+{
+ searchFile(search.join("&"), filters);
+}
+
Transaction* Client::searchDetails(const QString& search, Filters filters)
{
RUN_TRANSACTION(SearchDetails(Util::filtersToString(filters), search))
diff --git a/lib/packagekit-qt/src/client.h b/lib/packagekit-qt/src/client.h
index 7a513ee..1174a00 100644
--- a/lib/packagekit-qt/src/client.h
+++ b/lib/packagekit-qt/src/client.h
@@ -740,6 +740,7 @@ public:
* \p filters can be used to restrict the returned packages
*/
Transaction* searchFile(const QString& search, Filters filters = NoFilter);
+ Transaction* searchFile(const QStringList& search, Filters filters = NoFilter);
/**
* \brief Search in the packages details
commit 617e26601a7e765b9a2dd96c6ed3f24b07982ff5
Author: raven <raven at fedoraproject.org>
Date: Tue Nov 24 20:12:28 2009 +0000
Sending translation for Polish
diff --git a/po/pl.po b/po/pl.po
index a23357d..f7793bd 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: pl\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-11-24 14:27+0000\n"
-"PO-Revision-Date: 2009-11-24 17:18+0200\n"
+"POT-Creation-Date: 2009-11-24 19:57+0000\n"
+"PO-Revision-Date: 2009-11-24 21:12+0100\n"
"Last-Translator: Piotr DrÄ
g <piotrdrag at gmail.com>\n"
"Language-Team: Polish <fedora-trans-pl at redhat.com>\n"
"MIME-Version: 1.0\n"
@@ -16,123 +16,126 @@ msgstr ""
"|| n%100>=20) ? 1 : 2);\n"
#. TRANSLATORS: this is an atomic transaction
-#: ../client/pk-console.c:173
+#. TRANSLATORS: the role is the point of the transaction, e.g. update-system
+#: ../client/pk-console.c:175 ../client/pk-console.c:597
msgid "Transaction"
msgstr "Transakcja"
#. TRANSLATORS: this is the time the transaction was started in system timezone
-#: ../client/pk-console.c:175
+#: ../client/pk-console.c:177
msgid "System time"
msgstr "Czas systemowy"
#. TRANSLATORS: this is if the transaction succeeded or not
-#: ../client/pk-console.c:177
+#: ../client/pk-console.c:179
msgid "Succeeded"
msgstr "Powodzenie"
-#: ../client/pk-console.c:177
+#: ../client/pk-console.c:179
msgid "True"
msgstr "Prawda"
-#: ../client/pk-console.c:177
+#: ../client/pk-console.c:179
msgid "False"
msgstr "FaÅsz"
#. TRANSLATORS: this is the transactions role, e.g. "update-system"
#. TRANSLATORS: the trasaction role, e.g. update-system
-#: ../client/pk-console.c:179 ../src/pk-polkit-action-lookup.c:336
+#: ../client/pk-console.c:181 ../src/pk-polkit-action-lookup.c:336
msgid "Role"
msgstr "Rola"
#. TRANSLATORS: this is The duration of the transaction
-#: ../client/pk-console.c:184
+#: ../client/pk-console.c:186
msgid "Duration"
msgstr "Czas trwania"
-#: ../client/pk-console.c:184
+#: ../client/pk-console.c:186
msgid "(seconds)"
msgstr "(sekundy)"
#. TRANSLATORS: this is The command line used to do the action
#. TRANSLATORS: the command line of the thing that wants the authentication
-#: ../client/pk-console.c:188 ../src/pk-polkit-action-lookup.c:350
+#: ../client/pk-console.c:190 ../src/pk-polkit-action-lookup.c:350
msgid "Command line"
msgstr "Wiersz poleceÅ"
#. TRANSLATORS: this is the user ID of the user that started the action
-#: ../client/pk-console.c:190
+#: ../client/pk-console.c:192
msgid "User ID"
msgstr "Identyfikator użytkownika"
#. TRANSLATORS: this is the username, e.g. hughsie
-#: ../client/pk-console.c:197
+#: ../client/pk-console.c:199
msgid "Username"
msgstr "Nazwa użytkownika"
#. TRANSLATORS: this is the users real name, e.g. "Richard Hughes"
-#: ../client/pk-console.c:201
+#: ../client/pk-console.c:203
msgid "Real name"
msgstr "ImiÄ i nazwisko"
-#: ../client/pk-console.c:209
+#: ../client/pk-console.c:211
msgid "Affected packages:"
msgstr "Dotyczy pakietów:"
-#: ../client/pk-console.c:211
+#: ../client/pk-console.c:213
msgid "Affected packages: None"
msgstr "Dotyczy pakietów: żadnych"
#. TRANSLATORS: this is the distro, e.g. Fedora 10
-#: ../client/pk-console.c:246
+#: ../client/pk-console.c:248
msgid "Distribution"
msgstr "Dystrybucja"
#. TRANSLATORS: this is type of update, stable or testing
-#: ../client/pk-console.c:248
+#: ../client/pk-console.c:250
msgid "Type"
msgstr "Typ"
#. TRANSLATORS: this is any summary text describing the upgrade
#. TRANSLATORS: this is the summary of the group
-#: ../client/pk-console.c:250 ../client/pk-console.c:289
+#: ../client/pk-console.c:252 ../client/pk-console.c:291
msgid "Summary"
msgstr "Podsumowanie"
#. TRANSLATORS: this is the group category name
-#: ../client/pk-console.c:278
+#: ../client/pk-console.c:280
msgid "Category"
msgstr "Kategoria"
#. TRANSLATORS: this is group identifier
-#: ../client/pk-console.c:280
+#: ../client/pk-console.c:282
msgid "ID"
msgstr "Identyfikator"
#. TRANSLATORS: this is the parent group
-#: ../client/pk-console.c:283
+#: ../client/pk-console.c:285
msgid "Parent"
msgstr "NadrzÄdna"
#. TRANSLATORS: this is the name of the parent group
-#: ../client/pk-console.c:286
+#: ../client/pk-console.c:288
msgid "Name"
msgstr "Nazwa"
#. TRANSLATORS: this is preferred icon for the group
-#: ../client/pk-console.c:292
+#: ../client/pk-console.c:294
msgid "Icon"
msgstr "Ikona"
#. TRANSLATORS: this is a header for the package that can be updated
-#: ../client/pk-console.c:338
+#: ../client/pk-console.c:340
msgid "Details about the update:"
msgstr "SzczegóÅy aktualizacji:"
#. TRANSLATORS: details about the update, package name and version
+#. TRANSLATORS: the package that is being processed
#. TRANSLATORS: the package that is not signed by a known key
#. TRANSLATORS: the package name that was trying to be installed
#. TRANSLATORS: title, the names of the packages that the method is processing
-#: ../client/pk-console.c:344 ../lib/packagekit-glib2/pk-task-text.c:126
+#: ../client/pk-console.c:346 ../client/pk-console.c:616
+#: ../lib/packagekit-glib2/pk-task-text.c:126
#: ../lib/packagekit-glib2/pk-task-text.c:208
#: ../src/pk-polkit-action-lookup.c:361
msgid "Package"
@@ -142,69 +145,69 @@ msgstr[1] "Pakiety"
msgstr[2] "Pakietów"
#. TRANSLATORS: details about the update, any packages that this update updates
-#: ../client/pk-console.c:347
+#: ../client/pk-console.c:349
msgid "Updates"
msgstr "Aktualizuje"
#. TRANSLATORS: details about the update, any packages that this update obsoletes
-#: ../client/pk-console.c:351
+#: ../client/pk-console.c:353
msgid "Obsoletes"
msgstr "ZastÄpuje"
#. TRANSLATORS: details about the update, the vendor URLs
#. TRANSLATORS: the vendor (e.g. vmware) that is providing the EULA
-#: ../client/pk-console.c:355 ../lib/packagekit-glib2/pk-task-text.c:211
+#: ../client/pk-console.c:357 ../lib/packagekit-glib2/pk-task-text.c:211
msgid "Vendor"
msgstr "Producent"
#. TRANSLATORS: details about the update, the bugzilla URLs
-#: ../client/pk-console.c:359
+#: ../client/pk-console.c:361
msgid "Bugzilla"
msgstr "Bugzilla"
#. TRANSLATORS: details about the update, the CVE URLs
-#: ../client/pk-console.c:363
+#: ../client/pk-console.c:365
msgid "CVE"
msgstr "CVE"
#. TRANSLATORS: details about the update, if the package requires a restart
-#: ../client/pk-console.c:367
+#: ../client/pk-console.c:369
msgid "Restart"
msgstr "Uruchom ponownie"
#. TRANSLATORS: details about the update, any description of the update
-#: ../client/pk-console.c:371
+#: ../client/pk-console.c:373
msgid "Update text"
msgstr "Tekst aktualizacji"
#. TRANSLATORS: details about the update, the changelog for the package
-#: ../client/pk-console.c:375
+#: ../client/pk-console.c:377
msgid "Changes"
msgstr "Zmiany"
#. TRANSLATORS: details about the update, the ongoing state of the update
-#: ../client/pk-console.c:379
+#: ../client/pk-console.c:381
msgid "State"
msgstr "Stan"
#. TRANSLATORS: details about the update, date the update was issued
-#: ../client/pk-console.c:383
+#: ../client/pk-console.c:385
msgid "Issued"
msgstr "Wydano"
#. TRANSLATORS: details about the update, date the update was updated
#. TRANSLATORS: The action of the package, in past tense
-#: ../client/pk-console.c:387 ../lib/packagekit-glib2/pk-console-shared.c:510
+#: ../client/pk-console.c:389 ../lib/packagekit-glib2/pk-console-shared.c:510
msgid "Updated"
msgstr "Zaktualizowano"
#. TRANSLATORS: if the repo is enabled
-#: ../client/pk-console.c:423
+#: ../client/pk-console.c:425
msgid "Enabled"
msgstr "WÅÄ
czone"
#. TRANSLATORS: if the repo is disabled
-#: ../client/pk-console.c:426
+#: ../client/pk-console.c:428
msgid "Disabled"
msgstr "WyÅÄ
czone"
@@ -234,49 +237,69 @@ msgid "Application restart required by:"
msgstr "Ponowne uruchomienie programu jest wymagane przez:"
#. TRANSLATORS: This a list of details about the package
-#: ../client/pk-console.c:505
+#: ../client/pk-console.c:507
msgid "Package description"
msgstr "Opis pakietu"
#. TRANSLATORS: This a message (like a little note that may be of interest) from the transaction
-#: ../client/pk-console.c:536
+#: ../client/pk-console.c:538
msgid "Message:"
msgstr "Komunikat:"
#. TRANSLATORS: This where the package has no files
-#: ../client/pk-console.c:557
+#: ../client/pk-console.c:559
msgid "No files"
msgstr "Brak plików"
#. TRANSLATORS: This a list files contained in the package
-#: ../client/pk-console.c:562
+#: ../client/pk-console.c:564
msgid "Package files"
msgstr "Pliki pakietu"
+#. TRANSLATORS: the percentage complete of the transaction
+#: ../client/pk-console.c:632
+msgid "Percentage"
+msgstr "Procentowo"
+
+#. TRANSLATORS: the status of the transaction (e.g. downloading)
+#: ../client/pk-console.c:650
+msgid "Status"
+msgstr "Stan"
+
+#. TRANSLATORS: the results from the transaction
+#: ../client/pk-console.c:678
+msgid "Results:"
+msgstr "Wyniki:"
+
#. TRANSLATORS: we failed to get any results, which is pretty fatal in my book
-#: ../client/pk-console.c:636
+#: ../client/pk-console.c:685
msgid "Fatal error"
msgstr "Krytyczny bÅÄ
d"
#. TRANSLATORS: the transaction failed in a way we could not expect
-#: ../client/pk-console.c:645
+#: ../client/pk-console.c:694
#: ../contrib/command-not-found/pk-command-not-found.c:432
#: ../contrib/command-not-found/pk-command-not-found.c:603
msgid "The transaction failed"
msgstr "Transakcja nie powiodÅa siÄ"
+#. TRANSLATORS: print a message when there are no updates
+#: ../client/pk-console.c:721
+msgid "There are no updates available at this time."
+msgstr "Brak dostÄpnych aktualizacji w tej chwili."
+
#. TRANSLATORS: a package needs to restart their system
-#: ../client/pk-console.c:713
+#: ../client/pk-console.c:808
msgid "Please restart the computer to complete the update."
msgstr "ProszÄ uruchomiÄ ponownie komputer, aby zakoÅczyÄ aktualizacjÄ."
#. TRANSLATORS: a package needs to restart the session
-#: ../client/pk-console.c:716
+#: ../client/pk-console.c:811
msgid "Please logout and login to complete the update."
msgstr "ProszÄ wylogowaÄ siÄ i zalogowaÄ, aby zakoÅczyÄ aktualizacjÄ."
#. TRANSLATORS: a package needs to restart their system (due to security)
-#: ../client/pk-console.c:719
+#: ../client/pk-console.c:814
msgid ""
"Please restart the computer to complete the update as important security "
"updates have been installed."
@@ -285,7 +308,7 @@ msgstr ""
"zainstalowano aktualizacje bezpieczeÅstwa."
#. TRANSLATORS: a package needs to restart the session (due to security)
-#: ../client/pk-console.c:722
+#: ../client/pk-console.c:817
msgid ""
"Please logout and login to complete the update as important security updates "
"have been installed."
@@ -294,19 +317,19 @@ msgstr ""
"zainstalowano aktualizacje bezpieczeÅstwa."
#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
-#: ../client/pk-console.c:745
+#: ../client/pk-console.c:840
#, c-format
msgid "This tool could not find any available package: %s"
msgstr "Te narzÄdzie nie może odnaleÅºÄ dostÄpnych pakietów: %s"
#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
-#: ../client/pk-console.c:773
+#: ../client/pk-console.c:868
#, c-format
msgid "This tool could not find the installed package: %s"
msgstr "Te narzÄdzie nie może odnaleÅºÄ zainstalowanego pakietu: %s"
#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
-#: ../client/pk-console.c:801 ../client/pk-console.c:829
+#: ../client/pk-console.c:896 ../client/pk-console.c:924
#, c-format
msgid "This tool could not find the package: %s"
msgstr "Te narzÄdzie nie może odnaleÅºÄ pakietu: %s"
@@ -315,174 +338,182 @@ msgstr "Te narzÄdzie nie może odnaleÅºÄ pakietu: %s"
#. TRANSLATORS: There was an error getting the dependencies for the package. The detailed error follows
#. TRANSLATORS: There was an error getting the details about the package. The detailed error follows
#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
-#: ../client/pk-console.c:857 ../client/pk-console.c:885
-#: ../client/pk-console.c:913 ../client/pk-console.c:941
-#: ../client/pk-console.c:969
+#: ../client/pk-console.c:952 ../client/pk-console.c:980
+#: ../client/pk-console.c:1008 ../client/pk-console.c:1036
+#: ../client/pk-console.c:1064
#, c-format
msgid "This tool could not find all the packages: %s"
msgstr "Te narzÄdzie nie może odnaleÅºÄ wszystkich pakietów: %s"
#. TRANSLATORS: This is when the daemon crashed, and we are up shit creek without a paddle
-#: ../client/pk-console.c:998
+#: ../client/pk-console.c:1093
msgid "The daemon crashed mid-transaction!"
msgstr "Demon zawiesiÅ siÄ w poÅowie transakcji!"
#. TRANSLATORS: This is the header to the --help menu
-#: ../client/pk-console.c:1032
+#: ../client/pk-console.c:1127
msgid "PackageKit Console Interface"
msgstr "Interfejs konsoli PackageKit"
#. these are commands we can use with pkcon
-#: ../client/pk-console.c:1034
+#: ../client/pk-console.c:1129
msgid "Subcommands:"
msgstr "Podpolecenia:"
#. TRANSLATORS: we keep a database updated with the time that an action was last executed
-#: ../client/pk-console.c:1113
+#: ../client/pk-console.c:1208
msgid "Failed to get the time since this action was last completed"
msgstr ""
"Uzyskanie czasu od ostatniego zakoÅczenia tego dziaÅania nie powiodÅo siÄ"
#. TRANSLATORS: command line argument, just show the version string
-#: ../client/pk-console.c:1149 ../client/pk-monitor.c:280
+#: ../client/pk-console.c:1244 ../client/pk-monitor.c:280
msgid "Show the program version and exit"
msgstr "WyÅwietla wersjÄ programu i wyÅÄ
cza"
#. TRANSLATORS: command line argument, use a filter to narrow down results
-#: ../client/pk-console.c:1152
+#: ../client/pk-console.c:1247
msgid "Set the filter, e.g. installed"
msgstr "Ustawia filtr, np. zainstalowane"
#. TRANSLATORS: command line argument, work asynchronously
-#: ../client/pk-console.c:1155
+#: ../client/pk-console.c:1250
msgid "Exit without waiting for actions to complete"
msgstr "WyÅÄ
cza bez oczekiwania na zakoÅczenie dziaÅaÅ"
#. command line argument, do we ask questions
-#: ../client/pk-console.c:1158
+#: ../client/pk-console.c:1253
#: ../contrib/debuginfo-install/pk-debuginfo-install.c:527
msgid "Install the packages without asking for confirmation"
msgstr "Instaluje pakiety bez proÅby o potwierdzenie"
#. TRANSLATORS: command line argument, this command is not a priority
-#: ../client/pk-console.c:1161
+#: ../client/pk-console.c:1256
msgid "Run the command using idle network bandwidth and also using less power"
msgstr ""
"Wykonuje polecenie używajÄ
c bezczynnego poÅÄ
czenia sieciowego, a także "
"zużywajÄ
c mniej energii"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+#: ../client/pk-console.c:1259
+msgid ""
+"Print to screen a machine readable output, rather than using animated widgets"
+msgstr ""
+"WyÅwietla wyjÅcie czytelne dla komputera, zamiast używania animowanych "
+"widgetów"
+
#. TRANSLATORS: we failed to contact the daemon
-#: ../client/pk-console.c:1187
+#: ../client/pk-console.c:1281
msgid "Failed to contact PackageKit"
msgstr "Skontaktowanie siÄ z usÅugÄ
PackageKit nie powiodÅo siÄ"
#. TRANSLATORS: The user specified an incorrect filter
-#: ../client/pk-console.c:1241
+#: ../client/pk-console.c:1339
msgid "The filter specified was invalid"
msgstr "Podany filtr jest nieprawidÅowy"
#. TRANSLATORS: a search type can be name, details, file, etc
-#: ../client/pk-console.c:1260
+#: ../client/pk-console.c:1358
msgid "A search type is required, e.g. name"
msgstr "Wymagany jest typ wyszukiwania, np. nazwa"
#. TRANSLATORS: the user needs to provide a search term
-#: ../client/pk-console.c:1267 ../client/pk-console.c:1279
-#: ../client/pk-console.c:1291 ../client/pk-console.c:1303
+#: ../client/pk-console.c:1365 ../client/pk-console.c:1377
+#: ../client/pk-console.c:1389 ../client/pk-console.c:1401
msgid "A search term is required"
msgstr "Wymagany jest wyszukiwany termin"
#. TRANSLATORS: the search type was provided, but invalid
-#: ../client/pk-console.c:1313
+#: ../client/pk-console.c:1411
msgid "Invalid search type"
msgstr "NieprawidÅowy typ wyszukiwania"
#. TRANSLATORS: the user did not specify what they wanted to install
-#: ../client/pk-console.c:1319
+#: ../client/pk-console.c:1417
msgid "A package name to install is required"
msgstr "Wymagana jest nazwa pakietu do zainstalowania"
#. TRANSLATORS: the user did not specify what they wanted to install
-#: ../client/pk-console.c:1328
+#: ../client/pk-console.c:1426
msgid "A filename to install is required"
msgstr "Wymagana jest nazwa pliku do zainstalowania"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1340
+#: ../client/pk-console.c:1438
msgid "A type, key_id and package_id are required"
msgstr "Wymagany jest typ, key_id i package_id"
#. TRANSLATORS: the user did not specify what they wanted to remove
-#: ../client/pk-console.c:1351
+#: ../client/pk-console.c:1449
msgid "A package name to remove is required"
msgstr "Wymagana jest nazwa pakietu do usuniÄcia"
#. TRANSLATORS: the user did not specify anything about what to download or where
-#: ../client/pk-console.c:1360
+#: ../client/pk-console.c:1458
msgid "A destination directory and the package names to download are required"
msgstr "Wymagany jest katalog docelowy i nazwy pakietów do pobrania"
#. TRANSLATORS: the directory does not exist, so we can't continue
-#: ../client/pk-console.c:1367
+#: ../client/pk-console.c:1465
msgid "Directory not found"
msgstr "Nie odnaleziono katalogu"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1376
+#: ../client/pk-console.c:1474
msgid "A licence identifier (eula-id) is required"
msgstr "Wymagany jest identyfikator licencji (eula-id)"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1387
+#: ../client/pk-console.c:1485
msgid "A transaction identifier (tid) is required"
msgstr "Wymagany jest identyfikator transakcji (tid)"
#. TRANSLATORS: The user did not specify a package name
-#: ../client/pk-console.c:1408
+#: ../client/pk-console.c:1506
msgid "A package name to resolve is required"
msgstr "Wymagana jest nazwa pakietu do rozwiÄ
zania"
#. TRANSLATORS: The user did not specify a repository (software source) name
-#: ../client/pk-console.c:1419 ../client/pk-console.c:1430
+#: ../client/pk-console.c:1517 ../client/pk-console.c:1528
msgid "A repository name is required"
msgstr "Wymagana jest nazwa repozytorium"
#. TRANSLATORS: The user didn't provide any data
-#: ../client/pk-console.c:1441
+#: ../client/pk-console.c:1539
msgid "A repo name, parameter and value are required"
msgstr "Wymagana jest nazwa, parametr i wartoÅÄ repozytorium"
#. TRANSLATORS: The user didn't specify what action to use
-#: ../client/pk-console.c:1458
+#: ../client/pk-console.c:1556
msgid "An action, e.g. 'update-system' is required"
msgstr "Wymagane jest dziaÅanie, np. \"update-system\""
#. TRANSLATORS: The user specified an invalid action
-#: ../client/pk-console.c:1465
+#: ../client/pk-console.c:1563
msgid "A correct role is required"
msgstr "Wymagana jest bieżÄ
ca rola"
#. TRANSLATORS: The user did not provide a package name
#. TRANSLATORS: This is when the user fails to supply the package name
-#: ../client/pk-console.c:1475 ../client/pk-console.c:1490
-#: ../client/pk-console.c:1499 ../client/pk-console.c:1519
-#: ../client/pk-console.c:1528 ../client/pk-generate-pack.c:283
+#: ../client/pk-console.c:1573 ../client/pk-console.c:1588
+#: ../client/pk-console.c:1597 ../client/pk-console.c:1617
+#: ../client/pk-console.c:1626 ../client/pk-generate-pack.c:283
msgid "A package name is required"
msgstr "Wymagana jest nazwa pakietu"
#. TRANSLATORS: each package "provides" certain things, e.g. mime(gstreamer-decoder-mp3), the user didn't specify it
-#: ../client/pk-console.c:1508
+#: ../client/pk-console.c:1606
msgid "A package provide string is required"
msgstr "Wymagany jest ÅaÅcuch dostarczania pakietu"
#. TRANSLATORS: The user tried to use an unsupported option on the command line
-#: ../client/pk-console.c:1588
+#: ../client/pk-console.c:1686
#, c-format
msgid "Option '%s' is not supported"
msgstr "Opcja \"%s\" nie jest obsÅugiwana"
#. TRANSLATORS: Generic failure of what they asked to do
-#: ../client/pk-console.c:1598
+#: ../client/pk-console.c:1696
msgid "Command failed"
msgstr "Polecenie nie powiodÅo siÄ"
commit 32757da9f5ac1faf41426c5a7bf07c562309c3d3
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Nov 24 16:39:40 2009 +0000
trivial: switch around the symlinks to the version file as glib will soon be going away
diff --git a/lib/packagekit-glib/pk-version.h.in b/lib/packagekit-glib/pk-version.h.in
deleted file mode 100644
index 8153d1e..752c5e3
--- a/lib/packagekit-glib/pk-version.h.in
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2009 Richard Hughes <richard at hughsie.com>
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#if !defined (__PACKAGEKIT_H_INSIDE__) && !defined (PK_COMPILATION)
-#error "Only <packagekit.h> can be included directly."
-#endif
-
-#ifndef __PK_VERSION_H
-#define __PK_VERSION_H
-
-/* compile time version
- */
-#define PK_MAJOR_VERSION (@PK_MAJOR_VERSION@)
-#define PK_MINOR_VERSION (@PK_MINOR_VERSION@)
-#define PK_MICRO_VERSION (@PK_MICRO_VERSION@)
-
-/* check whether a PackageKit version equal to or greater than
- * major.minor.micro.
- */
-#define PK_CHECK_VERSION(major,minor,micro) \
- (PK_MAJOR_VERSION > (major) || \
- (PK_MAJOR_VERSION == (major) && PK_MINOR_VERSION > (minor)) || \
- (PK_MAJOR_VERSION == (major) && PK_MINOR_VERSION == (minor) && \
- PK_MICRO_VERSION >= (micro)))
-
-#endif /* __PK_VERSION_H */
diff --git a/lib/packagekit-glib/pk-version.h.in b/lib/packagekit-glib/pk-version.h.in
new file mode 120000
index 8153d1e..752c5e3
--- /dev/null
+++ b/lib/packagekit-glib/pk-version.h.in
@@ -0,0 +1 @@
+../packagekit-glib2/pk-version.h.in
\ No newline at end of file
diff --git a/lib/packagekit-glib2/pk-version.h.in b/lib/packagekit-glib2/pk-version.h.in
deleted file mode 120000
index 911a3dc..8153d1e
--- a/lib/packagekit-glib2/pk-version.h.in
+++ /dev/null
@@ -1 +0,0 @@
-../packagekit-glib/pk-version.h.in
\ No newline at end of file
diff --git a/lib/packagekit-glib2/pk-version.h.in b/lib/packagekit-glib2/pk-version.h.in
new file mode 100644
index 911a3dc..8153d1e
--- /dev/null
+++ b/lib/packagekit-glib2/pk-version.h.in
@@ -0,0 +1,44 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2009 Richard Hughes <richard at hughsie.com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__PACKAGEKIT_H_INSIDE__) && !defined (PK_COMPILATION)
+#error "Only <packagekit.h> can be included directly."
+#endif
+
+#ifndef __PK_VERSION_H
+#define __PK_VERSION_H
+
+/* compile time version
+ */
+#define PK_MAJOR_VERSION (@PK_MAJOR_VERSION@)
+#define PK_MINOR_VERSION (@PK_MINOR_VERSION@)
+#define PK_MICRO_VERSION (@PK_MICRO_VERSION@)
+
+/* check whether a PackageKit version equal to or greater than
+ * major.minor.micro.
+ */
+#define PK_CHECK_VERSION(major,minor,micro) \
+ (PK_MAJOR_VERSION > (major) || \
+ (PK_MAJOR_VERSION == (major) && PK_MINOR_VERSION > (minor)) || \
+ (PK_MAJOR_VERSION == (major) && PK_MINOR_VERSION == (minor) && \
+ PK_MICRO_VERSION >= (micro)))
+
+#endif /* __PK_VERSION_H */
More information about the PackageKit-commit
mailing list