CDDB_get-2.27p1.patch
2.24 KB
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
diff -Naur CDDB_get-2.27/CDDB_get.pm CDDB_get-2.27.patched/CDDB_get.pm
--- CDDB_get-2.27/CDDB_get.pm 2006-01-01 20:52:54.000000000 +0100
+++ CDDB_get-2.27.patched/CDDB_get.pm 2006-05-27 09:54:30.733131044 +0200
@@ -262,6 +262,7 @@
my $input = $config->{input};
my $multi = $config->{multi};
+ my $entry = $config->{entry} if (defined($config->{entry}));
$input = 0 if $multi;
print STDERR Dumper($config) if $debug;
@@ -441,7 +442,14 @@
}
}
} else {
- push @to_get,@list;
+ unless(defined($entry)) {
+ push @to_get,@list;
+ }
+ else {
+ if($entry-1 >= 0 && $entry-1 <= $#list) {
+ push @to_get,$list[$entry-1];
+ }
+ }
}
my $i=0;
diff -Naur CDDB_get-2.27/cddb.pl CDDB_get-2.27.patched/cddb.pl
--- CDDB_get-2.27/cddb.pl 2005-10-06 08:00:59.000000000 +0200
+++ CDDB_get-2.27.patched/cddb.pl 2006-05-27 09:56:17.798156565 +0200
@@ -27,12 +27,13 @@
use strict;
my %option = ();
-getopts("oghdtsi:SfDlOFc:H:CIRGP", \%option);
+getopts("oghdtsi:SfDlOFe:c:H:CIRGP", \%option);
if($option{h}) {
print "$0: gets CDDB info of a CD\n";
print " no argument - gets CDDB info of CD in your drive\n";
print " -c device (other than default device)\n";
+ print " -e which cddb-entry to use\n";
print " -o offline mode - just stores CD info\n";
print " -d output in xmcd format\n";
print " -s save in xmcd format\n";
@@ -110,11 +111,19 @@
$config{CD_DEVICE}=$option{c} if $option{c};
# user interaction welcome?
-
-$config{input}=1; # 1: ask user if more than one possibility
- # 0: no user interaction
-$config{multi}=0; # 1: do not ask user and get all of them
- # 0: just the first one
+if($option{e}) {
+ $config{entry}=$option{e};
+ $config{input}=0; # 1: ask user if more than one possibility
+ # 0: no user interaction
+ $config{multi}=0; # 1: do not ask user and get all of them
+ # 0: just the first one
+}
+else {
+ $config{input}=1; # 1: ask user if more than one possibility
+ # 0: no user interaction
+ $config{multi}=0; # 1: do not ask user and get all of them
+ # 0: just the first one
+}
$config{input}=0 if($option{I});