6f33e60eef
Option to build kompmgr - from Sergey Svishchev improved kdeeject script - from Sergey Svishchev ksysguard tidyup, improved handling of process list. infocenter tidyup Add NetBSD support to kicker/applets/naughty (finally fixing PR 25052) Bump PKGREVISION.
40 lines
1.2 KiB
Text
40 lines
1.2 KiB
Text
$NetBSD: patch-bc,v 1.5 2008/01/04 21:05:57 markd Exp $
|
|
|
|
--- kdeeject/kdeeject.orig 2006-10-02 06:31:56.000000000 +1300
|
|
+++ kdeeject/kdeeject
|
|
@@ -1,6 +1,6 @@
|
|
#!/bin/sh
|
|
# Script used by kdesktop to eject a removable media (CDROM/Tape/SCSI/Floppy)
|
|
-# Relies on the 'eject' program, 'cdcontrol' on *BSD
|
|
+# Relies on the 'eject' program, 'cdcontrol' on FreeBSD
|
|
#
|
|
# Copyright GPL v2 by David Faure <david@mandrakesoft.com>
|
|
#
|
|
@@ -17,10 +17,26 @@ if test $# -ge 1 -a "$1" != "--help"; th
|
|
OpenBSD)
|
|
cdio -f $1 eject >/dev/null 2>&1
|
|
;;
|
|
- *BSD)
|
|
+ FreeBSD)
|
|
dev=`echo $1 | sed -E -e 's#/dev/##' -e 's/([0-9])./\1/'`
|
|
cdcontrol -f $dev eject >/dev/null 2>&1
|
|
;;
|
|
+ NetBSD)
|
|
+ dev=$1
|
|
+ if [ -h $1 ]; then
|
|
+ dev=$(readlink $dev 2> /dev/null) || dev=$1
|
|
+ fi
|
|
+ case $(sysctl -n kern.rawpartition 2> /dev/null) in
|
|
+ 2) rawp=c ;;
|
|
+ 3) rawp=d ;;
|
|
+ esac
|
|
+ rdev=$(echo $dev | sed -E -e 's#(/dev/)#\1r#; s#[a-z]$#'$rawp'#')
|
|
+ if [ -e $rdev ]; then
|
|
+ eject $rdev >/dev/null 2>&1
|
|
+ else
|
|
+ eject $dev >/dev/null 2>&1
|
|
+ fi
|
|
+ ;;
|
|
*)
|
|
# Warning, it has to be either eject 2.0.x or >=2.1.5
|
|
# Otherwise it doesn't work as expected (it requires a
|