Update to (meta-)tracker-0.12.6.

This commit is contained in:
ajacoutot 2011-10-21 14:26:56 +00:00
parent d4b19dfb56
commit 5f6d01af2e
4 changed files with 40 additions and 36 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.82 2011/10/16 08:54:53 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.83 2011/10/21 14:26:56 ajacoutot Exp $
# XXX Binary files patch-src_tracker-control_tracker-control-general_c
# and patch-src_tracker-control_tracker-control-general_c.new differ
@ -11,7 +11,7 @@ COMMENT-evolution= (meta-)tracker indexer plugin for evolution
COMMENT-nautilus= (meta-)tracker tagging plugin for nautilus
GNOME_PROJECT= tracker
GNOME_VERSION= 0.12.5
GNOME_VERSION= 0.12.6
# there is already audio/tracker, so this port has to live
# as meta-tracker.

View File

@ -1,5 +1,5 @@
MD5 (gnome/tracker-0.12.5.tar.xz) = WTvJyVTU+RfhGK1MJgHokQ==
RMD160 (gnome/tracker-0.12.5.tar.xz) = k2xV5A5g00UXM1J1ZdF/ruMUQNY=
SHA1 (gnome/tracker-0.12.5.tar.xz) = fI8Y3RtI9fIuN+O2ua+ToS7a3Nc=
SHA256 (gnome/tracker-0.12.5.tar.xz) = X929qd8Q+toH8zV1E3Dka14rXvlx1NqO/UfqeV17XFs=
SIZE (gnome/tracker-0.12.5.tar.xz) = 5957112
MD5 (gnome/tracker-0.12.6.tar.xz) = zBbrcUKmvi1KY57OrHo3Fg==
RMD160 (gnome/tracker-0.12.6.tar.xz) = yk9JcyNg+rfTuTSqoTzecmzcHKI=
SHA1 (gnome/tracker-0.12.6.tar.xz) = jZWemsrhRFvBzHlWHxQ4/BD+5ug=
SHA256 (gnome/tracker-0.12.6.tar.xz) = TcX+D+l9QJVlOTWWmxLBWIjmIOW27xNTMc5/Va82VLg=
SIZE (gnome/tracker-0.12.6.tar.xz) = 5966928

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-src_tracker-control_tracker-control-general_c,v 1.3 2011/10/16 08:54:53 ajacoutot Exp $
--- src/tracker-control/tracker-control-general.c.orig Sun Oct 16 09:37:10 2011
+++ src/tracker-control/tracker-control-general.c Sun Oct 16 09:44:23 2011
$OpenBSD: patch-src_tracker-control_tracker-control-general_c,v 1.4 2011/10/21 14:26:56 ajacoutot Exp $
--- src/tracker-control/tracker-control-general.c.orig Thu Oct 20 17:37:11 2011
+++ src/tracker-control/tracker-control-general.c Fri Oct 21 15:27:49 2011
@@ -21,6 +21,16 @@
#include <errno.h>
@ -40,13 +40,8 @@ $OpenBSD: patch-src_tracker-control_tracker-control-general_c,v 1.3 2011/10/16 0
list_processes) {
- guint32 own_pid;
- guint32 own_uid;
- gchar *own_uid_str;
+ gchar *basename, **strv;
+ int i, nproc;
+ struct kinfo_proc *plist, *kp;
+ char buf[_POSIX2_LINE_MAX];
+ kvm_t *kd;
- gchar *own_pid_str;
-
- pids = get_pids ();
- str = g_strdup_printf (g_dngettext (NULL,
- "Found %d PID…",
@ -55,20 +50,13 @@ $OpenBSD: patch-src_tracker-control_tracker-control-general_c,v 1.3 2011/10/16 0
- g_slist_length (pids));
- g_print ("%s\n", str);
- g_free (str);
+ if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, buf)) == NULL) {
+ printf("%s\n", buf);
+ return EXIT_FAILURE;
+ }
-
- /* Establish own uid/pid */
- own_pid = (guint32) getpid ();
- own_uid_str = g_strdup_printf ("%d", own_pid);
- own_uid = get_uid_for_pid (own_uid_str, NULL);
- g_free (own_uid_str);
+ plist = kvm_getprocs(kd, KERN_PROC_ALL, 0, sizeof(*plist), &nproc);
+ if (plist == NULL)
+ return EXIT_FAILURE;
- own_pid_str = g_strdup_printf ("%d", own_pid);
- own_uid = get_uid_for_pid (own_pid_str, NULL);
- g_free (own_pid_str);
-
- for (l = pids; l; l = l->next) {
- GError *error = NULL;
- gchar *filename;
@ -80,12 +68,27 @@ $OpenBSD: patch-src_tracker-control_tracker-control-general_c,v 1.3 2011/10/16 0
-
- /* Stat the file and make sure current user == file owner */
- if (uid != own_uid) {
+ gchar *basename, **strv;
+ int i, nproc;
+ struct kinfo_proc *plist, *kp;
+ char buf[_POSIX2_LINE_MAX];
+ kvm_t *kd;
+
+ if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, buf)) == NULL) {
+ printf("%s\n", buf);
+ return EXIT_FAILURE;
+ }
+
+ plist = kvm_getprocs(kd, KERN_PROC_ALL, 0, sizeof(*plist), &nproc);
+ if (plist == NULL)
+ return EXIT_FAILURE;
+
+ for (i = 0, kp = plist; i < nproc; i++, kp++) {
+ if ((kp->p_flag & P_SYSTEM) != 0)
continue;
- }
- /* Get contents to determin basename */
- /* Get contents to determine basename */
- if (!g_file_get_contents (filename, &contents, NULL, &error)) {
- str = g_strdup_printf (_("Could not open '%s'"), filename);
- g_printerr ("%s, %s\n",
@ -97,11 +100,12 @@ $OpenBSD: patch-src_tracker-control_tracker-control-general_c,v 1.3 2011/10/16 0
- g_free (filename);
+ if ((strv = kvm_getargv(kd, kp, 0)) == NULL)
+ continue;
+
+ basename = g_path_get_basename(strv[0]);
- continue;
- }
+ basename = g_path_get_basename(strv[0]);
-
- strv = g_strsplit (contents, "^@", 2);
- if (strv && strv[0]) {
- gchar *basename;

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_tracker-extract_tracker-extract-text_c,v 1.2 2011/09/26 12:31:40 ajacoutot Exp $
--- src/tracker-extract/tracker-extract-text.c.orig Mon Sep 26 11:27:10 2011
+++ src/tracker-extract/tracker-extract-text.c Mon Sep 26 12:31:22 2011
@@ -61,10 +61,14 @@ get_file_content (GFile *file,
$OpenBSD: patch-src_tracker-extract_tracker-extract-text_c,v 1.3 2011/10/21 14:26:56 ajacoutot Exp $
--- src/tracker-extract/tracker-extract-text.c.orig Thu Oct 20 17:37:11 2011
+++ src/tracker-extract/tracker-extract-text.c Fri Oct 21 15:22:12 2011
@@ -60,10 +60,14 @@ get_file_content (GFile *file,
/* Get filename from URI */
path = g_file_get_path (file);