From: Markus Lehtonen Date: Fri, 28 Mar 2014 06:35:17 +0000 (+0200) Subject: Rudimentary support for the new orphan-packaging development model X-Git-Tag: 0.14~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f63db979c962ddb0d6a745c049059470987789e;p=tools%2Fdepanneur.git Rudimentary support for the new orphan-packaging development model Add a new --spec-commit command line option in order to support the new package maintenance model of using separate packaging and devel branches. In this model the packaging files (i.e. spec et al) must be taken from other branch if the current branch is a development branch (which only contains source code). Change-Id: Ia8eb916dafd5bdc74c9b2d22591a8a36f6c11e95 Signed-off-by: Markus Lehtonen Signed-off-by: Zhang Qiang --- diff --git a/depanneur b/depanneur index 6a603b1..9f2d4d3 100755 --- a/depanneur +++ b/depanneur @@ -78,6 +78,7 @@ my $clean = 0; my $binarylist = ""; my $binary_from_file = ""; my $commit = "HEAD"; +my $spec_commit = ""; my $includeall = 0; my $upstream_branch = ""; my $upstream_tag = ""; @@ -159,6 +160,7 @@ GetOptions ( "exclude=s" => \@exclude, "exclude-from-file=s" => \$exclude_from_file, "commit=s" => \$commit, + "spec-commit=s" => \$spec_commit, "include-all" => \$includeall, "upstream-branch=s" => \$upstream_branch, "upstream-tag=s" => \$upstream_tag, @@ -497,7 +499,7 @@ sub fill_packs_from_git { debug("working on $base"); if ($includeall == 0) { my (undef, $tmp_file) = tempfile(CLEANUP=>1, OPEN => 0); - if (my_system("cd $base; git show $commit:$packaging_dir >$tmp_file 2>/dev/null") == 0) { + if (my_system("cd $base; git show $spec_commit:$packaging_dir >$tmp_file 2>/dev/null") == 0) { open my $file, '<', $tmp_file or die $!; my $first_line = <$file>; if ($first_line =~ /^tree/) { @@ -510,7 +512,7 @@ sub fill_packs_from_git { } } else { #packaging_dir is a symbol link my (undef, $tmp_symlink_file) = tempfile(CLEANUP=>1, OPEN => 0); - if (my_system("cd $base; git show $commit:$first_line >$tmp_symlink_file 2>/dev/null") == 0) { + if (my_system("cd $base; git show $spec_commit:$first_line >$tmp_symlink_file 2>/dev/null") == 0) { open my $symlink_file, '<', $tmp_symlink_file or die $!; while (<$symlink_file>) { chomp; @@ -638,8 +640,8 @@ sub prepare_git { my $without_base; $spec =~ s!\Q$base/\E!!; $without_base = $spec; - 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"); + if (my_system("cd $base; git show $spec_commit:$without_base >$tmp_spec 2>/dev/null") != 0) { + warning("failed to checkout spec file from commit: $spec_commit:$without_base"); return; } $spec = $tmp_spec; @@ -1690,6 +1692,7 @@ sub get_binary_list() { info("start building packages from: " . $package_path . " ($style)"); ($_, $start_time) = my_system("date +\"%Y-%m-%d %H:%M %z\""); +$spec_commit = $commit if ($spec_commit eq ""); if ($style eq 'git') { File::Find::find({wanted => \&git_wanted}, $package_path ); if (@pre_packs > 1 && $commit ne "HEAD"){