diff options
author | Wulf Krueger <philantrop@gentoo.org> | 2008-04-26 17:22:09 +0000 |
---|---|---|
committer | Wulf Krueger <philantrop@gentoo.org> | 2008-04-26 17:22:09 +0000 |
commit | 5ccc902dc02b218ffa10c5fef0d3c778c5899f6b (patch) | |
tree | 7a4475ff98bdf9d10e80c6358451e531451b4abc /kde-base/kdialog | |
parent | Bump for the GCC version fix. (diff) | |
download | gentoo-2-5ccc902dc02b218ffa10c5fef0d3c778c5899f6b.tar.gz gentoo-2-5ccc902dc02b218ffa10c5fef0d3c778c5899f6b.tar.bz2 gentoo-2-5ccc902dc02b218ffa10c5fef0d3c778c5899f6b.zip |
Added a patch to fix ejecting by using HAL (if the necessary tools are installed). Fixes bug 186028.
(Portage version: 2.1.5_rc6)
Diffstat (limited to 'kde-base/kdialog')
-rw-r--r-- | kde-base/kdialog/ChangeLog | 9 | ||||
-rw-r--r-- | kde-base/kdialog/files/kdialog-3.5.9-kdeeject-186028.patch | 59 | ||||
-rw-r--r-- | kde-base/kdialog/kdialog-3.5.9-r1.ebuild | 19 |
3 files changed, 86 insertions, 1 deletions
diff --git a/kde-base/kdialog/ChangeLog b/kde-base/kdialog/ChangeLog index 3b37bb593277..5ff4a03a8294 100644 --- a/kde-base/kdialog/ChangeLog +++ b/kde-base/kdialog/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for kde-base/kdialog # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdialog/ChangeLog,v 1.75 2008/04/03 21:03:16 philantrop Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdialog/ChangeLog,v 1.76 2008/04/26 17:22:08 philantrop Exp $ + +*kdialog-3.5.9-r1 (26 Apr 2008) + + 26 Apr 2008; Wulf C. Krueger <philantrop@gentoo.org> + +files/kdialog-3.5.9-kdeeject-186028.patch, +kdialog-3.5.9-r1.ebuild: + Added a patch to fix ejecting by using HAL (if the necessary tools are + installed). Fixes bug 186028. *kdialog-4.0.3 (03 Apr 2008) diff --git a/kde-base/kdialog/files/kdialog-3.5.9-kdeeject-186028.patch b/kde-base/kdialog/files/kdialog-3.5.9-kdeeject-186028.patch new file mode 100644 index 000000000000..4607adac3a6d --- /dev/null +++ b/kde-base/kdialog/files/kdialog-3.5.9-kdeeject-186028.patch @@ -0,0 +1,59 @@ +diff -Naur kdialog-3.5.9.orig/kdeeject/kdeeject kdialog-3.5.9/kdeeject/kdeeject +--- kdialog-3.5.9.orig/kdeeject/kdeeject 2006-10-01 19:31:56.000000000 +0200 ++++ kdialog-3.5.9/kdeeject/kdeeject 2008-04-26 19:00:44.000000000 +0200 +@@ -4,6 +4,11 @@ + # + # Copyright GPL v2 by David Faure <david@mandrakesoft.com> + # ++error() { ++ kdialog --title "KDE Eject" --error "$1" ++ exit 1 ++} ++ + if test $# -ge 1 -a "$1" != "--help"; then + quiet=0 + if test "$1" = "-q"; then +@@ -22,10 +27,39 @@ + cdcontrol -f $dev eject >/dev/null 2>&1 + ;; + *) +- # Warning, it has to be either eject 2.0.x or >=2.1.5 +- # Otherwise it doesn't work as expected (it requires a +- # fstab entry for no reason). +- eject $1 >/dev/null 2>&1 ++ # check if HAL userland tools are installed ++ if test -x `which hal-find-by-property`; then ++ HAL_major=`hal-find-by-property --version | cut -d " " -f 2 | cut -d. -f1` ++ HAL_minor=`hal-find-by-property --version | cut -d " " -f 2 | cut -d. -f2` ++ # HAL umount and eject method exist only for HAL >= 0.5 ++ if test $HAL_major -eq 0 -a $HAL_minor -ge 5 -o $HAL_major -gt 0; then ++ # Try to find the UDi from the device name ++ BLOCK_UDI=$(hal-find-by-property --key block.device --string "$1" | head -1) ++ [ -n "$BLOCK_UDI" ] || error "Can't find UDI for URL $1" ++ STORAGE_UDI=$(hal-get-property --udi $BLOCK_UDI --key block.storage_device) ++ [ -n "$STORAGE_UDI" ] || error "Can't find device for volume $BLOCK_UDI" ++ ++ # Unmount each device volume ++ for VOLUME_UDI in $(hal-find-by-property --key block.storage_device --string $STORAGE_UDI); do ++ [ $(hal-get-property --udi $VOLUME_UDI --key block.is_volume) = true ] || continue ++ [ $(hal-get-property --udi $VOLUME_UDI --key volume.is_mounted) = true ] || continue ++ ERROR=$(dcop kded mediamanager unmount $VOLUME_UDI) ++ ++ if test -n "$ERROR"; then ++ # try to use directly DBUS method in case mediamanager failed ++ ERROR=$(dbus-send --system --dest=org.freedesktop.Hal "$VOLUME_UDI" org.freedesktop.Hal.Device.Volume.Unmount array:string:"" >/dev/null 2>&1) ++ [ -n "$ERROR" ] && error "$ERROR" ++ fi ++ done ++ dbus-send --system --dest=org.freedesktop.Hal "$BLOCK_UDI" org.freedesktop.Hal.Device.Volume.Eject array:string:"" >/dev/null 2>&1 ++ fi ++ else ++ # fallback to the old eject method ++ # Warning, it has to be either eject 2.0.x or >=2.1.5 ++ # Otherwise it doesn't work as expected (it requires a ++ # fstab entry for no reason). ++ eject $1 >/dev/null 2>&1 ++ fi + ;; + esac + if test $? -eq 0; then diff --git a/kde-base/kdialog/kdialog-3.5.9-r1.ebuild b/kde-base/kdialog/kdialog-3.5.9-r1.ebuild new file mode 100644 index 000000000000..fb152502d2c8 --- /dev/null +++ b/kde-base/kdialog/kdialog-3.5.9-r1.ebuild @@ -0,0 +1,19 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdialog/kdialog-3.5.9-r1.ebuild,v 1.1 2008/04/26 17:22:08 philantrop Exp $ + +KMNAME=kdebase +EAPI="1" +inherit kde-meta eutils + +DESCRIPTION="KDialog can be used to show nice dialog boxes from shell scripts" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="kdehiddenvisibility" + +# Uses cdcontrol on FreeBSD +RDEPEND="kernel_linux? ( || ( >=sys-apps/eject-2.1.5 sys-block/unieject ) ) " + +KMEXTRA="kdeeject" +KMNODOCS=true + +PATCHES=( "${FILESDIR}/${P}-kdeeject-186028.patch" ) |