summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MDK/Common/File.pm8
-rw-r--r--perl-MDK-Common.spec5
2 files changed, 10 insertions, 3 deletions
diff --git a/MDK/Common/File.pm b/MDK/Common/File.pm
index c596ad5..4573fc4 100644
--- a/MDK/Common/File.pm
+++ b/MDK/Common/File.pm
@@ -161,7 +161,7 @@ sub rm_rf {
sub cp_with_option {
my $option = shift @_;
- my $keep_symlinks = $option =~ /a/;
+ my $keep_special = $option =~ /a/;
my $dest = pop @_;
@@ -177,10 +177,14 @@ sub cp_with_option {
if (-d $src) {
-d $dest or mkdir $dest, (stat($src))[2] or die "mkdir: can't create directory $dest: $!\n";
cp_af(glob_($src), $dest);
- } elsif (-l $src && $keep_symlinks) {
+ } elsif (-l $src && $keep_special) {
unless (symlink(readlink($src) || die("readlink failed: $!"), $dest)) {
warn "symlink: can't create symlink $dest: $!\n";
}
+ } elsif ((-b $src || -c $src) && $keep_special) {
+ my @stat = stat($src);
+ require MDK::Common::System;
+ MDK::Common::System::syscall_('mknod', $dest, $stat[2], $stat[6]) or die "mknod failed (dev $_): $!";
} else {
local *F; open F, $src or die "can't open $src for reading: $!\n";
local *G; open G, "> $dest";
diff --git a/perl-MDK-Common.spec b/perl-MDK-Common.spec
index 5ff2d31..8659f0b 100644
--- a/perl-MDK-Common.spec
+++ b/perl-MDK-Common.spec
@@ -2,7 +2,7 @@
# do not change the version here, change in MDK/Common.pm.pl
%define version THEVERSION
-%define release 2mdk
+%define release 3mdk
%ifarch x86_64
%define build_option PERL_CHECKER_TARGET='debug-code BCSUFFIX=""'
@@ -72,6 +72,9 @@ rm -rf $RPM_BUILD_ROOT
# MODIFY IN THE CVS: cvs.mandrakesoft.com:/cooker soft/perl-MDK-Common
%changelog
+* Thu Mar 11 2004 Pixel <pixel@mandrakesoft.com> 1.1.11-3mdk
+- cp_af() now handles devices (mknod)
+
* Fri Feb 13 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.10-2mdk
- update gtk2-perl binding fake package