From c05220038d50f26cb5da03b13b82372297f99c83 Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Sun, 6 Sep 2009 17:09:25 -0400 Subject: Fix portability problems in bin/createpackage.pl. * Use File::Spec functions to manipulate path components. * Keep $targetplatform lower case for case sensitive systems. Signed-off-by: axis --- bin/createpackage.pl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bin/createpackage.pl b/bin/createpackage.pl index 4597b04..3480702 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -145,10 +145,8 @@ my $signed_sis_name = $pkgoutputbasename.".sis"; # Store some utility variables my $scriptpath = dirname(__FILE__); my $certtext = $certificate; -my $certpath = $scriptpath; -$certpath =~ s-^(.*[^\\])$-$1\\-o; # ensure path ends with a backslash -$certpath = $certpath."../"; # certificates are one step up in hierarcy -$certpath =~ s-/-\\-go; # for those working with UNIX shells +# certificates are one step up in hierarchy +my $certpath = File::Spec->catdir($scriptpath, File::Spec->updir()); # Check some pre-conditions and print error messages if needed unless (length($templatepkg) && length($platform) && length($target)) { @@ -172,14 +170,14 @@ if (length($certificate)) { } else { #If no certificate is given, check default options $certtext = "RnD"; - $certificate = $certpath."rd.cer"; - $key = $certpath."rd-key.pem"; + $certificate = File::Spec->catfile($certpath, "rd.cer"); + $key = File::Spec->catfile($certpath, "rd-key.pem"); stat($certificate); unless( -e _ ) { $certtext = "Self Signed"; - $certificate = $certpath."selfsigned.cer"; - $key = $certpath."selfsigned.key"; + $certificate = File::Spec->catfile($certpath, "selfsigned.cer"); + $key = File::Spec->catfile($certpath, "selfsigned.key"); } } -- cgit v0.12