ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/scriptome/pack_tools.pl
Revision: 1.3
Committed: Tue Jan 16 14:36:54 2007 UTC (9 years, 10 months ago) by amirkarger
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +5 -10 lines
Log Message:
Fix for building on Windows to work on UNIX or vice versa

Line File contents
1 #!perl
2
3 use strict;
4 use warnings;
5
6 use File::Spec;
7
8 my ($scriptname, $toolbase) = @ARGV;
9 my $Usage = "$0 Scriptome_script.pl base_tool_dir";
10 die "\n$Usage\n\nERROR! Need two args!" unless @ARGV==2;
11 die "\n$Usage\n\nERROR! First arg should be a readable file!"
12 unless -f $scriptname && -r _;
13 die "\n$Usage\n\nERROR! Second arg should be a readable directory!"
14 unless -d $toolbase && -r _;
15
16 # Put script on top
17 &cat($scriptname);
18
19 # Start __DATA__ with a line to tell ScripPack.pl it has a <DATA> to read from
20 print "\n\n__DATA__\nINCLUDED FILES FOLLOW\n";
21
22 # Windows & UNIX tools
23 my $windows_glob = File::Spec->catfile($toolbase, "Windows", "Tools", "*.html");
24 my $unix_glob = File::Spec->catfile($toolbase, "UNIX", "Tools", "*.html");
25 foreach my $toolfile (glob($windows_glob), glob($unix_glob)) {
26 print ">>>Starting file $toolfile<<<\n";
27 &cat($toolfile);
28 print ">>>Ending file $toolfile<<<\n\n";
29 }
30
31 sub cat {
32 my $file = shift;
33 open(FILE, "<$file") or die "Opening $file: $!\n";
34 print <FILE>;
35 close(FILE);
36 }