From: Zhang Qiang Date: Thu, 12 Sep 2013 14:47:59 +0000 (+0800) Subject: fix packaging dir detect issue X-Git-Tag: 0.9.1~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77b951af889364520427a9153c83709efcfd560e;p=tools%2Fdepanneur.git fix packaging dir detect issue packaging dir can contains multiple level directory, so use packaging_dir to resolve package git dir is the correct way Fixes: #1315 Change-Id: I1a0d894102e0e66c2fdff65bbbb1bdd3fe11b3e2 --- diff --git a/depanneur b/depanneur index f51c37d..8a498dd 100755 --- a/depanneur +++ b/depanneur @@ -580,16 +580,15 @@ sub query_git_commit_rev { sub prepare_git { my $config = shift; my $spec = shift; - - my $packaging = dirname($spec); - my $base = dirname($packaging); - my $spec_file = basename($spec); + my $base = dirname($spec); + $base =~ s!\Q$packaging_dir\E!!; + if ($includeall == 0) { my $tmp_dir = abs_path(tempdir(CLEANUP=>1)); my $tmp_spec = "$tmp_dir/$spec_file"; my $without_base = $spec; - $without_base =~ s!\Q$base\E/!!; + $without_base ="$packaging_dir/$spec_file"; if (my_system("cd $base; git show $commit:$without_base >$tmp_spec 2>/dev/null") != 0) { warning("failed to checkout spec file from commit: $commit:$without_base"); return;