From owner-svn-ports-all@FreeBSD.ORG Thu Apr 17 05:28:35 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3EE0CEE; Thu, 17 Apr 2014 05:28:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEEFB155A; Thu, 17 Apr 2014 05:28:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3H5SZ8M053017; Thu, 17 Apr 2014 05:28:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3H5SZBF053016; Thu, 17 Apr 2014 05:28:35 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404170528.s3H5SZBF053016@svn.freebsd.org> From: Bryan Drewery Date: Thu, 17 Apr 2014 05:28:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r351448 - head/sysutils/hal/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 05:28:35 -0000 Author: bdrewery Date: Thu Apr 17 05:28:35 2014 New Revision: 351448 URL: http://svnweb.freebsd.org/changeset/ports/351448 QAT: https://qat.redports.org/buildarchive/r351448/ Log: - Fix patch files/patch-hald_hf-storage.c Revert r351423 and apply it as a patch to the patch. Reported by: O. Hartmann Modified: head/sysutils/hal/files/patch-hald_hf-storage.c Modified: head/sysutils/hal/files/patch-hald_hf-storage.c ============================================================================== --- head/sysutils/hal/files/patch-hald_hf-storage.c Thu Apr 17 05:16:47 2014 (r351447) +++ head/sysutils/hal/files/patch-hald_hf-storage.c Thu Apr 17 05:28:35 2014 (r351448) @@ -1,67 +1,106 @@ -Index: patch-hald_hf-storage.c -=================================================================== ---- patch-hald_hf-storage.c (revision 351262) -+++ patch-hald_hf-storage.c (working copy) -@@ -1,5 +1,5 @@ ----- ./hald/freebsd/hf-storage.c.orig 2009-08-24 14:42:29.000000000 +0200 --+++ ./hald/freebsd/hf-storage.c 2013-06-10 16:22:36.080280935 +0200 -+--- hald/freebsd/hf-storage.c.orig 2009-08-24 12:42:29.000000000 +0000 -++++ hald/freebsd/hf-storage.c 2014-04-16 19:04:08.004114131 +0000 - @@ -30,6 +30,7 @@ - #include - #include -@@ -8,7 +8,7 @@ - #include - #include - #include --@@ -174,6 +175,10 @@ hf_storage_device_probe_geom (HalDevice -+@@ -174,6 +175,10 @@ - if (! geom_obj) - return; - -@@ -19,7 +19,7 @@ - node = g_node_find(hf_storage_geom_tree, G_PRE_ORDER, G_TRAVERSE_ALL, - GUINT_TO_POINTER(geom_obj->hash)); - --@@ -418,10 +423,41 @@ hf_storage_parse_conftxt (const char *co -+@@ -418,10 +423,42 @@ - continue; - } - -@@ -32,7 +32,8 @@ - + ! strcmp(fields[1], "BSD") || - + ! strcmp(fields[1], "PART")) && - + (! strncmp(fields[2], "ufsid/", strlen("ufsid/")) || --+ ! strncmp(fields[2], "ufs/", strlen("ufs/")))) -++ ! strncmp(fields[2], "ufs/", strlen("ufs/")) || -++ ! strncmp(fields[2], "diskid/", strlen("diskid/")))) - + { - + g_strfreev(fields); - + continue; -@@ -61,7 +62,7 @@ - geom_obj->type = -1; /* We use -1 here to denote a missing type. */ - geom_obj->hash = hash; - --@@ -458,6 +494,13 @@ hf_storage_parse_conftxt (const char *co -+@@ -458,6 +495,13 @@ - { - g_free(geom_obj->class); - geom_obj->class = g_strdup(fields[12]); -@@ -75,7 +76,7 @@ - } - } - } --@@ -589,11 +632,18 @@ hf_storage_devd_notify (const char *syst -+@@ -589,11 +633,18 @@ - char *conftxt; - GSList *new_disks; - -@@ -95,7 +96,7 @@ - new_disks = hf_storage_parse_conftxt(conftxt); - g_free(conftxt); - --@@ -669,7 +719,7 @@ hf_storage_conftxt_timeout_cb (gpointer -+@@ -669,7 +720,7 @@ - if (hf_is_waiting) - return TRUE; - +--- ./hald/freebsd/hf-storage.c.orig 2009-08-24 14:42:29.000000000 +0200 ++++ ./hald/freebsd/hf-storage.c 2013-06-10 16:22:36.080280935 +0200 +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -174,6 +175,10 @@ hf_storage_device_probe_geom (HalDevice + if (! geom_obj) + return; + ++ /* Exclude /dev/diskid/ labels as they are duplicates. */ ++ if (strncmp(geom_obj->dev, "diskid/", 7) == 0) ++ return; ++ + node = g_node_find(hf_storage_geom_tree, G_PRE_ORDER, G_TRAVERSE_ALL, + GUINT_TO_POINTER(geom_obj->hash)); + +@@ -418,10 +423,41 @@ hf_storage_parse_conftxt (const char *co + continue; + } + ++ /* XXX This is a hack, but we need to ignore dynamic labels like ++ * ufsids which are created and destroyed based on whether or not ++ * the actual device is mounted or not. If we don't then strange ++ * things happen in applications like nautilus. ++ */ ++ if ((! strcmp(fields[1], "LABEL") || ++ ! strcmp(fields[1], "BSD") || ++ ! strcmp(fields[1], "PART")) && ++ (! strncmp(fields[2], "ufsid/", strlen("ufsid/")) || ++ ! strncmp(fields[2], "ufs/", strlen("ufs/")))) ++ { ++ g_strfreev(fields); ++ continue; ++ } ++ + geom_obj = g_new0(Geom_Object, 1); + + geom_obj->class = g_strdup(fields[1]); + geom_obj->dev = g_strdup(fields[2]); ++ /* Allow for spaces in label names. */ ++ if (! strcmp(fields[1], "LABEL")) ++ { ++ int j; ++ ++ for (j = 3; g_strv_length(fields) > (j + 2) && ++ strcmp(fields[j + 2], "i"); j++) ++ { ++ char *tmp; ++ ++ tmp = g_strdup_printf("%s %s", geom_obj->dev, fields[j]); ++ g_free(geom_obj->dev); ++ geom_obj->dev = tmp; ++ } ++ } ++ + geom_obj->type = -1; /* We use -1 here to denote a missing type. */ + geom_obj->hash = hash; + +@@ -458,6 +494,13 @@ hf_storage_parse_conftxt (const char *co + { + g_free(geom_obj->class); + geom_obj->class = g_strdup(fields[12]); ++ if (! strcmp(geom_obj->class, "BSD") && ++ geom_obj->type == FS_UNUSED) ++ { ++ geom_obj->type = FS_BSDFFS; ++ g_free(geom_obj->str_type); ++ geom_obj->str_type = g_strdup("freebsd-ufs"); ++ } + } + } + } +@@ -589,11 +632,18 @@ hf_storage_devd_notify (const char *syst + char *conftxt; + GSList *new_disks; + +- if (strcmp(system, "DEVFS") || strcmp(subsystem, "CDEV") || ++ if (! data || strcmp(system, "DEVFS") || strcmp(subsystem, "CDEV") || ++ ! strncmp(data, "cdev=ufs/", strlen("cdev=ufs/")) || ++ ! strncmp(data, "cdev=ufsid/", strlen("cdev=ufsid/")) || + (strcmp(type, "CREATE") && strcmp(type, "DESTROY"))) + return FALSE; + ++ if (! strcmp(type, "DESTROY")) ++ g_usleep(G_USEC_PER_SEC/2); ++ + conftxt = hf_get_string_sysctl(NULL, "kern.geom.conftxt"); ++ if (! conftxt) ++ return FALSE; + new_disks = hf_storage_parse_conftxt(conftxt); + g_free(conftxt); + +@@ -669,7 +719,7 @@ hf_storage_conftxt_timeout_cb (gpointer + if (hf_is_waiting) + return TRUE; + +- hf_storage_devd_notify("DEVFS", "CDEV", "CREATE", NULL); ++ hf_storage_devd_notify("DEVFS", "CDEV", "CREATE", ""); + + return TRUE; + }