File Coverage

blib/lib/Filesys/MakeISO/Driver/Mkisofs.pm
Criterion Covered Total %
statement 18 29 62.0
branch 0 8 0.0
condition 0 6 0.0
subroutine 6 8 75.0
pod 2 2 100.0
total 26 53 49.0


line stmt bran cond sub pod time code
1             package Filesys::MakeISO::Driver::Mkisofs;
2 1     1   31537 use version; $VERSION = qv('0.0.1');
  1         2647  
  1         6  
3              
4             =head1 NAME
5              
6             Filesys::MakeISO::Driver::Mkisofs - make iso images with mkisofs
7              
8             =head1 VERSION
9              
10             This document describes Filesys::MakeISO::Driver::Mkisofs version 0.0.1
11              
12             =head1 SYNOPSIS
13              
14             use Filesys::MakeISO;
15              
16             my $iso = Filesys::MakeISO->new(
17             class => 'Filesys::MakeISO::Driver::Mkisofs',
18             mkisofs_bin => '/usr/bin/mkisofs',
19             );
20             $iso->image('image.iso');
21             $iso->dir('/path/to/burn');
22              
23             $iso->make_iso;
24              
25             =cut
26              
27 1     1   128 use strict;
  1         1  
  1         29  
28 1     1   5 use warnings;
  1         5  
  1         31  
29              
30 1     1   991 use File::Which ();
  1         1212  
  1         20  
31 1     1   917 use IPC::Run3 ();
  1         51267  
  1         31  
32              
33 1     1   11 use base 'Filesys::MakeISO';
  1         2  
  1         1123  
34              
35             #=head1 DESCRIPTION
36              
37             =head1 INTERFACE
38              
39             =head2 new [PARAMS]
40              
41             Constructor. Returns C if no C executable is found.
42              
43             Valid PARAMS are:
44              
45             =over 4
46              
47             =item mkisofs_bin
48              
49             Location (path and filename) of the C binary.
50              
51             =back
52              
53             =cut
54              
55             sub new {
56 0     0 1   my ($class, %arg) = @_;
57 0   0       my $self = bless({}, ref($class) || $class);
58              
59             # find mkisofs binary
60 0   0       my $bin = delete $arg{mkisofs_bin} || File::Which::which('mkisofs');
61 0 0         return undef unless $bin;
62              
63             # executable?
64 0 0         return undef unless -x $bin;
65              
66 0           $self->{mkisofs_bin} = $bin;
67              
68 0           return $self;
69             }
70              
71             =head2 make_iso
72              
73             Create image, specific for mkisofs.
74              
75             =cut
76              
77             sub make_iso {
78 0     0 1   my ($self) = @_;
79              
80             # check params
81 0           $self->_check_params;
82              
83 0 0         my @cmd = ($self->{mkisofs_bin},
    0          
84             $self->rock_ridge ? ('-r') : (),
85             $self->joliet ? ('-J') : (),
86             '-o', $self->image,
87             $self->dir,
88             );
89              
90 0           return IPC::Run3::run3(\@cmd, \undef, \undef, \undef);
91             }
92              
93              
94             1;
95              
96             =head1 DEPENDENCIES
97              
98             L, L
99              
100             =head1 INCOMPATIBILITIES
101              
102             None reported.
103              
104             =head1 BUGS AND LIMITATIONS
105              
106             No bugs have been reported.
107              
108             Please report any bugs or feature requests to
109             C, or through the
110             web interface at L.
111              
112             =head1 AUTHOR
113              
114             Uwe Voelker C<< uwe.voelker@gmx.de >>
115              
116             =head1 LICENSE AND COPYRIGHT
117              
118             Copyright (c) 2006, Uwe Voelker C<< uwe.voelker@gmx.de >>.
119             All rights reserved.
120              
121             This module is free software; you can redistribute it and/or
122             modify it under the same terms as Perl itself. See C.
123              
124             =head1 DISCLAIMER OF WARRANTY
125              
126             BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
127             FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
128             OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
129             PROVIDE THE SOFTWARE ''AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER
130             EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
131             WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
132             ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
133             YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
134             NECESSARY SERVICING, REPAIR, OR CORRECTION.
135              
136             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
137             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
138             REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
139             LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
140             OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
141             THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
142             RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
143             FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
144             SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
145             SUCH DAMAGES.