rpms/ivman/devel ivman-0.6.12-mountpointcommand.diff, NONE, 1.1 ivman-0.6.12-usersync.patch, NONE, 1.1 ivman-autostart.desktop, NONE, 1.1 ivman-mount-wrapper, NONE, 1.1 ivman-umount-wrapper, NONE, 1.1 ivman.spec, 1.1, 1.2 ivman-0.6.12-gnome-mount.patch, 1.1, NONE ivman-0.6.12-new_hal.patch, 1.1, NONE
Patrice Dumas (pertusus)
fedora-extras-commits at redhat.com
Sat Feb 24 11:50:56 UTC 2007
Author: pertusus
Update of /cvs/extras/rpms/ivman/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13472
Modified Files:
ivman.spec
Added Files:
ivman-0.6.12-mountpointcommand.diff
ivman-0.6.12-usersync.patch ivman-autostart.desktop
ivman-mount-wrapper ivman-umount-wrapper
Removed Files:
ivman-0.6.12-gnome-mount.patch ivman-0.6.12-new_hal.patch
Log Message:
* Sat Feb 24 2007 Patrice Dumas <pertusus at free.fr> 0.6.14-1
- update to 0.6.14
ivman-0.6.12-mountpointcommand.diff:
--- NEW FILE ivman-0.6.12-mountpointcommand.diff ---
? src/.deps
? src/.libs
? src/Makefile
? src/Makefile.in
? src/ivman
? src/IvmConfig/Makefile
? src/IvmConfig/Makefile.in
Index: IvmConfigBase.xml.5
===================================================================
RCS file: /cvsroot/ivman/ivman/IvmConfigBase.xml.5,v
retrieving revision 1.10
diff -u -3 -p -r1.10 IvmConfigBase.xml.5
--- IvmConfigBase.xml.5 12 Nov 2005 02:47:23 -0000 1.10
+++ IvmConfigBase.xml.5 4 Oct 2006 10:15:25 -0000
@@ -89,10 +89,15 @@ Command to execute to mount devices. It
Ivman will automatically detect the best method of mounting. Specifically, Ivman tries to
use (in the following order):
.BR pmount-hal(1),
+.BR gnome-mount(1),
.BR pmount(1),
.BR mount(8).
If you specify this option, you must also specify umountcommand.
.TP
+.B mountpointcommand
+Command to execute to mount device, when a name is available for device.
+Default is mountcommand. In case the mount command is able to query hal to
+set the device name by itself, it is recommended to leave this blank.
.B umountcommand
Command to execute to unmount devices. It is recommended you leave this blank.
If you specify this option, you must also specify mountcommand.
@@ -114,7 +119,7 @@ properties. This is accomplished by surr
symbols. For instance, to use the traditional
.BR mount(8)
utility for mounting, you would set mountcommand to "mount
-'$hal.block.device$'". No character escaping is done in the substitution, but
+ '$hal.block.device$'". No character escaping is done in the substitution, but
the characters ' and " are replaced with ?, so you can surround the substitution
with quotes without fear.
Index: src/manager.c
===================================================================
RCS file: /cvsroot/ivman/ivman/src/manager.c,v
retrieving revision 1.76
diff -u -3 -p -r1.76 manager.c
--- src/manager.c 1 Oct 2006 07:18:57 -0000 1.76
+++ src/manager.c 4 Oct 2006 10:15:25 -0000
@@ -236,8 +236,13 @@ void set_mount_command()
// If command used to mount is preset, just return it
if ( cfg_base->mountcommand
&& cfg_base->umountcommand ) {
- known_mount_command = cfg_base->mountcommand;
- unknown_mount_command = known_mount_command;
+ unknown_mount_command = cfg_base->mountcommand;
+ if (cfg_base->mountpointcommand) {
+ known_mount_command = cfg_base->mountpointcommand;
+ }
+ else {
+ known_mount_command = unknown_mount_command;
+ }
umount_command = cfg_base->umountcommand;
return;
}
Index: src/userconfigs.h
===================================================================
RCS file: /cvsroot/ivman/ivman/src/userconfigs.h,v
retrieving revision 1.21
diff -u -3 -p -r1.21 userconfigs.h
--- src/userconfigs.h 18 Apr 2006 04:10:37 -0000 1.21
+++ src/userconfigs.h 4 Oct 2006 10:15:25 -0000
@@ -91,6 +91,17 @@
<ivm:Option name=\"mountcommand\" value=\"mount '$hal.block.device$'\" />\n\
-->\n\
\n\
+ <!-- mount command used when mount point name is known. Default is \n\
+ mountcommand. Can use $hal.volume.policy.desired_mount_point$,\n\
+ a name associated with the device name. Typical use is to set \n\
+ mountpoint to /media/$hal.volume.policy.desired_mount_point$.\n\
+ This should only be usefull when the mount command cannot find it\n\
+ by itself.\n\
+ -->\n\
+ <!--\n\
+ <ivm:Option name=\"mountpointcommand\" value=\"mount '$hal.block.device$' '$hal.volume.policy.desired_mount_point$'\" />\n\
+ -->\n\
+\n\
<!-- umount command. default is autodetected. Must be specified with\n\
mountcommand. -->\n\
<!--\n\
Index: src/IvmConfig/IvmConfigBase.c
===================================================================
RCS file: /cvsroot/ivman/ivman/src/IvmConfig/IvmConfigBase.c,v
retrieving revision 1.24
diff -u -3 -p -r1.24 IvmConfigBase.c
--- src/IvmConfig/IvmConfigBase.c 22 Nov 2005 00:25:58 -0000 1.24
+++ src/IvmConfig/IvmConfigBase.c 4 Oct 2006 10:15:25 -0000
@@ -116,6 +116,11 @@ IvmConfigBase *parseIvmConfigBase(char c
ret->mountcommand = (char *) strdup((char *) value);
}
+ if (!xmlStrcmp(name, (const xmlChar *) "mountpointcommand"))
+ {
+ ret->mountpointcommand = (char *) strdup((char *) value);
+ }
+
if (!xmlStrcmp(name, (const xmlChar *) "umountcommand"))
{
ret->umountcommand = (char *) strdup((char *) value);
Index: src/IvmConfig/IvmConfigBase.h
===================================================================
RCS file: /cvsroot/ivman/ivman/src/IvmConfig/IvmConfigBase.h,v
retrieving revision 1.13
diff -u -3 -p -r1.13 IvmConfigBase.h
--- src/IvmConfig/IvmConfigBase.h 6 Nov 2005 12:29:47 -0000 1.13
+++ src/IvmConfig/IvmConfigBase.h 4 Oct 2006 10:15:25 -0000
@@ -29,6 +29,7 @@ typedef struct IvmConfigBase
char *user;
char *group;
char *mountcommand;
+ char *mountpointcommand;
char *umountcommand;
char *umask;
} IvmConfigBase;
Index: src/IvmConfig/IvmConfigBase.xml
===================================================================
RCS file: /cvsroot/ivman/ivman/src/IvmConfig/IvmConfigBase.xml,v
retrieving revision 1.15
diff -u -3 -p -r1.15 IvmConfigBase.xml
--- src/IvmConfig/IvmConfigBase.xml 23 Nov 2005 00:24:24 -0000 1.15
+++ src/IvmConfig/IvmConfigBase.xml 4 Oct 2006 10:15:25 -0000
@@ -32,6 +32,17 @@
<ivm:Option name="mountcommand" value="mount '$hal.block.device$'" />
-->
+ <!-- mount command used when mount point name is known. Default is
+ mountcommand. Can use $hal.volume.policy.desired_mount_point$,
+ a name associated with the device name. Typical use is to set
+ mountpoint to /media/$hal.volume.policy.desired_mount_point$.
+ This should only be usefull when the mount command cannot find it
+ by itself.
+ -->
+ <!--
+ <ivm:Option name="mountpointcommand" value="mount '$hal.block.device$' '$hal.volume.policy.desired_mount_point$'" />
+ -->
+
<!-- umount command. default is autodetected. Must be specified with
mountcommand. -->
<!--
ivman-0.6.12-usersync.patch:
--- NEW FILE ivman-0.6.12-usersync.patch ---
--- ivman-0.6.12/src/userconfigs.h.usersync 2006-10-04 12:19:03.000000000 +0200
+++ ivman-0.6.12/src/userconfigs.h 2006-10-04 12:21:44.000000000 +0200
@@ -90,6 +90,12 @@
<!--\n\
<ivm:Option name=\"mountcommand\" value=\"mount '$hal.block.device$'\" />\n\
-->\n\
+ <!-- we change the default in fedora to mount synchronously the \n\
+ devices as ivman is autostarted on desktops where there is \n\
+ no graphical way to automount the device. \n\
+ The wrapper tries to mimick the autodetection done in ivman.\n\
+ -->\n\
+ <ivm:Option name=\"mountcommand\" value=\"ivman-mount-wrapper -d '$hal.block.device$' -u '$hal.info.udi$' -m 007 -s\" />\n\
\n\
<!-- mount command used when mount point name is known. Default is \n\
mountcommand. Can use $hal.volume.policy.desired_mount_point$,\n\
@@ -102,11 +108,16 @@
<ivm:Option name=\"mountpointcommand\" value=\"mount '$hal.block.device$' '$hal.volume.policy.desired_mount_point$'\" />\n\
-->\n\
\n\
+ <ivm:Option name=\"mountpointcommand\" value=\"ivman-mount-wrapper -d '$hal.block.device$' -u '$hal.info.udi$' -p '$hal.volume.policy.desired_mount_point$' -m 007 -s\" />\n\
+\n\
<!-- umount command. default is autodetected. Must be specified with\n\
mountcommand. -->\n\
<!--\n\
<ivm:Option name=\"umountcommand\" value=\"umount '$hal.block.device$'\" />\n\
-->\n\
+\n\
+ <ivm:Option name=\"umountcommand\" value=\"ivman-umount-wrapper -d '$hal.block.device$'\" />\n\
+\n\
</ivm:BaseConfig>\n\
"
--- NEW FILE ivman-autostart.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=ivman
Comment=Ivman volume manager
Exec=ivman
Terminal=false
Hidden=false
Type=Application
NotShowIn=XFCE;KDE;GNOME;
--- NEW FILE ivman-mount-wrapper ---
#! /bin/sh
set -x
mount_sync=no
mountpoint=
while [ $# != 0 ]; do
case "$1" in
-s) mount_sync=yes ;;
-u) udi=$2 ; shift ;;
-d) device=$2 ; shift ;;
-p) mountpoint=$2 ; shift ;;
-m) mount_umask=$2 ; shift ;;
*) break ;;
esac
shift
done
if [ x"$udi" = x -o x"$device" = x ]; then
exit 1;
fi
if [ `id -u` != 0 ]; then
if pmount-hal > /dev/null 2>&1; then
mount_cmd=pmount-hal
mount_arg=$udi
if [ $mount_sync = yes ]; then
exec $mount_cmd "$mount_arg" -s
else
exec $mount_cmd "$mount_arg"
fi
elif gnome-mount --help > /dev/null 2>&1; then
mount_cmd=gnome-mount
mount_switch=-h
mount_arg=$udi
if [ $mount_sync = yes ]; then
exec $mount_cmd -o sync $mount_switch "$mount_arg"
else
exec $mount_cmd $mount_switch "$mount_arg"
fi
fi
fi
umask_arg=
if [ z"$mount_cmd" = z ]; then
if pmount --help > /dev/null 2>&1; then
sync_switch='-s'
mount_cmd=pmount
mount_arg=$device
sync_arg=
if [ $mount_sync = yes ]; then
sync_arg=$sync_switch
fi
if [ z"$mount_umask" != z -a `id -u` = 0 ]; then
umask_arg="-u $mount_umask"
fi
if [ z"$mountpoint" != z ]; then
exec $mount_cmd $sync_arg $umask_arg "$mount_arg" "$mountpoint"
else
exec $mount_cmd $sync_arg $umask_arg "$mount_arg"
fi
else
mount_cmd=mount
sync_switch='-o sync'
sync_arg=
if [ $mount_sync = yes ]; then
sync_arg=$sync_switch
fi
mount_arg=$device
exec exec $mount_cmd $sync_arg "$mount_arg"
fi
fi
--- NEW FILE ivman-umount-wrapper ---
#! /bin/sh
set -x
umount_switch=
while [ $# != 0 ]; do
case "$1" in
-d) device=$2 ; shift ;;
*) break ;;
esac
shift
done
if [ x"$device" = x ]; then
exit 1;
fi
if [ `id -u` != 0 ]; then
if pumount > /dev/null 2>&1; then
umount_cmd=pmount
umount_arg=$device
elif gnome-mount --help > /dev/null 2>&1; then
umount_cmd=gnome-mount
umount_switch="-u -d"
umount_arg=$device
fi
fi
if [ z"$umount_cmd" = z ]; then
if pumount > /dev/null 2>&1; then
umount_cmd=pumount
umount_arg=$device
else
umount_cmd=umount
umount_arg=$device
fi
fi
exec $umount_cmd $umount_switch "$umount_arg"
Index: ivman.spec
===================================================================
RCS file: /cvs/extras/rpms/ivman/devel/ivman.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ivman.spec 3 Oct 2006 07:51:01 -0000 1.1
+++ ivman.spec 24 Feb 2007 11:50:24 -0000 1.2
@@ -1,5 +1,5 @@
Name: ivman
-Version: 0.6.12
+Version: 0.6.14
Release: 1%{?dist}
Summary: Generic handler for HAL events
@@ -9,12 +9,19 @@
Source0: http://ovh.dl.sourceforge.net/sourceforge/ivman/ivman-%{version}.tar.bz2
# taken from mandriva spec and modified
Source1: ivman-initscript
+# autostart file, not used (in the default case) in kde, gnome, xfce
+Source2: ivman-autostart.desktop
+# wrappers to be able to mount synchronously whatever the mount command is
+Source3: ivman-mount-wrapper
+Source4: ivman-umount-wrapper
+# use group 'daemon' instead of 'plugdev' (from mandriva)
+# don't output debug infos
Patch0: ivman-0.6.12-daemon.patch
-# patches from ivman cvs
-# detect gnome-mount and remove bashisms from command calls
-Patch1: ivman-0.6.12-gnome-mount.patch
-# fix automount for new hal
-Patch2: ivman-0.6.12-new_hal.patch
+# allows same flexibility through config than with the autodetected
+# mount commands
+Patch3: ivman-0.6.12-mountpointcommand.diff
+# for users, use the wrappers to detect *mount commands and mount synchronously
+Patch4: ivman-0.6.12-usersync.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -36,11 +43,15 @@
To be able to mount devices automatically as a user, you should also
install gnome-mount and/or pmount.
+Ivman is autostarted in feedesktop environment, except in those known
+to do automounting (kde, gnome, xfce). Default is to do the mounting
+synchronously for the non priviledged users.
+
%prep
%setup -q
%patch0 -p1 -b .daemon
-%patch1 -p1 -b .gnome-mount
-%patch2 -p1 -b .hal
+%patch3 -p0
+%patch4 -p1 -b .usersync
%build
@@ -52,8 +63,13 @@
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT%{_initrddir}
+mkdir -p $RPM_BUILD_ROOT%{_initrddir}
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/
install -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/%{name}
+install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/
+# copy the *mount wrapper scripts
+install -m755 %{SOURCE3} %{SOURCE4} $RPM_BUILD_ROOT%{_bindir}
+
%find_lang %{name}
@@ -85,6 +101,9 @@
%doc COPYING* AUTHORS ChangeLog README TODO
%dir %{_sysconfdir}/ivman
%config(noreplace) %{_sysconfdir}/ivman/IvmConfig*.xml
+# dubious, but currently it is owned by gnome-session...
+%dir %{_sysconfdir}/xdg/autostart/
+%config(noreplace) %{_sysconfdir}/xdg/autostart/ivman-autostart.desktop
%{_initrddir}/%{name}
%{_bindir}/ivman*
%{_mandir}/man5/IvmConfig*.5*
@@ -92,5 +111,13 @@
%changelog
+* Sat Feb 24 2007 Patrice Dumas <pertusus at free.fr> 0.6.14-1
+- update to 0.6.14
+
+* Wed Oct 4 2006 Patrice Dumas <pertusus at free.fr> 0.6.12-2
+- add wrapper scripts to be able to detect the mount command and mount
+ synchronously
+- add an autostart file, disabled for gnome, kde and xfce
+
* Sun Sep 24 2006 Patrice Dumas <pertusus at free.fr> 0.6.12-1
- initial packaging
--- ivman-0.6.12-gnome-mount.patch DELETED ---
--- ivman-0.6.12-new_hal.patch DELETED ---
More information about the scm-commits
mailing list