Subject: pkg/20763: abcde shell script gives errors when enconders not installed
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jwjr@panix.com>
List: netbsd-bugs
Date: 03/16/2003 23:53:28
>Number: 20763
>Category: pkg
>Synopsis: abcde shell script gives errors when enconders not installed
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 16 20:54:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: James B. Wetterau Jr.
>Release: NetBSD 1.6P Tue Mar 11 15:06:39 EST 2003
>Organization:
Never!
>Environment:
System: NetBSD burden 1.6P NetBSD 1.6P (BURDEN) #0: Tue Mar 11 15:06:39 EST 2003 jwjr@burden:/usr/obj/sys/arch/i386/compile/BURDEN i386
Architecture: i386
Machine: i386
>Description:
If oggenc, lame or some other enconder is not installed, a section of
the abcde shell script for encoding CD's will fail, reporting
on STDERR something like:
[: oggenc: unexpected operator
[: vorbiscomment: unexpected operator
>How-To-Repeat:
Install abcde from pkgsrc on a machine that does not have
oggenc or other encoders installed. Insert a CD in the CDROM drive
and try "abcde".
>Fix:
I have prepared the following patch in unified diff format. I
worked with a version of abcde in /tmp/bcde until I was satisfied I
had it working. The patch follows this line immediately:
--- /usr/pkg/bin/abcde 2003-03-16 23:15:46.000000000 -0500
+++ /tmp/bcde 2003-03-16 23:04:37.000000000 -0500
@@ -1237,7 +1237,9 @@
do
# Cut off the command-line options we just added in
X=$(echo $X | cut -d' ' -f2)
- if [ "$(which $X)" = "" ]; then
+ # edited to make this work properly on NetBSD
+ Y="$(which $X | cut -d' ' -f1,2)"
+ if [ "$Y" = "" -o "$Y" = "no $X" ]; then
echo "abcde error: $X is not in your path." >&2
exit 1
elif [ ! -x $(which $X) ]; then
>Release-Note:
>Audit-Trail:
>Unformatted: