aboutsummaryrefslogtreecommitdiffstats
path: root/Packdrakeng.pm
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2004-12-14 01:44:00 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2004-12-14 01:44:00 +0000
commit4e81102894db4d46909f480705890863f45e0d7d (patch)
tree0a7eae31565a1b7105a2ae63c368c20d8db5147c /Packdrakeng.pm
parent149b47a72552b0e72bd6b513a6412dc5433d2010 (diff)
downloadrpmtools-4e81102894db4d46909f480705890863f45e0d7d.tar
rpmtools-4e81102894db4d46909f480705890863f45e0d7d.tar.gz
rpmtools-4e81102894db4d46909f480705890863f45e0d7d.tar.bz2
rpmtools-4e81102894db4d46909f480705890863f45e0d7d.tar.xz
rpmtools-4e81102894db4d46909f480705890863f45e0d7d.zip
- fix mkpath
Diffstat (limited to 'Packdrakeng.pm')
-rw-r--r--Packdrakeng.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/Packdrakeng.pm b/Packdrakeng.pm
index b45e04a..23bc9e2 100644
--- a/Packdrakeng.pm
+++ b/Packdrakeng.pm
@@ -43,9 +43,11 @@ sub tempfile {
sub mkpath {
my ($path) = @_;
$path =~ s:/*$::; # removing leading '/'
- my $parent = substr($path, 0, rindex($path, '/'));
-d $path and return 1;
- -d $parent || mkpath($parent) or return 0;
+ # need parent creation ?
+ if (index($path, '/') > 0) {
+ mkpath(substr($path, 0, rindex($path, '/'))) or return 0;
+ }
mkdir($path)
}