[Pkg-xfce-commits] r3585 - in desktop/trunk/exo/debian: . patches
Yves-Alexis Perez
corsac at alioth.debian.org
Sat Oct 17 12:51:09 UTC 2009
Author: corsac
Date: 2009-10-17 12:51:08 +0000 (Sat, 17 Oct 2009)
New Revision: 3585
Added:
desktop/trunk/exo/debian/libexo-common.install
desktop/trunk/exo/debian/patches/03_support-mount-options.patch
desktop/trunk/exo/debian/patches/04_install-gtk-doc-in-versionned-dir.patch
Modified:
desktop/trunk/exo/debian/changelog
desktop/trunk/exo/debian/control
desktop/trunk/exo/debian/libexo-0.3-0.install
desktop/trunk/exo/debian/patches/series
Log:
* debian/patches:
- 03_support-mount-options.patch added, support extra mount options
through hal, using an rc file.
- 04_install-gtk-doc-in-versionned-dir added, install gtk-doc in a
versionned dir.
* add a new libexo-common packages containing mount options file,
documentation, helper files.
Modified: desktop/trunk/exo/debian/changelog
===================================================================
--- desktop/trunk/exo/debian/changelog 2009-10-17 08:16:12 UTC (rev 3584)
+++ desktop/trunk/exo/debian/changelog 2009-10-17 12:51:08 UTC (rev 3585)
@@ -1,3 +1,15 @@
+exo (0.3.104-3) UNRELEASED; urgency=low
+
+ * debian/patches:
+ - 03_support-mount-options.patch added, support extra mount options
+ through hal, using an rc file.
+ - 04_install-gtk-doc-in-versionned-dir added, install gtk-doc in a
+ versionned dir.
+ * add a new libexo-common packages containing mount options file,
+ documentation, helper files.
+
+ -- Yves-Alexis Perez <corsac at debian.org> Sat, 17 Oct 2009 14:34:41 +0200
+
exo (0.3.104-2) unstable; urgency=low
* debian/patches really refreshed, to avoid re-introducing fixed bugs.
Modified: desktop/trunk/exo/debian/control
===================================================================
--- desktop/trunk/exo/debian/control 2009-10-17 08:16:12 UTC (rev 3584)
+++ desktop/trunk/exo/debian/control 2009-10-17 12:51:08 UTC (rev 3585)
@@ -23,7 +23,7 @@
Package: libexo-0.3-0
Section: libs
Architecture: any
-Depends: ${shlibs:Depends}, liburi-perl
+Depends: ${shlibs:Depends}, liburi-perl, libexo-common
Description: Library with extensions for Xfce
libexo is a library for Xfce that contains a bunch of additional widgets and
a framework for editable toolbars (an improved version of the framework
@@ -61,3 +61,14 @@
Description: debugging informations for libexo
This packages contains the debugging symbols for libexo, additional library
for Xfce.
+
+Package: libexo-common
+Section: libs
+Priority: extra
+Architecture: all
+Depends: ${shlibs:Depends}
+Replaces: libexo-0.3-0 (<< 0.3.104-3)
+Description: libexo common files
+ This packages contains the common files in use by exo library. It ships
+ various helpers and desktop files, along with mountrc (mount options file),
+ and documentation.
Modified: desktop/trunk/exo/debian/libexo-0.3-0.install
===================================================================
--- desktop/trunk/exo/debian/libexo-0.3-0.install 2009-10-17 08:16:12 UTC (rev 3584)
+++ desktop/trunk/exo/debian/libexo-0.3-0.install 2009-10-17 12:51:08 UTC (rev 3585)
@@ -1,7 +1,4 @@
-etc/
usr/lib/libexo-0.3-0/*
usr/lib/lib*.so.*
-usr/share/icons
usr/share/locale/*/*/*.mo
usr/share/pixmaps
-usr/share/xfce4
Added: desktop/trunk/exo/debian/libexo-common.install
===================================================================
--- desktop/trunk/exo/debian/libexo-common.install (rev 0)
+++ desktop/trunk/exo/debian/libexo-common.install 2009-10-17 12:51:08 UTC (rev 3585)
@@ -0,0 +1,3 @@
+etc
+usr/share/xfce4
+usr/share/icons
Added: desktop/trunk/exo/debian/patches/03_support-mount-options.patch
===================================================================
--- desktop/trunk/exo/debian/patches/03_support-mount-options.patch (rev 0)
+++ desktop/trunk/exo/debian/patches/03_support-mount-options.patch 2009-10-17 12:51:08 UTC (rev 3585)
@@ -0,0 +1,296 @@
+commit 54ffc5d16920b60ecddb66777fcff90d9e6251c2
+Author: Nick Schermer <nick at xfce.org>
+Date: Sat Oct 17 13:15:23 2009 +0200
+
+ Read mount options from a rc file (bug #2891).
+
+ All the hardcoded mount options are now read from a rc file so
+ they can be easily changed by the distro or user.
+
+ Conflicts:
+
+ exo-mount/exo-mount-hal.c
+
+diff --git a/exo-mount/Makefile.am b/exo-mount/Makefile.am
+index 1851fd7..63fa279 100644
+--- a/exo-mount/Makefile.am
++++ b/exo-mount/Makefile.am
+@@ -10,6 +10,9 @@ INCLUDES = \
+ -DPATH_MOUNT=\"$(PATH_MOUNT)\" \
+ -DPATH_UMOUNT=\"$(PATH_UMOUNT)\"
+
++defaultsdir = $(sysconfdir)/xdg/xfce4
++defaults_DATA = mount.rc
++
+ bin_PROGRAMS = \
+ exo-mount
+
+@@ -52,6 +55,7 @@ install-data-local:
+ -( cd $(DESTDIR)$(bindir) ; ln -sf exo-mount exo-unmount )
+
+ EXTRA_DIST = \
++ $(defaults_DATA) \
+ README
+
+ # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
+diff --git a/exo-mount/README b/exo-mount/README
+index 30b0553..2fd9724 100644
+--- a/exo-mount/README
++++ b/exo-mount/README
+@@ -9,3 +9,5 @@ highly recommended. See the output of
+
+ for available command line options.
+
++For the mount options used by HAL, see the mount.rc file installed by exo in the
++$prefix/etc/xdg/xfce4 directory.
+diff --git a/exo-mount/exo-mount-hal.c b/exo-mount/exo-mount-hal.c
+index 548bfb1..bbf9ca3 100644
+--- a/exo-mount/exo-mount-hal.c
++++ b/exo-mount/exo-mount-hal.c
+@@ -694,8 +694,14 @@ exo_mount_hal_device_mount (ExoMountHalDevice *device,
+ gchar *fstype;
+ const gchar *fs;
+ gchar *s;
+- gint m, n = 0;
++ guint m, n;
+ const gchar *charset;
++ XfceRc *rc;
++ gchar *key;
++ gchar *option;
++ GSList *lp, *fsoptions = NULL;
++ gsize len;
++ const gchar *value;
+
+ g_return_val_if_fail (device != NULL, FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+@@ -710,60 +716,98 @@ exo_mount_hal_device_mount (ExoMountHalDevice *device,
+ else
+ fs = device->fstype;
+
++ /* open the config file and look for the filesystem group */
++ rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, "xfce4" G_DIR_SEPARATOR_S "mount.rc", FALSE);
++ if (G_LIKELY (rc != NULL))
++ {
++ if (xfce_rc_has_group (rc, fs))
++ {
++ /* set the filesystem group */
++ xfce_rc_set_group (rc, fs);
++ }
++ else
++ {
++ /* config is not usable */
++ xfce_rc_close (rc);
++ rc = NULL;
++ }
++ }
++
+ /* check if we know any valid mount options */
+ if (G_LIKELY (device->fsoptions != NULL))
+ {
+ /* process all valid mount options */
+ for (m = 0; device->fsoptions[m] != NULL; ++m)
+ {
+- /* this is currently mostly Linux specific noise */
+- if (strcmp (device->fsoptions[m], "uid=") == 0
+- && (strcmp (fs, "vfat") == 0
+- || strcmp (fs, "iso9660") == 0
+- || strcmp (fs, "udf") == 0
+- || strcmp (fs, "ntfs") == 0
+- || strcmp (fs, "ntfs-3g") == 0
+- || device->volume == NULL))
+- {
+- options[n++] = g_strdup_printf ("uid=%u", (guint) getuid ());
+- }
+- else if (strcmp (device->fsoptions[m], "shortname=") == 0
+- && strcmp (fs, "vfat") == 0)
+- {
+- options[n++] = g_strdup_printf ("shortname=winnt");
+- }
+- else if (strcmp (device->fsoptions[m], "sync") == 0
+- && device->volume == NULL)
++ option = NULL;
++
++ if (strcmp (device->fsoptions[m], "sync") == 0)
+ {
+ /* non-pollable drive... */
+- options[n++] = g_strdup ("sync");
+- }
+- else if (strcmp (device->fsoptions[m], "longnames") == 0
+- && strcmp (fs, "vfat") == 0)
+- {
+- /* however this one is FreeBSD specific */
+- options[n++] = g_strdup ("longnames");
++ option = g_strdup ("sync");
+ }
+- else if (strcmp (device->fsoptions[m], "umask=") == 0
+- && strcmp (fs, "ntfs-3g") == 0)
++ else if (rc != NULL)
+ {
+- /* we need to pass umask=0077 to ntfs-g3 or else it gets 0777 perms */
+- options[n++] = g_strdup ("umask=0077");
+- }
+- else if (strcmp (device->fsoptions[m], "iocharset=") == 0)
+- {
+- /* get the charset from a variable set by the user or glib */
+- charset = g_getenv ("EXO_MOUNT_IOCHARSET");
+- if (G_LIKELY (charset == NULL))
+- if (g_get_charset (&charset))
+- charset = "utf8";
+-
+- if (G_LIKELY (charset != NULL && *charset != '\0'))
+- options[n++] = g_strdup_printf ("iocharset=%s", charset);
++ /* option with value or enabled/disabled */
++ if (g_str_has_suffix (device->fsoptions[m], "="))
++ {
++ len = strlen (device->fsoptions[m]) - 1;
++ key = g_strndup (device->fsoptions[m], len);
++ value = xfce_rc_read_entry_untranslated (rc, key, NULL);
++
++ if (value != NULL)
++ {
++ /* substitute the <auto> options */
++ if (strcmp (value, "<auto>") == 0)
++ {
++ if (strcmp (key, "uid") == 0)
++ {
++ option = g_strdup_printf ("uid=%u", (guint) getuid ());
++ }
++ else if (strcmp (key, "gid") == 0)
++ {
++ option = g_strdup_printf ("gid=%u", (guint) getgid ());
++ }
++ else if (strcmp (key, "iocharset") == 0)
++ {
++ charset = g_getenv ("EXO_MOUNT_IOCHARSET");
++ if (charset == NULL
++ && g_get_charset (&charset))
++ charset = "utf8";
++ option = g_strdup_printf ("iocharset=%s", charset);
++ }
++ }
++ else
++ {
++ /* use the value from the rc file */
++ option = g_strdup_printf ("%s=%s", key, value);
++ }
++ }
++
++ g_free (key);
++ }
++ else if (xfce_rc_has_entry (rc, device->fsoptions[m]))
++ {
++ if (xfce_rc_read_bool_entry (rc, device->fsoptions[m], FALSE))
++ option = g_strdup (device->fsoptions[m]);
++ }
+ }
++
++ /* add the option */
++ if (option != NULL)
++ fsoptions = g_slist_prepend (fsoptions, option);
+ }
+ }
+
++ if (rc != NULL)
++ xfce_rc_close (rc);
++
++ /* create the filesystem options (+2 for possible "ro" and null terminate) */
++ options = g_new0 (gchar *, g_slist_length (fsoptions) + 2);
++ for (n = 0, lp = fsoptions; lp != NULL; lp = lp->next, ++n)
++ options[n] = lp->data;
++ g_slist_free (fsoptions);
++
+ /* try to determine a usable mount point */
+ if (G_LIKELY (device->volume != NULL))
+ {
+@@ -777,9 +821,10 @@ exo_mount_hal_device_mount (ExoMountHalDevice *device,
+ }
+
+ /* make sure that the mount point is usable (i.e. does not contain G_DIR_SEPARATOR's) */
+- mount_point = (mount_point != NULL && *mount_point != '\0')
+- ? exo_str_replace (mount_point, G_DIR_SEPARATOR_S, "_")
+- : g_strdup ("");
++ if (mount_point != NULL && *mount_point != '\0')
++ mount_point = exo_str_replace (mount_point, G_DIR_SEPARATOR_S, "_");
++ else
++ mount_point = g_strdup ("");
+
+ /* let HAL guess the fstype, unless we have an alternative preferred fstype */
+ if (G_UNLIKELY (device->altfstype != NULL))
+@@ -913,7 +958,7 @@ oom: g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM, "%s", g_strerror
+ if (dbus_error_is_set (&derror))
+ {
+ /* try to translate the error appropriately */
+- if (strcmp (derror.name, "org.freedesktop.Hal.Device.Volume.PermissionDenied") == 0)
++ if (strcmp (derror.name, "org.freedesktop.Hal.Device.Volume.PermissionDenied") == 0)
+ {
+ /* TRANSLATORS: User tried to mount a volume, but is not privileged to do so. */
+ g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("You are not privileged to mount the volume \"%s\""), device->name);
+@@ -1093,7 +1138,7 @@ oom: g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM, "%s", g_strerror (EN
+ if (G_UNLIKELY (dbus_error_is_set (&derror)))
+ {
+ /* try to translate the error appropriately */
+- if (strcmp (derror.name, "org.freedesktop.Hal.Device.Volume.PermissionDenied") == 0)
++ if (strcmp (derror.name, "org.freedesktop.Hal.Device.Volume.PermissionDenied") == 0)
+ {
+ /* TRANSLATORS: User tried to unmount a volume, but is not privileged to do so. */
+ g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("You are not privileged to unmount the volume \"%s\""), device->name);
+diff --git a/exo-mount/mount.rc b/exo-mount/mount.rc
+new file mode 100644
+index 0000000..723b841
+--- /dev/null
++++ b/exo-mount/mount.rc
+@@ -0,0 +1,54 @@
++#
++# ABOUT
++# =====
++# This file contains the mount option configuration when exo-mount is used with the HAL
++# back end (which is highly recommended). If mounting using exo is somehow not working
++# for you, you can copy this file to your $XDG_CONFIG_HOME/xfce4 directory and modify it.
++#
++# The options for each filesystem are not used when they are not in the list of
++# valid mount options provided by HAL. You can find those values using lshal and
++# search for the volume.mount.valid_options property.
++#
++#
++# EXAMPLE
++# =======
++# For example your usb device contains the vfat file system and lshal shows the
++# following valid mount options for the device:
++#
++# volume.mount.valid_options = {'ro', 'sync', 'dirsync', 'noatime', 'nodiratime',
++# 'noexec', 'quiet', 'remount', 'exec', 'uid=',
++# 'gid=', 'umask=', 'utf8'} (string list)
++#
++# All the values that end with a = character are options that contain a value,
++# the other options are booleans that can be enabled by for example putting
++# utf8=true in the group.
++#
++#
++# SUBSTITUTIONS
++# =============
++# Some options can be substituted by exo-mount when you set the value to <auto>:
++# uid : The real user ID
++# gid : The real group ID
++# iocharset: To the EXO_MOUNT_IOCHARSET or LC_CTYPE environment variable.
++#
++
++[vfat]
++uid=<auto>
++shortname=winnt
++# FreeBSD specific option
++longnames=true
++
++[iso9660]
++uid=<auto>
++
++[udf]
++uid=<auto>
++iocharset=<auto>
++
++[ntfs]
++uid=<auto>
++
++[ntfs-3g]
++uid=<auto>
++# Make sure the device does not get 0777 permissions
++umask=0077
Added: desktop/trunk/exo/debian/patches/04_install-gtk-doc-in-versionned-dir.patch
===================================================================
--- desktop/trunk/exo/debian/patches/04_install-gtk-doc-in-versionned-dir.patch (rev 0)
+++ desktop/trunk/exo/debian/patches/04_install-gtk-doc-in-versionned-dir.patch 2009-10-17 12:51:08 UTC (rev 3585)
@@ -0,0 +1,13 @@
+diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
+index f4c9cdc..41c579d 100644
+--- a/docs/reference/Makefile.am
++++ b/docs/reference/Makefile.am
+@@ -3,7 +3,7 @@
+ AUTOMAKE_OPTIONS = 1.6
+
+ # The name of the module.
+-DOC_MODULE=exo
++DOC_MODULE=exo-0.3
+
+ # The top-level SGML file.
+ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
Modified: desktop/trunk/exo/debian/patches/series
===================================================================
--- desktop/trunk/exo/debian/patches/series 2009-10-17 08:16:12 UTC (rev 3584)
+++ desktop/trunk/exo/debian/patches/series 2009-10-17 12:51:08 UTC (rev 3585)
@@ -1,2 +1,4 @@
01_fix-exo-csource-manpage.patch
02_fix-exo-open-manpage.patch
+03_support-mount-options.patch
+04_install-gtk-doc-in-versionned-dir.patch
More information about the Pkg-xfce-commits
mailing list