Update to xfce4-mount 0.6.3, remove patches merged upstream.

This commit is contained in:
landry 2012-04-30 13:21:33 +00:00
parent fc9864f889
commit 673c55d588
8 changed files with 34 additions and 290 deletions

View File

@ -1,10 +1,9 @@
# $OpenBSD: Makefile,v 1.5 2011/10/14 12:22:00 jasper Exp $
# $OpenBSD: Makefile,v 1.6 2012/04/30 13:21:33 landry Exp $
COMMENT= Xfce4 mount device panel plugin
XFCE_VERSION= 0.5.5
XFCE_VERSION= 0.6.3
XFCE_PLUGIN= mount
REVISION= 3
# GPLv2
PERMIT_DISTFILES_CDROM= Yes
@ -13,14 +12,15 @@ PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
MODULES= x11/xfce4
LIB_DEPENDS = x11/xfce4/libxfcegui4
WANTLIB += GL X11 Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama
WANTLIB += Xrandr Xrender atk-1.0 c cairo expat fontconfig freetype
WANTLIB += Xrandr Xrender atk-1.0 cairo expat fontconfig freetype
WANTLIB += gdk-x11-2.0 gdk_pixbuf-2.0 gio-2.0 glib-2.0 gmodule-2.0
WANTLIB += gobject-2.0 gthread-2.0 gtk-x11-2.0 m pango-1.0 pangocairo-1.0
WANTLIB += pangoft2-1.0 pixman-1 png pthread pthread-stubs xcb
WANTLIB += xcb-render xcb-shm xfce4util xfcegui4 z
WANTLIB += pangoft2-1.0 pixman-1 png pthread-stubs xcb
WANTLIB += stdc++ xcb-aux xcb-render xcb-shm xfce4util xfce4ui-1 z
WANTLIB += ICE SM X11-xcb Xau Xdmcp Xxf86vm drm ffi pcre startup-notification-1
# needed to correctly find bindtextdomain
CONFIGURE_ENV += LIBS="-liconv"

View File

@ -1,5 +1,5 @@
MD5 (xfce4/xfce4-mount-plugin-0.5.5.tar.bz2) = HSN0aP4j5OjCkZXZuZxMXQ==
RMD160 (xfce4/xfce4-mount-plugin-0.5.5.tar.bz2) = YLdiSZp7qSNBRVbeBWKIXxIlz9U=
SHA1 (xfce4/xfce4-mount-plugin-0.5.5.tar.bz2) = EhUJPt035oRULcFDdaHDSe7mSiw=
SHA256 (xfce4/xfce4-mount-plugin-0.5.5.tar.bz2) = dvxOJxLNzjvuV76nAa/jhHclxin0dnB0HeFDZLg2+Kg=
SIZE (xfce4/xfce4-mount-plugin-0.5.5.tar.bz2) = 188141
MD5 (xfce4/xfce4-mount-plugin-0.6.3.tar.bz2) = 2/d4zxL9TFYwwzfj0RIWVw==
RMD160 (xfce4/xfce4-mount-plugin-0.6.3.tar.bz2) = E031qf/H5CkxncocBDea6iyVeHg=
SHA1 (xfce4/xfce4-mount-plugin-0.6.3.tar.bz2) = u8Ax+FGNyHPTo+9Cs+Io7rDJu4Y=
SHA256 (xfce4/xfce4-mount-plugin-0.6.3.tar.bz2) = EycunWSDFNhrszTvJ7doBnlD0SD+L3Vv0bbn+blUl2g=
SIZE (xfce4/xfce4-mount-plugin-0.6.3.tar.bz2) = 382067

View File

