2 # file: made to simplyfi CD/DVD burning under CLI
4 # Copyright 2009 Marcin Karpezo <sirmacik at gmail dot com>
9 # Redistribution and use in source and binary forms, with or without modification,
10 # are permitted provided that the following conditions are met:
11 # * Redistributions of source code must retain the above copyright notice,
12 # this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above copyright notice,
14 # this list of conditions and the following disclaimer in the documentation
15 # and/or other materials provided with the distribution.
16 # * Neither the name of the simpleburner nor the names of its contributors may
17 # be used to endorse or promote products derived from this software without
18 # specific prior written permission.
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24 # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 # POSSIBILITY OF SUCH DAMAGE.
39 my $isoname = "/tmp/cd.iso";
40 my $device = "/dev/sr0";
47 GetOptions
("data=s" => \
$datadir,
48 "name=s" => \
$isoname,
49 "device=s" => \
$device,
53 "b|burn-only" => \
$burn,
54 "m|makeiso" => \
$make,
55 "h|help" => \
&helpmsg
,);
59 Simpleburner, made to simplyfi CD/DVD burning under CLI
60 Usage: simpleburner [options]
62 -h, --help Displays this message
63 --data Directory with data to burn
64 --name Path and/or name of iso image (by default /tmp/cd.iso)
65 --device Device to use (default /dev/sr0)
66 --speed Burning speed (by default it will be autodetected)
67 --mode Burning mode, available options are: TAO (default), DAO, SAO, RAW
68 -t, --test Run in test mode
69 -b, --burn-only Run without making iso image
70 -m, --makeiso Make only iso image
72 Please send any bug reports to simpleburner-bugs\@googlegroups.com
78 print("Looking for cdrkit...");
79 if (-e
'/usr/bin/wodim' and -e
'/usr/bin/genisoimage') {
81 $isomaker = 'genisoimage';
83 } elsif (-e
'/usr/bin/cdrecord' and -e
'/usr/bin/mkisofs') {
84 print("Not found\nLooking for cdrtools...");
86 $isomaker = 'mkisofs';
89 print("Not found: Please install cdrkit or cdrtools!\n");
97 print("Failed! You must deine --data option.\nRun -h|--help for more information.\n");
101 unless ( -d
$datadir) {
102 print("Failed! Data directory '$datadir' does not exist.\n");
108 print("Old iso file detected, delete it? [Y/n] "); my $reply=<STDIN
>; chomp $reply;
110 print("Burn it? [Y/n] "); my $reply=<STDIN
>; chomp $reply;
119 print("Deleting old iso file...");
129 print("Making iso image...\n");
130 $datadir =~ s/\s+/\\ /g;
131 my $command = "$isomaker -UR -quiet -allow-multidot -allow-leading-dots -iso-level 3 -o $isoname $datadir";
134 die "Can't make iso file!\n";
136 print("[OK!]\nFile stored in $isoname\n");
140 print("Burning iso...\n");
144 $burnspeed = " --speed=$speed";
146 $runtest = "--dummy";
148 my $command = "$writer --eject -vs -$mode --dev=$device $burnspeed $runtest $isoname";
149 system("$command > /dev/null");
151 die "Can't burn disc!\n";
156 if ($isoname =~ m/^~/) {
157 $isoname =~ s/^~/$ENV{'HOME'}/;
160 if ($datadir =~ m/^~/) {
161 $datadir =~ s/^~/$ENV{'HOME'}/;
178 # ** Add audiocd burning 2009-10-26 21:33+0100