diff options
Diffstat (limited to 'bin/rebuild-for-athena')
-rwxr-xr-x | bin/rebuild-for-athena | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/bin/rebuild-for-athena b/bin/rebuild-for-athena deleted file mode 100755 index 99c9acfe..00000000 --- a/bin/rebuild-for-athena +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/perl - -use 5.028; -use strict; -use warnings; - -use autodie ":all"; - -use File::Basename qw(basename); -use Git::Wrapper; -use Getopt::Long; -use Term::UI; - -my ($want_minus, $want_plus) = (0, 0); -GetOptions - "minus" => \$want_minus, - "plus" => \$want_plus; -die "invalid options" if $want_minus and $want_plus; -$want_minus = 1 unless $want_minus or $want_plus; -die "usage: " . basename $0 . " [--minus|--plus] CODENAME\n" unless @ARGV == 1; -my $codename = pop @ARGV; -my $git = Git::Wrapper->new("."); -my $term = Term::ReadLine->new("brand"); -die "git commit first\n" unless $git->RUN("status", { porcelain => 1 }) == 0; - -if ($codename eq "bullseye-backports") { - rebuild_for_suite("bullseye-backports", "~bpo11+1"); - system "release-to-athena"; -} elsif ($codename =~ /-backports$/) { - die "unknown backports suite"; -} else { - rebuild_for_suite($codename); - system "release-to-athena"; - - # if we just built for unstable, also offer to rebuild for stable-backports - if ($codename eq "unstable") { - exit unless - $term->ask_yn(prompt => "also rebuild for bullseye-backports?"); - - rebuild_for_suite("bullseye-backports", "~bpo11+1"); - system "release-to-athena"; - } -} - -sub rebuild_for_suite { - my $codename = shift; - my $local = shift; - my $branch = "athena/$codename"; - - my $local_branch_exists = $git->for_each_ref("[r]efs/heads/$branch") != 0; - my @remote_branches = map { - my (undef, undef, $ref) = split; - $ref =~ s{^refs/remotes/}{}; - $ref - } - grep { - m{/$branch$} - } $git->for_each_ref("refs/remotes"); - - $local .= "~athena" if $want_minus; - $local .= "+athena" if $want_plus; - - if ($local_branch_exists) { - my ($branch_to_build) = $git->symbolic_ref("HEAD"); - $branch_to_build =~ s{^refs/heads/}{}; - - # are we already on the requisite branch and this script is being used - # to release? - if ($branch eq $branch_to_build) { - chomp(my $dist = `dpkg-parsechangelog -SDistribution`); - if ($dist eq "UNRELEASED") { - system "dch", "-r", "-D$codename"; - } else { - say "Hmm, already on $branch and changelog is not UNRELEASED"; - exit 1; - } - } else { - $git->checkout($branch); - system "dgit", "setup-mergechangelogs"; - $git->merge($branch_to_build); - system "dch", "-D$codename", "-l$local", - "Rebuild for athena's apt repository."; - system qw(dch -r); - } - } else { - if (@remote_branches) { - say "I want to create branch $branch, " - . "but these remote branches already exist:"; - say for @remote_branches; - say -"maybe you want to check out or `git branchmove get` one of those"; - exit 1; - } else { - $git->checkout("-b", $branch); - system "dch", "-D$codename", "-l$local", - "Rebuild for athena's apt repository."; - system qw(dch -r); - } - } - - $git->add("debian/changelog"); - $git->commit({ message => "Rebuild for athena's apt repository" }); -} |