kdeeject fixes

This commit is contained in:
Mark Davies 2007-12-23 19:18:59 +00:00 committed by Thomas Klausner
parent ab66160ea3
commit 5403b67e5c
2 changed files with 34 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.3 2007/12/22 21:08:51 mwdavies Exp $
$NetBSD: distinfo,v 1.4 2007/12/23 19:18:59 mwdavies Exp $
SHA1 (kdebase-runtime-3.97.0.tar.bz2) = dcb1de1015de1f10ceead049b692c047e72a4992
RMD160 (kdebase-runtime-3.97.0.tar.bz2) = 361eb30accc717c2eae6544e2258098552b83069
@ -11,4 +11,5 @@ SHA1 (patch-ae) = b2728696f413b146831db62e422adcf73b132126
SHA1 (patch-af) = 521da268fc30632d6cef892393f17531846d4009
SHA1 (patch-ag) = a718fded17224b5b662611bfc55ba3be99af3905
SHA1 (patch-ah) = 06e76fc2c6b4439ce68eb844e58bae795b3a555c
SHA1 (patch-ai) = 3742a827c4b18cde06828ff585d3130062803b9a
SHA1 (patch-kdesud) = d26cc003542eb1a2922eeff313037746bd907dea

View file

@ -0,0 +1,32 @@
$NetBSD: patch-ai,v 1.1 2007/12/23 19:18:59 mwdavies Exp $
--- kdeeject/kdeeject.orig 2007-12-24 08:03:03.000000000 +1300
+++ kdeeject/kdeeject
@@ -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
+ ;;
*)
eject $1 >/dev/null 2>&1
;;