#!perl -w # # $Id: exe_wrap.pl,v 1.75 2007/10/01 13:27:27 rmeden Exp $ # This is a quick XMLTV shell routing to use with the windows exe # # A single EXE is needed to allow sharing of modules and dlls of all the # programs. If PerlAPP was run on each one, the total size would be more than # 12MB, even leaving out PERL56.DLL! # # Perlapp allows you to attach pathed files, but you need the same path # to access them. The Makefile creates a text file of these files which is # used to build a translation table, allowing users to just type the app name # and not the development path. # # Robert Eden rmeden@yahoo.com # use File::Basename; use Carp; $Carp::MaxEvalLen=40; # limit confess output # # this check should not be done, at least not this way. it prevents some regular expressions! # ## Check for error of running from 'Run' dialogue box with redirection, ## which Run doesn't understand, ## #if (grep /[<>|]/, @ARGV) { # warn < 12; $tz += 24 if $tz < -12; $tz= sprintf("%+03d00",$tz); $ENV{TZ}= $tz; } #timezone print STDERR "Timezone is $ENV{TZ}\n" unless $opt_quiet; $cmd = shift || ""; # --version (and abbreviations thereof) my $VERSION = '0.5.49'; if (index('--version', $cmd) == 0 and length $cmd >= 3) { print "xmltv $VERSION\n"; exit; } # # some grabbers aren't included # if ($cmd =~ /^tv_grab_(?:nz|jp)$/) { die <3; #ignore trash $_=$exe; s!^.+/!!g; $cmds{$_}=1; # build command list (just in case) next unless $cmd eq $_; # # execute our command # $0 = $_; # set $0 to our script do $exe; print STDERR $@ if length($@); exit 1 if length($@); exit 0; } # # command not found, print error # if ($cmd eq "" ) { print STDERR "you must specify the program to run\n for example: $0 tv_grab_fi --configure\n"; } else { print STDERR "$cmd is not a valid command.\n"; } print STDERR "Valid commands are:\n"; @cmds=sort keys %cmds; $rows = int($#cmds / 3)+1; map {$_='' unless defined $_} @cmds[0..($rows*3+2)]; unshift @cmds,undef; foreach (1..$rows) { printf STDERR " %-20s %-20s %-20s\n",@cmds[$_,$rows+$_,2*$rows+$_]; } exit 1;