~ubuntu-branches/ubuntu/karmic/lire/karmic

« back to all changes in this revision

Viewing changes to all/script/lr_check_superservice.in

  • Committer: Bazaar Package Importer
  • Author(s): Wolfgang Sourdeau
  • Date: 2005-04-25 23:10:41 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050425231041-8h3y0jyvmj0pe05o
Tags: 2:2.0.1-4
debian/control: build-depend an depend on libdbd-sqlite2-perl (>=
2:0.33-4) instead of libdbd-sqlite-perl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! @PERL@ -w
 
2
 
 
3
# vim:syntax=perl
 
4
 
 
5
use strict;
 
6
 
 
7
use lib '@LR_PERL5LIBDIR@';
 
8
 
 
9
use Lire::Program qw( :msg $PROG );
 
10
use Lire::PluginManager;
 
11
use Lire::DlfSchema;
 
12
 
 
13
lr_err( "Usage: $PROG <service>|-l" ) unless @ARGV == 1;
 
14
 
 
15
if ($ARGV[0] eq '-l') {
 
16
    print join( "\n", Lire::DlfSchema->superservices() );
 
17
    exit 0;
 
18
} else {
 
19
    my $service = shift;
 
20
    Lire::PluginManager->register_default_plugins();
 
21
    if ( Lire::PluginManager->has_plugin( 'dlf_converter', $service ) ) {
 
22
        my $converter =
 
23
          Lire::PluginManager->get_plugin( 'dlf_converter', $service );
 
24
        print join( ",", $converter->schemas() ), "\n";
 
25
    } else {
 
26
        lr_err( <<EOF );
 
27
'$service' isn't a known DLF converter.
 
28
Use lr_check_service -l to obtain the list of available converters.
 
29
EOF
 
30
    }
 
31
    exit 0;
 
32
}
 
33
 
 
34
__END__
 
35
 
 
36
=pod
 
37
 
 
38
=head1 NAME
 
39
 
 
40
lr_check_superservice - map Lire service to Lire superservice
 
41
 
 
42
=head1 SYNOPSIS
 
43
 
 
44
B<lr_check_superservice> I<service>
 
45
B<lr_check_superservice> B<-l>
 
46
 
 
47
=head1 DESCRIPTION
 
48
 
 
49
B<lr_check_superservice> takes a Lire service as argument, and returns the
 
50
I<superservice> this I<service> belongs to.  In case the service is unknown, a
 
51
userfriendly errormessage is given.
 
52
 
 
53
When called with the B<-l> option, this script prints all supported
 
54
superservices.
 
55
 
 
56
You might prefer the lr_log2report(1) --help options to list available
 
57
superservices: this command creates a more human-friendly format of the list.
 
58
 
 
59
=head1 EXAMPLE
 
60
 
 
61
Call this script in shell scripts as
 
62
 
 
63
 LR_SERVICE="$1"
 
64
 
 
65
 LR_SUPERSERVICE=`lr_check_superservice "$LR_SERVICE" || true`
 
66
 if test -z "$LR_SUPERSERVICE"
 
67
 then
 
68
    echo >&2 "$tag err lr_check_superservice failed"
 
69
    exit 1
 
70
 fi
 
71
 
 
72
 # now go using $LR_SUPERSERVICE
 
73
 
 
74
=head1 SEE ALSO
 
75
 
 
76
Lire::PluginManager(3pm) Lire::DlfSchema(3pm)
 
77
 
 
78
=head1 VERSION
 
79
 
 
80
$Id: lr_check_superservice.in,v 1.9 2004/09/04 10:34:59 vanbaal Exp $
 
81
 
 
82
=head1 COPYRIGHT
 
83
 
 
84
Copyright (C) 2002-2003 Stichting LogReport Foundation LogReport@LogReport.org
 
85
 
 
86
This program is free software; you can redistribute it and/or modify
 
87
it under the terms of the GNU General Public License as published by
 
88
the Free Software Foundation; either version 2 of the License, or
 
89
(at your option) any later version.
 
90
 
 
91
This program is distributed in the hope that it will be useful,
 
92
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
93
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
94
GNU General Public License for more details.
 
95
 
 
96
You should have received a copy of the GNU General Public License
 
97
along with this program (see COPYING); if not, check with
 
98
http://www.gnu.org/copyleft/gpl.html or write to the Free Software 
 
99
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 
100
 
 
101
=head1 AUTHOR
 
102
 
 
103
Joost van Baal <joostvb@logreport.org>
 
104
 
 
105
=cut
 
106
 
 
107
# Local Variables:
 
108
# mode: cperl
 
109
# End:
 
110