[PackageKit-commit] packagekit: Branch 'master' - 8 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Tue Sep 9 06:33:03 PDT 2008
RELEASE | 16 +++---
configure.ac | 4 -
contrib/PackageKit.spec.in | 2
contrib/udev/Makefile.am | 1
contrib/udev/packagekit-firmware.sh | 5 +-
docs/html/pk-download.html | 6 +-
src/Makefile.am | 2
src/pk-engine.c | 51 ----------------------
src/pk-shared.c | 83 ++++++++++++++++++++++++++++++++++++
src/pk-shared.h | 33 ++++++++++++++
src/pk-transaction.c | 10 ++++
11 files changed, 149 insertions(+), 64 deletions(-)
New commits:
commit 4ba38b75b647561d55d055a2ab5fd310ede58b33
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Sep 9 14:25:22 2008 +0100
trivial: make the main daemon repend on udev-packagekit so we pull it in for upgrades
diff --git a/contrib/PackageKit.spec.in b/contrib/PackageKit.spec.in
index 83251cd..84b18ca 100644
--- a/contrib/PackageKit.spec.in
+++ b/contrib/PackageKit.spec.in
@@ -20,6 +20,7 @@ Requires: dbus >= %{dbus_version}
Requires: dbus-glib >= %{dbus_glib_version}
Requires: PackageKit-libs = %{version}-%{release}
Requires: yum-packagekit = %{version}-%{release}
+Requires: udev-packagekit = %{version}-%{release}
Requires: PackageKit-yum = %{version}-%{release}
Requires: shared-mime-info
Requires: python-sqlite2
commit d93d0c048012807df0af662be35ad0ec29a535f3
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Sep 9 13:48:38 2008 +0100
bugfix: fix the race where firemware is requested by udev and and old file is overwritten
diff --git a/contrib/PackageKit.spec.in b/contrib/PackageKit.spec.in
index 706ef03..83251cd 100644
--- a/contrib/PackageKit.spec.in
+++ b/contrib/PackageKit.spec.in
@@ -181,6 +181,7 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%dir %{_localstatedir}/lib/PackageKit
%dir %{python_sitelib}/packagekit
%dir %{_localstatedir}/run/PackageKit
+%dir %{_localstatedir}/run/PackageKit/udev
%dir %{_localstatedir}/cache/PackageKit
%dir %{_localstatedir}/cache/PackageKit/downloads
%{python_sitelib}/packagekit/*py*
diff --git a/contrib/udev/Makefile.am b/contrib/udev/Makefile.am
index 9a32f19..12ecb0d 100644
--- a/contrib/udev/Makefile.am
+++ b/contrib/udev/Makefile.am
@@ -3,6 +3,7 @@ dist_udevrules_DATA = 51-packagekit-firmware.rules
install-data-hook:
if test -w $(DESTDIR)/; then \
+ mkdir $(DESTDIR)/var/run/PackageKit/udev; \
mkdir -p $(DESTDIR)/lib/udev; \
cp $(top_srcdir)/contrib/udev/packagekit-firmware.sh $(DESTDIR)/lib/udev; \
fi
diff --git a/contrib/udev/packagekit-firmware.sh b/contrib/udev/packagekit-firmware.sh
index 7631cd1..14c3001 100755
--- a/contrib/udev/packagekit-firmware.sh
+++ b/contrib/udev/packagekit-firmware.sh
@@ -11,8 +11,9 @@
FIRMWARE_DIR="/lib/firmware"
if [ ! -e "$FIRMWARE_DIR/$FIRMWARE" ]; then
- # we've need firmware
- echo "$FIRMWARE_DIR/$FIRMWARE" > /var/run/PackageKit/udev-firmware
+ # we've need firmware that doesn't exist
+ fn=`mktemp -u -p /var/run/PackageKit/udev firmware-XXXXXXXX`
+ echo "$FIRMWARE_DIR/$FIRMWARE" > $fn
fi
exit 0
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 3994630..ac7c9fa 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -68,6 +68,7 @@
#include "pk-inhibit.h"
#include "pk-update-detail-list.h"
#include "pk-conf.h"
+#include "pk-shared.h"
#include "pk-cache.h"
#include "pk-notify.h"
#include "pk-security.h"
@@ -478,9 +479,8 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
gboolean ret;
GError *error = NULL;
const gchar *exit_text;
- const gchar *filename;
+ gchar *filename;
guint time;
- gint retval;
gchar *packages;
gchar *command;
@@ -595,13 +595,14 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
}
g_free (command);
}
- /* clear the firmware interface file */
- filename = "/var/run/PackageKit/udev-firmware";
- if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
- retval = g_unlink (filename);
- if (retval != 0)
- egg_warning ("failed to delete %s", filename);
- }
+
+ /* clear the firmware requests directory */
+ filename = g_build_filename (LOCALSTATEDIR, "run", "PackageKit", "udev", NULL);
+ egg_debug ("clearing udev firmware requests at %s", filename);
+ ret = pk_directory_remove_contents (filename);
+ if (!ret)
+ egg_warning ("failed to clear %s", filename);
+ g_free (filename);
}
/* we emit last, as other backends will be running very soon after us, and we don't want to be notified */
commit d9f9b5ded973848128053f2743667ae8c88e28a8
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Sep 9 13:48:01 2008 +0100
trivial: back to development, back to Werror
diff --git a/configure.ac b/configure.ac
index f3cc7db..8e258c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ dnl ---------------------------------------------------------------------------
if test "$GCC" = "yes"; then
CPPFLAGS="$CPPFLAGS -Wcast-align -Wno-uninitialized"
CPPFLAGS="$CPPFLAGS -Wall -Wformat-security -Wreturn-type"
-# CPPFLAGS="$CPPFLAGS -Werror"
+ CPPFLAGS="$CPPFLAGS -Werror"
fi
dnl ---------------------------------------------------------------------------
commit 0dec158e4c9a6ae85446cb6151963213858c85b7
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Sep 9 13:47:28 2008 +0100
trivial: move out pk_engine_remove_contents to pk_remove_directory_contents as we need this in pk-transaction.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 19db05c..14c8697 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,6 +54,8 @@ shared_SOURCES = \
pk-security.h \
pk-network.c \
pk-network.h \
+ pk-shared.c \
+ pk-shared.h \
pk-network-nm.h \
pk-network-unix.c \
pk-network-unix.h \
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 7be93e7..daa40ef 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -50,6 +50,7 @@
#include <pk-enum.h>
#include "pk-cache.h"
+#include "pk-shared.h"
#include "pk-update-detail-list.h"
#include "pk-backend.h"
#include "pk-backend-internal.h"
@@ -621,54 +622,6 @@ pk_engine_network_state_changed_cb (PkNetwork *file_monitor, PkNetworkEnum state
}
/**
- * pk_engine_remove_contents:
- *
- * Does not remove the directory itself, only the contents.
- **/
-static gboolean
-pk_engine_remove_contents (const gchar *directory)
-{
- gboolean ret = FALSE;
- GDir *dir;
- GError *error = NULL;
- const gchar *filename;
- gchar *src;
- gint retval;
-
- /* try to open */
- dir = g_dir_open (directory, 0, &error);
- if (dir == NULL) {
- egg_warning ("cannot open directory: %s", error->message);
- g_error_free (error);
- goto out;
- }
-
- /* find each */
- while ((filename = g_dir_read_name (dir))) {
- src = g_build_filename (directory, filename, NULL);
- ret = g_file_test (src, G_FILE_TEST_IS_DIR);
- if (ret) {
- egg_debug ("directory %s found in %s, deleting", filename, directory);
- /* recurse, but should be only 1 level deep */
- pk_engine_remove_contents (src);
- retval = g_remove (src);
- if (retval != 0)
- egg_warning ("failed to delete %s", src);
- } else {
- egg_debug ("file found in %s, deleting", directory);
- retval = g_unlink (src);
- if (retval != 0)
- egg_warning ("failed to delete %s", src);
- }
- g_free (src);
- }
- g_dir_close (dir);
- ret = TRUE;
-out:
- return ret;
-}
-
-/**
* pk_engine_init:
**/
static void
@@ -689,7 +642,7 @@ pk_engine_init (PkEngine *engine)
/* clear the download cache */
filename = g_build_filename (LOCALSTATEDIR, "cache", "PackageKit", "downloads", NULL);
egg_debug ("clearing download cache at %s", filename);
- pk_engine_remove_contents (filename);
+ pk_directory_remove_contents (filename);
g_free (filename);
/* setup the backend backend */
diff --git a/src/pk-shared.c b/src/pk-shared.c
new file mode 100644
index 0000000..65fa781
--- /dev/null
+++ b/src/pk-shared.c
@@ -0,0 +1,83 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007-2008 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.
+ */
+
+/**
+ * SECTION:pk-common
+ * @short_description: Common utility functions for PackageKit
+ *
+ * This file contains functions that may be useful.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib/gstdio.h>
+
+#include "egg-debug.h"
+
+/**
+ * pk_directory_remove_contents:
+ *
+ * Does not remove the directory itself, only the contents.
+ **/
+gboolean
+pk_directory_remove_contents (const gchar *directory)
+{
+ gboolean ret = FALSE;
+ GDir *dir;
+ GError *error = NULL;
+ const gchar *filename;
+ gchar *src;
+ gint retval;
+
+ /* try to open */
+ dir = g_dir_open (directory, 0, &error);
+ if (dir == NULL) {
+ egg_warning ("cannot open directory: %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
+
+ /* find each */
+ while ((filename = g_dir_read_name (dir))) {
+ src = g_build_filename (directory, filename, NULL);
+ ret = g_file_test (src, G_FILE_TEST_IS_DIR);
+ if (ret) {
+ egg_debug ("directory %s found in %s, deleting", filename, directory);
+ /* recurse, but should be only 1 level deep */
+ pk_directory_remove_contents (src);
+ retval = g_remove (src);
+ if (retval != 0)
+ egg_warning ("failed to delete %s", src);
+ } else {
+ egg_debug ("file found in %s, deleting", directory);
+ retval = g_unlink (src);
+ if (retval != 0)
+ egg_warning ("failed to delete %s", src);
+ }
+ g_free (src);
+ }
+ g_dir_close (dir);
+ ret = TRUE;
+out:
+ return ret;
+}
+
diff --git a/src/pk-shared.h b/src/pk-shared.h
new file mode 100644
index 0000000..7f867e9
--- /dev/null
+++ b/src/pk-shared.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007-2008 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.
+ */
+
+#ifndef __PK_SHARED_H
+#define __PK_SHARED_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+gboolean pk_directory_remove_contents (const gchar *directory);
+
+G_END_DECLS
+
+#endif /* __PK_SHARED_H */
commit d3bd5f6a20bdf452c48bbcd9583db8cf5c905a8e
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Sep 9 12:07:19 2008 +0100
bugfix: when we have finished RefreshCache delete the udev file if it exists
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 97d817e..3994630 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -478,7 +478,9 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
gboolean ret;
GError *error = NULL;
const gchar *exit_text;
+ const gchar *filename;
guint time;
+ gint retval;
gchar *packages;
gchar *command;
@@ -593,6 +595,13 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
}
g_free (command);
}
+ /* clear the firmware interface file */
+ filename = "/var/run/PackageKit/udev-firmware";
+ if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
+ retval = g_unlink (filename);
+ if (retval != 0)
+ egg_warning ("failed to delete %s", filename);
+ }
}
/* we emit last, as other backends will be running very soon after us, and we don't want to be notified */
commit 01d38a9459611107d9cb2e50e97d0e1d7c8c25b0
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Tue Sep 9 12:25:53 2008 +0200
fix the xhtml markup
diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index 4d7207e..fa71b6c 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -33,11 +33,11 @@ easier to install.
</li>
<li>
Ubuntu: Ubuntu 8.04 Hardy Heron ships an obsolete version (0.1.6) of PackageKit by default.
- Intrepid, the upcoming Ubuntu release, features 0.2.4, but we plan to ship 0.3.2.<br>
+ Intrepid, the upcoming Ubuntu release, features 0.2.4, but we plan to ship 0.3.2.<br/>
You can find the latest version of the 0.3 series for Hardy and Intrepid in this
<a href="https://edge.launchpad.net/~packagekit/+archive">Personal Package Archive</a>.
<a href="https://help.ubuntu.com/8.04/add-applications/C/extra-repositories-adding.html">Add</a>
- the repository and <a hfref="https://help.ubuntu.com/8.04/add-applications/C/advanced.html">
+ the repository and <a href="https://help.ubuntu.com/8.04/add-applications/C/advanced.html">
install</a> the packages <code>packagekit</code> and <code>packagekit-gnome</code>.
</li>
<li>
commit b39566d8476de1878d34721b9dfa1a49feadca8a
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Tue Sep 9 11:47:57 2008 +0200
fix the (backwards) name of the ubuntu package
diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index 5611265..4d7207e 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -38,7 +38,7 @@ easier to install.
<a href="https://edge.launchpad.net/~packagekit/+archive">Personal Package Archive</a>.
<a href="https://help.ubuntu.com/8.04/add-applications/C/extra-repositories-adding.html">Add</a>
the repository and <a hfref="https://help.ubuntu.com/8.04/add-applications/C/advanced.html">
- install</a> the packages <code>packagekit</code> and <code>gnome-packagekit</code>.
+ install</a> the packages <code>packagekit</code> and <code>packagekit-gnome</code>.
</li>
<li>
openSUSE 11: Yes, add <a href="http://download.opensuse.org/distribution/SL-OSS-factory/inst-source">this</a>
commit 3511e0a08da531d1acf65382cc7116c4ead70215
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 8 16:23:21 2008 +0100
trivial: post release version bump
diff --git a/RELEASE b/RELEASE
index 20a28bc..240ef43 100644
--- a/RELEASE
+++ b/RELEASE
@@ -3,7 +3,7 @@ PackageKit Release Notes
1. Write NEWS entries for PackageKit and gnome-packagekit in the same
format as usual. Ignore any trivial commits.
-git-shortlog PACKAGEKIT_0_3_1.. | grep -v trivial | grep -v Merge > NEWS.new
+git-shortlog PACKAGEKIT_0_3_2.. | grep -v trivial | grep -v Merge > NEWS.new
2. Add download date to docs/html/pk-download.html, save file.
@@ -11,8 +11,8 @@ git-shortlog PACKAGEKIT_0_3_1.. | grep -v trivial | grep -v Merge > NEWS.new
4. Commit changes in PackageKit git:
-git commit -a -m "Release version 0.3.2"
-git tag -a -f -m "Release 0.3.2" PACKAGEKIT_0_3_2
+git commit -a -m "Release version 0.3.3"
+git tag -a -f -m "Release 0.3.3" PACKAGEKIT_0_3_3
git push --tags
git push
git push git+ssh://hughsient@git.freedesktop.org/git/packagekit
@@ -20,8 +20,8 @@ git push --tags git+ssh://hughsient@git.freedesktop.org/git/packagekit
5. Commit changes in gnome-packagekit git:
-git commit -a -m "Release version 0.3.2"
-git-tag GNOME_PACKAGEKIT_0_3_2
+git commit -a -m "Release version 0.3.3"
+git-tag GNOME_PACKAGEKIT_0_3_3
git push --tags
git push
@@ -35,15 +35,15 @@ scp *.tar.gz packagekit.org:/srv/www/html/releases/
9. Commit changes in both projects:
-git commit -a -m "post release version bump"
+git commit -a -m "trivial: post release version bump"
git push
10. Send an email to packagekit at lists.freedesktop.org
=================================================
-Subject: PackageKit and gnome-packagekit 0.3.2 released!
+Subject: PackageKit and gnome-packagekit 0.3.3 released!
-Today I released PackageKit and gnome-packagekit 0.3.2.
+Today I released PackageKit and gnome-packagekit 0.3.3.
PackageKit release notes: http://gitweb.freedesktop.org/?p=packagekit.git;a=blob;f=NEWS
diff --git a/configure.ac b/configure.ac
index 0bffc45..f3cc7db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ(2.52)
-AC_INIT(PackageKit, 0.3.2)
+AC_INIT(PackageKit, 0.3.3)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
More information about the PackageKit-commit
mailing list