[Templates-cvs] cvs commit: Template2/bin ttree
cvs@template-toolkit.org
cvs@template-toolkit.org
Fri, 17 Sep 2004 08:26:37 +0100
cvs 04/09/17 07:26:36
Modified: bin ttree
Log:
* applied Pail Orrock's patch to fix some missing warnings
Revision Changes Path
2.78 +13 -12 Template2/bin/ttree
Index: ttree
===================================================================
RCS file: /template-toolkit/Template2/bin/ttree,v
retrieving revision 2.77
retrieving revision 2.78
diff -u -r2.77 -r2.78
--- ttree 2004/03/11 08:04:18 2.77
+++ ttree 2004/09/17 07:26:36 2.78
@@ -23,7 +23,7 @@
#
#------------------------------------------------------------------------
#
-# $Id: ttree,v 2.77 2004/03/11 08:04:18 abw Exp $
+# $Id: ttree,v 2.78 2004/09/17 07:26:36 abw Exp $
#
#========================================================================
@@ -37,7 +37,7 @@
use Text::ParseWords qw(quotewords);
my $NAME = "ttree";
-my $VERSION = sprintf("%d.%02d", q$Revision: 2.77 $ =~ /(\d+)\.(\d+)/);
+my $VERSION = sprintf("%d.%02d", q$Revision: 2.78 $ =~ /(\d+)\.(\d+)/);
my $HOME = $ENV{ HOME } || '';
my $RCFILE = $ENV{"\U${NAME}rc"} || "$HOME/.${NAME}rc";
my $TTMODULE = 'Template';
@@ -260,12 +260,12 @@
# create target directory if required
$target = "$destdir/$path";
unless (-d $target || $dryrun) {
- mkdir $target, $mode || do {
- warn "mkdir ($target): $!\n";
- next;
- };
-# commented out by abw on 2000/12/04 - seems to raise a warning?
-# chown($uid, $gid, $target) || warn "chown($target): $!\n";
+ mkpath $target, $mode or
+ die "Could not mkpath ($target): $!\n";
+
+ # commented out by abw on 2000/12/04 - seems to raise a warning?
+ # chown($uid, $gid, $target) || warn "chown($target): $!\n";
+
printf " + %-32s (created target directory)\n", $path
if $verbose;
}
@@ -351,17 +351,18 @@
# check against copy list
if ($copy_file) {
- printf " > %-32s (copied, matches /$check/)\n", $file
- if $verbose;
-
unless ($dryrun) {
- copy($absfile, $dest);
+ copy($absfile, $dest) or die "Could not copy ($absfile to $dest) : $!\n";
if ($preserve) {
chown($uid, $gid, $dest) || warn "chown($dest): $!\n";
chmod($mode, $dest) || warn "chmod($dest): $!\n";
}
}
+
+ printf " > %-32s (copied, matches /$check/)\n", $file
+ if $verbose;
+
return;
}