summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2012-11-15 11:23:14 +0100
committerTails developers <amnesia@boum.org>2012-11-15 11:28:19 +0100
commitbd32d8f2d0306ce7abf665f3bbaa572efd22e02a (patch)
tree78099c1ebea6ff8cef61f59a7c1b00b048774cf3
parent0eb38d9e3bc3cb9acaa89032f2ac295f11cf4c65 (diff)
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.
-rwxr-xr-xauto/scripts/tails-custom-apt-sources3
-rw-r--r--features/build.feature9
-rw-r--r--features/step_definitions/build.rb6
3 files changed, 16 insertions, 2 deletions
diff --git a/auto/scripts/tails-custom-apt-sources b/auto/scripts/tails-custom-apt-sources
index 5e37c28..e8d0105 100755
--- a/auto/scripts/tails-custom-apt-sources
+++ b/auto/scripts/tails-custom-apt-sources
@@ -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
diff --git a/features/build.feature b/features/build.feature
index 48c5e5b..c03a213 100644
--- a/features/build.feature
+++ b/features/build.feature
@@ -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
diff --git a/features/step_definitions/build.rb b/features/step_definitions/build.rb
index 40fd445..1c55456 100644
--- a/features/step_definitions/build.rb
+++ b/features/step_definitions/build.rb
@@ -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