diff options
author | Tollef Fog Heen <tfheen> | 2001-07-31 16:34:25 +0000 |
---|---|---|
committer | Tollef Fog Heen <tfheen> | 2001-07-31 16:34:25 +0000 |
commit | b3db878df7f2909df938af58cfff9508a68d9ce2 (patch) | |
tree | 419988a6625033adf6a361ffd356fbb5178edcc8 /copypage.pl | |
parent | 6771a50f9c325cc6a36bbd6c5cccd3ed6035d60e (diff) |
Handle directories without Makefiles
Handle directories with depth > 1 (which haven't been copied before)
Pick up language from $ENV{DWWW_LANG}, which makes it possible to
override without changing the default language.
CVS version numbers
copypage.pl: 1.12 -> 1.13
Diffstat (limited to 'copypage.pl')
-rwxr-xr-x | copypage.pl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/copypage.pl b/copypage.pl index 53d1568fb1c..2456bdb8241 100755 --- a/copypage.pl +++ b/copypage.pl @@ -11,8 +11,14 @@ # $Id$ +use File::Path; + # Get configuration -if (open CONF, "<language.conf") +if (exists $ENV{DWWW_LANG}) +{ + $language = $ENV{DWWW_LANG}; +} +elsif (open CONF, "<language.conf") { $language = <CONF>; chomp $language; @@ -90,11 +96,13 @@ sub copy unless (-d $dstdir) { print "Destination directory $dstdir does not exist,\n"; - print "creating and copying $dstmake\n"; - mkdir $dstdir, 0755 + mkpath([$dstdir],0,0755) or die "Could not create $dstdir: $!\n"; - system "cp $srcmake $dstmake"; + if ( -e $srcmake ) { + print "creating and copying $dstmake\n"; + system "cp $srcmake $dstmake"; + } } # Check if title translation exists, if so - load it |