Gentoo Archives: gentoo-commits

From: "Wulf Krueger (philantrop)" <philantrop@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in kde-base/kdebase/files: agent-startup.sh kdialog-3.5.9-kdeeject-186028.patch
Date: Sun, 27 Apr 2008 01:16:01
Message-Id: E1JpvUl-0006Kc-Jj@stork.gentoo.org
1 philantrop 08/04/27 01:15:59
2
3 Modified: agent-startup.sh
4 Added: kdialog-3.5.9-kdeeject-186028.patch
5 Log:
6 Added a patch to fix ejecting by using HAL (if the necessary tools are installed). Fixes bug 186028. Added a template in agent-startup.sh for starting rxvt-unicode. Fixes bug 189201.
7 (Portage version: 2.1.5_rc6)
8
9 Revision Changes Path
10 1.5 kde-base/kdebase/files/agent-startup.sh
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdebase/files/agent-startup.sh?rev=1.5&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdebase/files/agent-startup.sh?rev=1.5&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdebase/files/agent-startup.sh?r1=1.4&r2=1.5
15
16 Index: agent-startup.sh
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/kde-base/kdebase/files/agent-startup.sh,v
19 retrieving revision 1.4
20 retrieving revision 1.5
21 diff -u -r1.4 -r1.5
22 --- agent-startup.sh 7 Feb 2005 19:03:35 -0000 1.4
23 +++ agent-startup.sh 27 Apr 2008 01:15:59 -0000 1.5
24 @@ -17,3 +17,13 @@
25 #if [ -x /usr/bin/ssh-agent ]; then
26 # eval "$(/usr/bin/ssh-agent -s)"
27 #fi
28 +
29 +# Uncomment the following lines to start rxvt-unicode which has the ability to
30 +# run multiple terminals in one single process, thus starting up faster and
31 +# saving resources.
32 +# The --opendisplay ensures that the daemon quits when the X server terminates,
33 +# therefore we don't need matching lines in agent-shutdown.sh.
34 +
35 +#if [ -x /usr/bin/urxvtd ]; then
36 +# /usr/bin/urxvtd --opendisplay --fork --quiet
37 +#fi
38
39
40
41 1.1 kde-base/kdebase/files/kdialog-3.5.9-kdeeject-186028.patch
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdebase/files/kdialog-3.5.9-kdeeject-186028.patch?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdebase/files/kdialog-3.5.9-kdeeject-186028.patch?rev=1.1&content-type=text/plain
45
46 Index: kdialog-3.5.9-kdeeject-186028.patch
47 ===================================================================
48 diff -Naur kdialog-3.5.9.orig/kdeeject/kdeeject kdialog-3.5.9/kdeeject/kdeeject
49 --- kdialog-3.5.9.orig/kdeeject/kdeeject 2006-10-01 19:31:56.000000000 +0200
50 +++ kdialog-3.5.9/kdeeject/kdeeject 2008-04-26 19:00:44.000000000 +0200
51 @@ -4,6 +4,11 @@
52 #
53 # Copyright GPL v2 by David Faure <david@××××××××××××.com>
54 #
55 +error() {
56 + kdialog --title "KDE Eject" --error "$1"
57 + exit 1
58 +}
59 +
60 if test $# -ge 1 -a "$1" != "--help"; then
61 quiet=0
62 if test "$1" = "-q"; then
63 @@ -22,10 +27,39 @@
64 cdcontrol -f $dev eject >/dev/null 2>&1
65 ;;
66 *)
67 - # Warning, it has to be either eject 2.0.x or >=2.1.5
68 - # Otherwise it doesn't work as expected (it requires a
69 - # fstab entry for no reason).
70 - eject $1 >/dev/null 2>&1
71 + # check if HAL userland tools are installed
72 + if test -x `which hal-find-by-property`; then
73 + HAL_major=`hal-find-by-property --version | cut -d " " -f 2 | cut -d. -f1`
74 + HAL_minor=`hal-find-by-property --version | cut -d " " -f 2 | cut -d. -f2`
75 + # HAL umount and eject method exist only for HAL >= 0.5
76 + if test $HAL_major -eq 0 -a $HAL_minor -ge 5 -o $HAL_major -gt 0; then
77 + # Try to find the UDi from the device name
78 + BLOCK_UDI=$(hal-find-by-property --key block.device --string "$1" | head -1)
79 + [ -n "$BLOCK_UDI" ] || error "Can't find UDI for URL $1"
80 + STORAGE_UDI=$(hal-get-property --udi $BLOCK_UDI --key block.storage_device)
81 + [ -n "$STORAGE_UDI" ] || error "Can't find device for volume $BLOCK_UDI"
82 +
83 + # Unmount each device volume
84 + for VOLUME_UDI in $(hal-find-by-property --key block.storage_device --string $STORAGE_UDI); do
85 + [ $(hal-get-property --udi $VOLUME_UDI --key block.is_volume) = true ] || continue
86 + [ $(hal-get-property --udi $VOLUME_UDI --key volume.is_mounted) = true ] || continue
87 + ERROR=$(dcop kded mediamanager unmount $VOLUME_UDI)
88 +
89 + if test -n "$ERROR"; then
90 + # try to use directly DBUS method in case mediamanager failed
91 + ERROR=$(dbus-send --system --dest=org.freedesktop.Hal "$VOLUME_UDI" org.freedesktop.Hal.Device.Volume.Unmount array:string:"" >/dev/null 2>&1)
92 + [ -n "$ERROR" ] && error "$ERROR"
93 + fi
94 + done
95 + dbus-send --system --dest=org.freedesktop.Hal "$BLOCK_UDI" org.freedesktop.Hal.Device.Volume.Eject array:string:"" >/dev/null 2>&1
96 + fi
97 + else
98 + # fallback to the old eject method
99 + # Warning, it has to be either eject 2.0.x or >=2.1.5
100 + # Otherwise it doesn't work as expected (it requires a
101 + # fstab entry for no reason).
102 + eject $1 >/dev/null 2>&1
103 + fi
104 ;;
105 esac
106 if test $? -eq 0; then
107
108
109
110 --
111 gentoo-commits@l.g.o mailing list