From 80fa0efd1fb775b396652a1a9c3308d6cbfcc8f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Wed, 7 Jul 2010 20:31:34 +0000 Subject: [PATCH] buildzip.pl: more fixes - cygwin's abs_path() can't operate on non existing path, so only evaluate abs_path("$install/something") if $install is set. (apply r27137 again) - don't set $install to 0 since it's meant to be a string - create the install prefix with mkdir -p before installing git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27341 a1c6a512-1295-4272-9138-f99709370657 --- tools/buildzip.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/buildzip.pl b/tools/buildzip.pl index 71c256890b..5d8fa43dfa 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl @@ -21,7 +21,7 @@ my $ROOT=".."; my $ziptool="zip -r9"; my $output="rockbox.zip"; my $verbose; -my $install=0; +my $install; my $exe; my $target; my $modelname; @@ -475,8 +475,6 @@ $year+=1900; sub runone { my ($target, $fonts)=@_; - my $samedir = abs_path("$install/$rbdir") eq abs_path($rbdir); - # build a full install .rockbox ($rbdir) directory buildzip($target, $fonts); @@ -496,12 +494,17 @@ sub runone { print "$ziptool $output $rbdir $target >/dev/null\n"; } + my $samedir = 0; # is the destination dir equal to source dir ? + if($install) { if ($install =~ /\/dev\/null/) { die "ERROR: No PREFIX given\n" } + + $samedir = abs_path("$install/$rbdir") eq abs_path($rbdir); + if (!$samedir) { - system("cp -r $rbdir \"$install\" >/dev/null"); + system("mkdir -p \"$install\" && cp -r $rbdir \"$install/\""); } } else {