Commit bd32d8f2 authored by Tails developers's avatar Tails developers

Handle release candidates when generating custom APT sources

Release candidates version numbers (in debian/changelog) do not match
the Git tag name: 0.12~rc1 vs. 0.12-rc1. So we need to convert `~` in
version_was_released().

We also need to convert the version to the corresponding suite name, using the
same rules as branch names.
parent 0eb38d9e
......@@ -14,6 +14,7 @@ git_tag_exists() {
version_was_released() {
local version="$1"
version="$(echo "$version" | tr '~' '-')"
git_tag_exists "$version"
}
......@@ -44,7 +45,7 @@ branch_name_to_suite() {
if version_was_released "$(version_in_changelog)"; then
output_apt_binary_source "$(version_in_changelog)"
output_apt_binary_source "$(branch_name_to_suite "$(version_in_changelog)")"
elif [ "$(current_branch)" = "testing" ]; then
output_apt_binary_source testing
elif [ "$(current_branch)" = "experimental" ]; then
......
......@@ -34,6 +34,15 @@ Feature: custom APT sources to build branches
Then I should see the '0.11' suite
And I should not see 'testing' suite
Scenario: build a release candidate from a tagged testing branch
Given I am working on the testing branch
And Tails 0.11 has been released
And last released version mentioned in debian/changelog is 0.12~rc1
And Tails 0.12-rc1 has been tagged
When I run tails-custom-apt-sources
Then I should see the '0.12-rc1' suite
And I should not see 'testing' suite
Scenario: build from the devel branch
Given I am working on the devel branch
When I run tails-custom-apt-sources
......
......@@ -18,11 +18,15 @@ END_OF_CHANGELOG
fatal_system "git tag '#{version}'"
end
Given /^Tails ([[:alnum:].-]+) has been tagged$/ do |version|
fatal_system "git tag '#{version}'"
end
Given /^Tails ([[:alnum:].]+) has not been released yet$/ do |version|
!File.exists? ".git/refs/tags/#{version}"
end
Given /^last released version mentioned in debian\/changelog is ([[:alnum:].]+)$/ do |version|
Given /^last released version mentioned in debian\/changelog is ([[:alnum:]~.]+)$/ do |version|
last = `dpkg-parsechangelog | awk '/^Version: / { print $2 }'`.strip
raise StandardError.new('dpkg-parsechangelog failed.') if $? != 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment