1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
$NetBSD: patch-ac,v 1.7 2002/11/29 02:37:22 kim Exp $
--- abcde.orig Mon Jan 28 00:44:02 2002
+++ abcde Thu Nov 28 20:57:50 2002
@@ -206,6 +206,11 @@
TRACKARTIST="$(echo $DTITLEARTIST | cut -f1 -d~)"
TRACKNAME="$(echo $DTITLEARTIST | cut -f2 -d~)"
;;
+ trailing-paren)
+ DTITLEARTIST="$(echo $TRACKNAME | sed 's,^\(.*\) (\(.*\)),\1~\2,')"
+ TRACKARTIST="$(echo $DTITLEARTIST | cut -f2 -d~)"
+ TRACKNAME="$(echo $DTITLEARTIST | cut -f1 -d~)"
+ ;;
esac
else
TRACKARTIST=$DARTIST
@@ -574,7 +579,7 @@
fi
# List out disc title/author and contents
echo ---- "$(cut '-d ' -f4- "$ABCDETEMPDIR/cddbquery")" ---- >> "$ABCDETEMPDIR/cddbchoices"
- for TRACK in $(seq 1 $TRACKS)
+ for TRACK in $(jot $TRACKS)
do
echo $TRACK: "$(grep ^TTITLE$(expr $TRACK - 1)= "$ABCDETEMPDIR/cddbread.1" | cut -f2- -d= | tr -d \\r\\n)" >> "$ABCDETEMPDIR/cddbchoices"
done
@@ -590,7 +595,7 @@
$CDDBTOOL template $(cat "$ABCDETEMPDIR/discid") > "$ABCDETEMPDIR/cddbread.1"
# List out disc title/author and contents of template
echo ---- Unknown Artist / Unknown Album ---- >> "$ABCDETEMPDIR/cddbchoices"
- for TRACK in $(seq 1 $TRACKS)
+ for TRACK in $(jot $TRACKS)
do
echo $TRACK: "$(grep ^TTITLE$(expr $TRACK - 1)= "$ABCDETEMPDIR/cddbread.1" | cut -f2- -d= | tr -d \\r\\n)" >> "$ABCDETEMPDIR/cddbchoices"
done
@@ -620,7 +625,7 @@
fi
# List out disc title/author and contents
echo \#$X: ---- "$DISCINFO" ---- >> "$ABCDETEMPDIR/cddbchoices"
- for TRACK in $(seq 1 $TRACKS)
+ for TRACK in $(jot $TRACKS)
do
echo $TRACK: "$(grep ^TTITLE$(expr $TRACK - 1)= "$ABCDETEMPDIR/cddbread.$X" | cut -f2- -d= | tr -d \\r\\n)" >> "$ABCDETEMPDIR/cddbchoices"
done
@@ -766,6 +771,9 @@
elif [ "$(grep -c "^TTITLE.*\-" "$CDDBDATA")" -gt "$(expr $NUMTRACKS / 2 )" ]; then
# More than 1/2 contain a "-", so guess forward-dash
DEFAULTSTYLE=2
+ elif [ "$(grep -c "^TTITLE.*(.*)" "$CDDBDATA")" -gt "$(expr $NUMTRACKS / 2 )" ]; then
+ # More than 1/2 contain something in parens, so guess trailing-paren
+ DEFAULTSTYLE=6
fi
echo "1) Artist / Title" >&2
@@ -773,21 +781,22 @@
echo "3) Title / Artist" >&2
echo "4) Title - Artist" >&2
echo "5) Artist: Title" >&2
- echo "6) This is a single-artist CD" >&2
- echo -n "Which style of multiple artist entries is it? [1-6] ($DEFAULTSTYLE): " >&2
+ echo "6) Title (Artist)" >&2
+ echo "7) This is a single-artist CD" >&2
+ echo -n "Which style of multiple artist entries is it? [1-7] ($DEFAULTSTYLE): " >&2
if [ "$INTERACTIVE" = "y" ]; then
read VARIOUSARTISTSTYLE
else
echo $DEFAULTSTYLE >&2
VARIOUSARTISTSTYLE=$DEFAULTSTYLE
fi
- VARIOUSARTISTSTYLE=$(echo $VARIOUSARTISTSTYLE | xargs printf %d)
+ VARIOUSARTISTSTYLE=$(echo 0$VARIOUSARTISTSTYLE | xargs printf %d)
# If they press Enter, then the default style (0) was chosen
- while [ $VARIOUSARTISTSTYLE -lt 0 ] || [ $VARIOUSARTISTSTYLE -gt 6 ]; do
- echo "Invalid selection. Please choose a number between 1 and 6."
- echo -n "Selection [1-6]: "
+ while [ $VARIOUSARTISTSTYLE -lt 0 ] || [ $VARIOUSARTISTSTYLE -gt 7 ]; do
+ echo "Invalid selection. Please choose a number between 1 and 7."
+ echo -n "Selection [1-7]: "
read VARIOUSARTISTSTYLE
- VARIOUSARTISTSTYLE=$(echo $VARIOUSARTISTSTYLE | xargs printf %d)
+ VARIOUSARTISTSTYLE=$(echo 0$VARIOUSARTISTSTYLE | xargs printf %d)
done
if [ "$VARIOUSARTISTSTYLE" = "0" ]; then
VARIOUSARTISTSTYLE=$DEFAULTSTYLE
@@ -809,7 +818,10 @@
5) # Artist: Title
VARIOUSARTISTSTYLE=colon
;;
- 6) # Single Artist
+ 6) # Title (Artist)
+ VARIOUSARTISTSTYLE=trailing-paren
+ ;;
+ 7) # Single Artist
VARIOUSARTISTS=n
;;
esac
@@ -931,7 +943,6 @@
OGGENCOPTS=
ID3OPTS=
ID3V2OPTS=
-CDPARANOIAOPTS=
CDDA2WAVOPTS=
WGETOPTS=
CDDBTOOLOPTS=
@@ -948,7 +959,7 @@
# Custom filename munging:
mungefilename ()
{
- echo "$@" | sed s,:,\ -,g | tr \ / __ | tr -d \'\"\?\[:cntrl:\]
+ echo "$@" | sed s,:,\ -,g | tr / _ | tr -d \`\'\"\?\[:cntrl:\]
}
# If CDDBAVAIL is set to n, no CDDB read is done
@@ -964,17 +975,13 @@
WAVOUTPUTDIR="$OUTPUTDIR"
fi
-# If this is a devfs system, default to /dev/cdroms/cdrom0
-# instead of /dev/cdrom
-if [ -e /dev/cdroms/cdrom0 ]; then
- CDROM=/dev/cdroms/cdrom0
-else
- CDROM=/dev/cdrom
-fi
+RAWPART=`sysctl -n kern.rawpartition | awk '{printf "%c",97+$0}'`
+CDROM=/dev/rcd0$RAWPART
+CDPARANOIAOPTS="-g ${CDROM}"
# Load system defaults
-if [ -r /etc/abcde.conf ]; then
- . /etc/abcde.conf
+if [ -r @PKG_SYSCONFBASE@/abcde.conf ]; then
+ . @PKG_SYSCONFBASE@/abcde.conf
fi
# Load user preference defaults
if [ -r $HOME/.abcde.conf ]; then
@@ -1010,7 +1017,7 @@
if [ "$RSTART" = "$REND" ]; then
NEWTRACKS="$RSTART"
else
- NEWTRACKS=$(seq -s ' ' $RSTART $REND)
+ NEWTRACKS=$(jot -s ' ' $(($REND - $RSTART + 1)) $RSTART $REND)
fi
TRACKQUEUE=$(echo "$TRACKQUEUE" "$NEWTRACKS")
@@ -1101,7 +1108,7 @@
# Make sure a buncha things exist
for X in $CDROMREADER $CDDISCID ${NEEDTAGGER+$TAGGER} $ENCODER $WGET \
- ${NEEDDISTMP3+$DISTMP3} ${NEEDCOMMENTER+$VORBISCOMMENT} seq
+ ${NEEDDISTMP3+$DISTMP3} ${NEEDCOMMENTER+$VORBISCOMMENT} jot
do
# Cut off the command-line options we just added in
X=$(echo $X | cut -d' ' -f2)
@@ -1191,7 +1198,7 @@
# Figure out where each track is going to be encoded
ENCODELOCATIONS="$(echo $REMOTEHOSTS | tr , ' ')"
if [ "$MAXPROCS" != "0" ]; then
- for NUM in $(seq 1 "$MAXPROCS")
+ for NUM in $(jot "$MAXPROCS")
do
ENCODELOCATIONS="$ENCODELOCATIONS %local$NUM%"
done
|