@ -1,166 +0,0 @@
$OpenBSD: patch-panel-plugin_devices_c,v 1.1.1.1 2009/09/17 22:05:16 landry Exp $
Rewrite all funcs using getmntent() to use getmntinfo()
use sudo for eject calls.
--- panel-plugin/devices.c.orig Sat May 17 11:49:21 2008
+++ panel-plugin/devices.c Thu Sep 17 23:48:57 2009
@@ -22,11 +22,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, U
#include <fstab.h>
#include <glib.h>
-#include <mntent.h>
#include <stdio.h>
#include <string.h>
-#include <sys/vfs.h>
+#include <sys/param.h>
+#include <sys/mount.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfcegui4/xfce-exec.h>
@@ -219,7 +223,7 @@ disk_mount (t_disk *pdisk, char *on_mount_cmd, char* m
deviceprintf (&tmp, mount_command, pdisk->device);
mountpointprintf (&tmp2, tmp, pdisk->mount_point);
if (eject)
- cmd = g_strconcat ("sh -c ' eject -t ", pdisk->device, " && ", tmp2, NULL);
+ cmd = g_strconcat ("sh -c ' sudo eject -t ", pdisk->device, " && ", tmp2, NULL);
else
cmd = g_strconcat ("sh -c ' ", tmp2, NULL);
@@ -280,7 +284,7 @@ disk_umount (t_disk *pdisk, char* umount_command, gboo
tmp = NULL;
if (eject)
- tmp = g_strconcat (cmd, " && eject ", pdisk->device, " '", NULL);
+ tmp = g_strconcat (cmd, " && sudo eject ", pdisk->device, " '", NULL);
else
tmp = g_strconcat (cmd, " '", NULL);
@@ -519,11 +523,10 @@ exclude_filesystem (GPtrArray *excluded_FSs, gchar *mo
void
disks_refresh(GPtrArray * pdisks, GPtrArray *excluded_FSs)
{
- /* using getmntent to get filesystems mount information */
+ /* using getfsstat to get filesystems mount information */
- FILE * fmtab = NULL; /* file /etc/mtab */
- struct mntent * pmntent = NULL; /* struct for mnt info */
struct statfs * pstatfs = NULL;
+ int i, nb_mounted_fs = 0;
gboolean exclude = FALSE;
TRACE("Entering disks_refresh\n");
@@ -534,60 +537,52 @@ disks_refresh(GPtrArray * pdisks, GPtrArray *excluded_
/* remove t_mount_info for all devices */
disks_free_mount_info (pdisks);
- /* allocate new struct statfs */
- pstatfs = g_new0 (struct statfs, 1);
+ /* get mounted fs */
+ nb_mounted_fs = getmntinfo(&pstatfs,MNT_WAIT);
- /* open file */
- fmtab = setmntent (MTAB, "r"); /* mtab file */
-
/* start looking for mounted devices */
- for (pmntent=getmntent(fmtab); pmntent!=NULL; pmntent=getmntent(fmtab)) {
+ for (i = 0; i < nb_mounted_fs ; i++) {
- DBG (" have entry: %s on %s \n", pmntent->mnt_fsname, pmntent->mnt_dir );
+ DBG (" have entry: %s on %s : type %s\n", pstatfs[i].f_mntfromname, pstatfs[i].f_mntonname, pstatfs[i].f_fstypename );
- statfs (pmntent->mnt_dir, pstatfs);
-
/* if we got the stat and the block number is non-zero */
/* get pointer on disk from pdisks */
/* CHANGED to reflect change in disk_search */
- pdisk = disks_search (pdisks, pmntent->mnt_dir);
+ pdisk = disks_search (pdisks, pstatfs[i].f_mntonname);
if (excluded_FSs!=NULL)
- exclude = exclude_filesystem (excluded_FSs, pmntent->mnt_dir, pmntent->mnt_fsname);
+ exclude = exclude_filesystem (excluded_FSs, pstatfs[i].f_mntonname, pstatfs[i].f_mntfromname);
if (pdisk == NULL) { /* if disk is not found in pdisks */
/* create a new struct t_disk and add it to pdisks */
/* test for mnt_dir==none or neither block device nor NFS or system device */
if ( exclude ||
- g_ascii_strcasecmp(pmntent->mnt_dir, "none") == 0 ||
- !(g_str_has_prefix(pmntent->mnt_fsname, "/dev/") ||
- g_str_has_prefix(pmntent->mnt_type, "fuse") ||
- g_str_has_prefix(pmntent->mnt_type, "nfs") ||
- g_str_has_prefix(pmntent->mnt_type, "smbfs") ||
- g_str_has_prefix(pmntent->mnt_type, "cifs") ||
- g_str_has_prefix(pmntent->mnt_type, "shfs") ) ||
- g_str_has_prefix(pmntent->mnt_dir, "/sys/")
+ g_ascii_strcasecmp(pstatfs[i].f_mntonname, "none") == 0 ||
+ !(g_str_has_prefix(pstatfs[i].f_mntfromname, "/dev/") ||
+ g_str_has_prefix(pstatfs[i].f_fstypename, "fuse") ||
+ g_str_has_prefix(pstatfs[i].f_fstypename, "nfs") ||
+ g_str_has_prefix(pstatfs[i].f_fstypename, "smbfs") ||
+ g_str_has_prefix(pstatfs[i].f_fstypename, "cifs") ||
+ g_str_has_prefix(pstatfs[i].f_fstypename, "shfs") ) ||
+ g_str_has_prefix(pstatfs[i].f_mntonname, "/sys/")
) continue;
/* else have valid entry reflecting block device or NFS */
- pdisk = disk_new (pmntent->mnt_fsname, pmntent->mnt_dir);
- pdisk->dc = disk_classify (pmntent->mnt_fsname, pmntent->mnt_dir);
+ pdisk = disk_new (pstatfs[i].f_mntfromname, pstatfs[i].f_mntonname);
+ pdisk->dc = disk_classify (pstatfs[i].f_mntfromname, pstatfs[i].f_mntonname);
g_ptr_array_add (pdisks, pdisk);
}
/* create new t_mount_info */
- mount_info = mount_info_new_from_stat (pstatfs, pmntent->mnt_type,
- pmntent->mnt_dir);
+ mount_info = mount_info_new_from_stat (&pstatfs[i], pstatfs[i].f_fstypename,
+ pstatfs[i].f_mntonname);
/* add it to pdisk */
pdisk->mount_info = mount_info ;
} /* end for */
- g_free (pstatfs);
- endmntent (fmtab); /* close file */
-
return;
}
@@ -627,25 +622,22 @@ disk_classify (char *device, char *mountpoint)
gboolean
disk_check_mounted (const char *disk)
{
- FILE *fmtab = NULL; /* file /etc/mtab */
- struct mntent *pmntent = NULL; /* struct for mnt info */
+ struct statfs * pstatfs = NULL;
+ int i, nb_mounted_fs = 0;
gboolean retval = FALSE;
- /* open file */
- fmtab = setmntent (MTAB, "r"); /* mtab file */
+ nb_mounted_fs = getmntinfo(&pstatfs,MNT_WAIT);
/* start looking for mounted devices */
- for (pmntent=getmntent(fmtab); pmntent!=NULL; pmntent=getmntent(fmtab))
+ for (i = 0; i < nb_mounted_fs ; i++)
{
- if (strcmp(pmntent->mnt_dir, disk)==0 ||
- strcmp(pmntent->mnt_fsname, disk)==0 )
+ if (strcmp(pstatfs[i].f_mntonname, disk)==0 ||
+ strcmp(pstatfs[i].f_mntfromname, disk)==0 )
{
retval = TRUE;
break;
}
}
-
- endmntent (fmtab); /* close file */
return retval;
}

View File

@ -1,18 +0,0 @@
$OpenBSD: patch-panel-plugin_devices_h,v 1.1.1.1 2009/09/17 22:05:16 landry Exp $
Permit to build with debug enabled
--- panel-plugin/devices.h.orig Thu Sep 17 23:32:22 2009
+++ panel-plugin/devices.h Thu Sep 17 23:32:28 2009
@@ -25,13 +25,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, U
#include "helpers.h"
-#ifdef DEBUG
-#undef DEBUG
-#endif
-#ifdef DEBUG_TRACE
-#undef DEBUG_TRACE
-#endif
-
/**
* An enum.
* NONE and ERROR as aliases.

View File

@ -1,18 +0,0 @@
$OpenBSD: patch-panel-plugin_mount-plugin_c,v 1.1.1.1 2009/09/17 22:05:16 landry Exp $
--- panel-plugin/mount-plugin.c.orig Thu Sep 17 22:56:11 2009
+++ panel-plugin/mount-plugin.c Thu Sep 17 22:56:25 2009
@@ -670,14 +670,6 @@ exlude_FSs_toggled (GtkWidget *widget, t_mounter_dialo
}
-static gboolean
-exclude_devicenames_toggled (GtkWidget *widget, t_mounter_dialog *md)
-{
-
-
- return TRUE;
-}
-
static void
mounter_create_options (XfcePanelPlugin *plugin, t_mounter *mt)
{

View File

@ -1,36 +0,0 @@
$OpenBSD: patch-panel-plugin_mount-plugin_h,v 1.1.1.1 2009/09/17 22:05:16 landry Exp $
Force the use of sudo & full path to mount/umount
--- panel-plugin/mount-plugin.h.orig Sat May 17 11:49:09 2008
+++ panel-plugin/mount-plugin.h Thu Sep 17 23:35:42 2009
@@ -27,19 +27,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, U
#include <config.h>
#endif
-#ifdef DEBUG
-#undef DEBUG
-#endif
-#ifdef DEBUG_TRACE
-#undef DEBUG_TRACE
-#endif
-
#include <gtk/gtk.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfcegui4/libxfcegui4.h>
#include <string.h>
+#include <stdlib.h>
#include "devices.h"
#include "helpers.h"
@@ -49,8 +43,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, U
#define BORDER 6
-#define DEFAULT_MOUNT_COMMAND "mount %d"
-#define DEFAULT_UMOUNT_COMMAND "umount %d"
+#define DEFAULT_MOUNT_COMMAND "sudo /sbin/mount %d"
+#define DEFAULT_UMOUNT_COMMAND "sudo /sbin/umount %d"
#define DEFAULT_ICON PACKAGE_DATA_DIR"/icons/hicolor/scalable/apps/xfce-mount.svg"

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-po_fr_po,v 1.1.1.1 2009/09/17 22:05:16 landry Exp $
--- po/fr.po.orig Thu Sep 17 23:03:50 2009
+++ po/fr.po Thu Sep 17 23:04:09 2009
@@ -100,7 +100,7 @@ msgstr ""
#: ../panel-plugin/mount-plugin.c:220
msgid "<span foreground=\"#FF0000\">not mounted</span>"
-msgstr "<span foreground=\"#000000\" size=\"%s\">non monté</span>"
+msgstr "<span foreground=\"#FF0000\">non monté</span>"
#: ../panel-plugin/mount-plugin.c:525
msgid "devices"

View File

@ -1,51 +1,45 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/09/17 22:05:16 landry Exp $
libexec/xfce4/
libexec/xfce4/panel-plugins/
@bin libexec/xfce4/panel-plugins/xfce4-mount-plugin
share/icons/
share/icons/hicolor/
share/icons/hicolor/48x48/
share/icons/hicolor/48x48/apps/
share/icons/hicolor/48x48/apps/xfce-mount.png
share/icons/hicolor/scalable/
share/icons/hicolor/scalable/apps/
@comment $OpenBSD: PLIST,v 1.2 2012/04/30 13:21:33 landry Exp $
@comment lib/xfce4/panel/plugins/libmount.a
@comment lib/xfce4/panel/plugins/libmount.la
lib/xfce4/panel/plugins/libmount.so
share/icons/hicolor/scalable/apps/xfce-mount.svg
share/locale/ar/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/ast/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/ca/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/cs/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/da/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/de/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/el/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/en_GB/
share/locale/en_GB/LC_MESSAGES/
share/locale/en_GB/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/es/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/eu/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/fi/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/fr/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/gl/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/hr/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/hu/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/id/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/it/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/ja/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/ko/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/lt/
share/locale/lt/LC_MESSAGES/
share/locale/lt/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/lv/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/nb_NO/
share/locale/nb_NO/LC_MESSAGES/
share/locale/nb_NO/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/nb/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/nl/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/pa/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/pl/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/pt/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/pt_BR/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/pt_PT/
share/locale/pt_PT/LC_MESSAGES/
share/locale/pt_PT/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/ru/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/sq/
share/locale/sq/LC_MESSAGES/
share/locale/sk/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/sq/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/sv/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/tr/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/ug/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/uk/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/ur/
share/locale/ur/LC_MESSAGES/
share/locale/ur/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/ur_PK/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/vi/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/zh_CN/LC_MESSAGES/xfce4-mount-plugin.mo
share/locale/zh_TW/LC_MESSAGES/xfce4-mount-plugin.mo
share/xfce4/
share/xfce4/panel-plugins/
share/xfce4/panel-plugins/xfce4-mount-plugin.desktop
share/xfce4/panel/plugins/xfce4-mount-plugin.desktop