#!/usr/bin/perl -w # # mknewtreel # sub makeit ; if ($#ARGV+1 != 2) { die "mknewtree needs as arguments\n"; }; $sec = $ARGV[0]; $sec =~ s+/$++; # Remove the trailing / if present $pub = $ARGV[1]; $pub =~ s+/$++; # Remove the trailing / if present print " ARGS ARE: $sec $pub\n"; while (glob "$sec") { makeit ; }; while (glob "$sec/*") { makeit ; }; while (glob "$sec/*/*") { makeit ; }; while (glob "$sec/*/*/*") { makeit ; }; while (glob "$sec/*/*/*/*") { makeit ; }; while (glob "$sec/*/*/*/*/*") { makeit ; }; while (glob "$sec/*/*/*/*/*/*") { makeit ; }; while (glob "Library/$sec"."curr.lbi") { makeit ; }; while (glob "Library/$sec"."navbar.lbi") { makeit ; }; while (glob "stylesheets/main$sec.css") { # makeit ; }; while (glob "Templates/main$sec.dwt") { makeit ; }; # Copy to the special locations if this is English: # (Had problems with the local links not always being right, so commented out) #if ($pub eq 'englishL') { # @args = ("cat /home/darwind/public_html/home/index.html | sed -e 's/$sec/$pub/' > /darwind/public_html/index.html"); # print "SPECIAL FILE: index.html\n"; # system(@args) == 0 # or die "system @args failed; $?"; # @args = ("cat /home/darwind/public_html/home/index.html | sed -e 's/$sec/$pub/' > /darwind/public_html/home/index.html"); # print "SPECIAL FILE: home/index.html\n"; # system(@args) == 0 # or die "system @args failed; $?"; #}; exit; #End of main sub makeit { $secdirfile = $_; ($pubdirfile = $secdirfile) =~ s/$sec/$pub/g; if ((-d $secdirfile) && (!(-d $pubdirfile))) { @args = ("mkdir $pubdirfile"); print "DIR: $pubdirfile\n"; system(@args) == 0 or die "system @args failed; $?"; } elsif ((-f $secdirfile) && (!(-f $pubdirfile))) { @args = ("cat $secdirfile | sed -e 's/$sec/$pub/' > $pubdirfile"); print "FILE: $pubdirfile\n"; system(@args) == 0 or die "system @args failed; $?"; } else { print "NO ACT:$pubdirfile\n"; }; };