#!/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 ; }; exit; #End of main:w 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"; }; };