summaryrefslogtreecommitdiff
path: root/Master/setuptl/TLPM/blng.pm
blob: 4cd56bfda065cb64013d56cf42ee3074897182cd (plain)
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
# This file belongs to TLPM v2.21, TeX Live Package Manager
# Public Domain, P.Jackowski@gust.org.pl

# blng [-pf] <name>
# display packages containing <name> (to which the <name> belongs to)

sub blng
{
      my ($arg,$pkg);
      my $count = 0;
      local $inclby_method = \&get_pkg_belongs;
      local $is_method     = \&is_pkg;
      my $pkges = $source_pkges;
      while(defined($arg = shift))
      {
            $arg eq ''                     and next
            or &no_opt($arg)               and $pkg = $arg
            or &is_opt($arg,'p','package') and $inclby_method = \&get_pkg_belongs
                                           and $is_method = \&is_pkg
            or &is_opt($arg,'f','file')    and $inclby_method = \&get_file_belongs
                                           and $is_method = \&is_file
            or &is_opt($arg,'h','help')    and return $heeelp -> ('blng')
            or &rem_opt($arg) and return $error{'wrong_opt'} -> ($arg,'blng --help');
      }
	return $error{'pkg_unspec'} -> () if $pkg eq '';
      return if &read_source();
      $is_method -> ($pkg,$pkges) or return $error{'not_found'} -> ($pkg);
      $mess -> (map {++$count;$_} $inclby_method -> ($pkg,$pkges));
      $mess -> ("\n");
      if($tlpm_redir < 2)
      {
            $message -> (&one_or_more($count,'parent bundle','parent bundles'));
      }
}

1;