diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2004-12-05 16:36:14 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2004-12-05 16:36:14 +0000 |
commit | 1245265d4f72936f40522a61d20f86b7565282cd (patch) | |
tree | b9fe6430a99cc19222f38a5c4ba7deaed4ef69ad | |
parent | e13a7b1806e5b9f04def1f67f897bd8695b2e91a (diff) | |
download | rpmtools-1245265d4f72936f40522a61d20f86b7565282cd.tar rpmtools-1245265d4f72936f40522a61d20f86b7565282cd.tar.gz rpmtools-1245265d4f72936f40522a61d20f86b7565282cd.tar.bz2 rpmtools-1245265d4f72936f40522a61d20f86b7565282cd.tar.xz rpmtools-1245265d4f72936f40522a61d20f86b7565282cd.zip |
- rename packdrakeng.pm to Packdrakeng.pm to follow perl policy
-rw-r--r-- | Packdrakeng.pm (renamed from packdrakeng.pm) | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/packdrakeng.pm b/Packdrakeng.pm index 1ccb7e6..cad49da 100644 --- a/packdrakeng.pm +++ b/Packdrakeng.pm @@ -597,17 +597,27 @@ sub extract { my ($pack, $dir, @file) = @_; foreach my $f (@file) { my $dest = $dir ? "$dir/$f" : "$f"; - if (exists($pack->{dir}{$f})) { - -d "$dest" || mkpath("$dest") + my ($dir) = $dest =~ m!(.*)/.*!; + if (exists($pack->{dir}{$f})) { + -d $dest || mkpath($dest) or warn "Unable to create dir $dest"; next; } elsif (exists($pack->{'symlink'}{$f})) { - symlink("$dest", $pack->{'symlink'}{$f}) + -d $dir || mkpath($dir) or do { + warn "Unable to create dir $dir"; + }; + symlink($dest, $pack->{'symlink'}{$f}) or warn "Unable to extract symlink $f"; next; } elsif (exists($pack->{files}{$f})) { - sysopen(my $destfh, "$dest", O_CREAT | O_TRUNC | O_WRONLY) - or next; + -d $dir || mkpath($dir) or do { + warn "Unable to create dir $dir"; + }; + sysopen(my $destfh, $dest, O_CREAT | O_TRUNC | O_WRONLY) + or do { + warn "Unable to extract $dest"; + next; + }; my $written = $pack->extract_virtual($destfh, $f); $written == -1 and warn "Unable to extract file $f"; close($destfh); |