[libinline-java-perl] 146/398: Added overrides for Inline::mkpath and Inline::rmpath that sort of make them portable.

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:42:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit 4a46548b2a17441470796db696db872d5cc559b3
Author: patrick_leb <>
Date:   Sun Jan 20 21:30:18 2002 +0000

    Added overrides for Inline::mkpath and Inline::rmpath that sort
    of make them portable.
---
 Java.pm          |  8 ++++----
 Java/Portable.pm | 39 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/Java.pm b/Java.pm
index fe7a4b0..cf8e390 100644
--- a/Java.pm
+++ b/Java.pm
@@ -380,7 +380,7 @@ sub write_java {
 	my $build_dir = $o->get_api('build_dir') ;
 	my $modfname = $o->get_api('modfname') ;
 
-	$o->mkpath($build_dir) ;
+	Inline::Java::Portable::mkpath($o, $build_dir) ;
 
 	if (! $study_only){
 		my $p = File::Spec->catfile($build_dir, "$modfname.java") ;
@@ -419,7 +419,7 @@ sub compile {
 
 	my $install = File::Spec->catdir($install_lib, "auto", $modpname) ;
 
-	$o->mkpath($install) ;
+	Inline::Java::Portable::mkpath($o, $install) ;
 	$o->set_classpath($install) ;
 
 	my $javac = File::Spec->catfile($o->{ILSM}->{BIN}, 
@@ -484,7 +484,7 @@ sub compile {
 	}
 
 	if ($o->get_api('cleanup')){
-		$o->rmpath('', $build_dir) ;
+		Inline::Java::Portable::rmpath($o, '', $build_dir) ;
 	}
 
 	Inline::Java::debug("compile done.") ;
@@ -658,7 +658,7 @@ sub set_classpath {
 				# Here we must make sure that the directory exists, or
 				# else it is removed from the CLASSPATH by Java
 				my $path = File::Spec->catdir($dir, $m) ;
-				$o->mkpath($path) ;
+				Inline::Java::Portable::mkpath($o, $path) ;
 
 				$paths{$path} = 1 ;
 			}
diff --git a/Java/Portable.pm b/Java/Portable.pm
index 5b6a2b3..e82a201 100644
--- a/Java/Portable.pm
+++ b/Java/Portable.pm
@@ -35,14 +35,49 @@ sub use_alone {
 }
 
 
+# Here in Inline <= 0.43 there is a portability issue
+# with the mkpath function. It splits directly on '/'.
+# We assume this will be fixed in 0.44
+sub mkpath {
+	my $o = shift ;
+	my $path = shift ;
+
+	if ($Inline::VERSION <= 0.43){
+		my $sep = File::Spec->catdir('', '') ;
+		$sep = quotemeta($sep) ;
+		$path =~ s/$sep/\//g ;
+	}
+	
+	return $o->Inline::mkpath($path) ;
+} ;
+
+
+# Here in Inline <= 0.43 there is a portability issue
+# with the rmpath function. It splits directly on '/'.
+# We assume this will be fixed in 0.44
+sub rmpath {
+	my $o = shift ;
+	my $prefix = shift ;
+	my $path = shift ;
+	
+	if ($Inline::VERSION <= 0.43){
+		my $sep = File::Spec->catdir('', '') ;
+		$sep = quotemeta($sep) ;
+		$path =~ s/$sep/\//g ;
+	}
+	
+	return $o->Inline::rmpath($prefix, $path) ;
+} ;
+
+
 sub portable {
 	my $key = shift ;
 	my $val = shift ;
 
 	my $defmap = {
 		EXE_EXTENSION		=>	$Config{exe_ext},
-		GOT_ALARM			=>  $Config{d_alarm},
-		GOT_FORK			=>	$Config{d_fork},
+		GOT_ALARM			=>  $Config{d_alarm} || 0,
+		GOT_FORK			=>	$Config{d_fork} || 0,
 		ENV_VAR_PATH_SEP	=>	$Config{path_sep},
 		SO_EXT				=>	$Config{dlext},
 		SO_LIB_PATH_VAR		=>	'LD_LIBRARY_PATH',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list