~ubuntu-branches/ubuntu/raring/xmltv/raring

« back to all changes in this revision

Viewing changes to debian/patches/makefile_pl_opt_exclude

  • Committer: Bazaar Package Importer
  • Author(s): Chris Butler
  • Date: 2010-11-29 19:43:10 UTC
  • mfrom: (1.4.1 upstream) (20.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20101129194310-o2lptjn26an5lq77
Tags: 0.5.59-1
* New upstream release
  - added new grabbers: pt_meo and fi_sv
* Refreshed patches
* Fixed tv_grab_fi by updating to revision 1.58 from upstream CVS 
  (closes: #605467)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Adds an exclude option to Makefile.PL for turning off components from the commandline.
2
 
Author: Chris Butler <chrisb@debian.org>
3
 
Last-Update: 2010-05-22
4
 
 
5
 
--- a/Makefile.PL
6
 
+++ b/Makefile.PL
7
 
@@ -59,10 +59,12 @@
8
 
 my $opt_yes = 0;
9
 
 my $opt_default = 0;
10
 
 my $opt_components;
11
 
+my $opt_exclude;
12
 
 GetOptions('strict-deps'  => \$opt_strictdeps, # be strict about dependencies
13
 
           yes            => \$opt_yes,         # answer yes to all questions
14
 
           default        => \$opt_default,     # answer default to all questions
15
 
           'components=s' => \$opt_components,
16
 
+          'exclude=s'    => \$opt_exclude,
17
 
          );
18
 
 
19
 
 our $VERSION;
20
 
@@ -751,6 +753,20 @@
21
 
 END
22
 
       ;
23
 
 
24
 
+    my %by_name;
25
 
+    foreach (@opt_components) {
26
 
+        $by_name{$_->{name}} = $_;
27
 
+        $_->{exclude} = 0; # default if not mentioned
28
 
+    }
29
 
+
30
 
+    if (defined $opt_exclude) {
31
 
+        foreach (split /,/, $opt_exclude) {
32
 
+            my $i = $by_name{$_};
33
 
+            die "unknown component $_\n" if not $i;
34
 
+            $i->{exclude} = 1;
35
 
+        }
36
 
+    }
37
 
+
38
 
     my $width = 0;
39
 
     foreach my $info (@opt_components) {
40
 
        my $w = length("$info->{blurb} ($info->{name})");
41
 
@@ -763,7 +779,7 @@
42
 
        # Guess a default value for {install} based on whether
43
 
        # prerequisites were found.
44
 
        #
45
 
-       $info->{install} = $opt_yes || not $info->{missing};
46
 
+       $info->{install} = not $info->{exclude} && ($opt_yes || not $info->{missing});
47
 
 
48
 
        print STDERR ($s, ' ' x (1 + $width - length $s),
49
 
                      $info->{install} ? '[yes]' : '[no]',