diff -r f9f2e1643593 -r 322e2a3335d4 Admin/page/bin/genpage --- a/Admin/page/bin/genpage Mon Jun 06 14:12:07 2005 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,420 +0,0 @@ -#!/usr/bin/perl -w - -# Genpage - Webpage Generator. -# -# Copyright (C) Joe Vaughan 1998-1999 -# Some portions Copyright (C) Ronan Waide 1999 -# Some portions Copyright (C) Rocco Caputo 1999 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -$|=1; - -$version = "1.0b3"; - -# following fix for Mac Perl submitted by Dair Grant -# I shoulda thought of this, but I don't have a mac :) Thanks Dair. -# -# dair, construct a path procedurally -sub build_path -{ - - # Retrieve our parameters - # - my $thePath = $_[0]; - my $theItem = $_[1]; - - - - # If we're running on a Mac, munge the path/item/separator - # - if ($^O eq "MacOS") - { - $thePath =~ s/:$//; # Strip off trailing ':' - $theItem =~ s/^:$//; # Drop theItem == ':' - $pathDiv = ":"; # Use Mac separator - } - else - { - $pathDiv = "/"; # Use Unix separator - } - - - - # Return the path to the item - # - return($thePath . $pathDiv . $theItem); -} - - - -# Some handy variables. -$numfiles = 0; -$numcontentfiles = 0; -$numignoredfiles = 0; -$numskippedfiles = 0; -$numcpfiles = 0; -$numdirfiles =0; - -use Getopt::Std; -use File::Find; -use File::Copy 'cp'; - -# Current Working Dir. -$pwd = `pwd`; -chomp ($pwd); - -getopts('dt:c:o:fqhi:') || die "Invalid args, use $0 -h for help\n"; - -# $opt_d is debug flag -# $opt_t is template file. If not set, use standard template. -# $opt_c is content directory. If not set, use standard content dir. -# $opt_o is output dir, if not set, use standard output dir. -# $opt_q sets quiet mode (no stdout output) -# $opt_f sets a force flag - force generation even if output file is present -# and newer. -# $opt_h runs usage and exits - -# dair, build paths procedurally -$opt_t ||= build_path("", "layout") . build_path("", "template.html"); -$opt_c ||= build_path("", "content"); -$opt_o ||= build_path("", "www"); -$opt_f ||= 0; -$opt_d ||= 0; -$opt_q ||= 0; -$opt_h ||= 0; -$opt_i ||= 'CVS|.*,v$'; - -# dair, build paths procedurally -$opt_t = build_path($pwd, $opt_t); -$opt_c = build_path($pwd, $opt_c); -$opt_o = build_path($pwd, $opt_o); - - -if ($opt_h) { &usage; } - -if (!$opt_q) { - print "Genpage, version $version starting run...\n"; -} - -if ($opt_d) { print "pwd = $pwd\n"; } - -#Swallow template file whole... -open( TEMPLATE, "<$opt_t" ) || die "Can\'t open template file $opt_t: $!\n"; -{ -local $/; -undef $/; -$template =