1 Given /^Tails ([[:alnum:].]+) has been released$/ do |version|
2 create_git unless git_exists?
4 fatal_system "git checkout --quiet stable"
5 old_entries = File.open('debian/changelog') { |f| f.read }
6 File.open('debian/changelog', 'w') do |changelog|
7 changelog.write(<<END_OF_CHANGELOG)
8 tails (#{version}) stable; urgency=low
10 * New upstream release.
12 -- Tails developers <tails@boum.org> Tue, 31 Jan 2012 15:12:57 +0100
17 fatal_system "git commit --quiet debian/changelog -m 'Release #{version}'"
18 fatal_system "git tag '#{version}'"
21 Given /^Tails ([[:alnum:].-]+) has been tagged$/ do |version|
22 fatal_system "git tag '#{version}'"
25 Given /^Tails ([[:alnum:].]+) has not been released yet$/ do |version|
26 !File.exists? ".git/refs/tags/#{version}"
29 Given /^last released version mentioned in debian\/changelog is ([[:alnum:]~.]+)$/ do |version|
30 last = `dpkg-parsechangelog | awk '/^Version: / { print $2 }'`.strip
31 raise StandardError.new('dpkg-parsechangelog failed.') if $? != 0
34 fatal_system "debchange -v '#{version}' 'New upstream release'"
38 Given %r{I am working on the ([[:alnum:]./_-]+) branch$} do |branch|
39 create_git unless git_exists?
41 current_branch = `git branch | awk '/^\*/ { print $2 }'`.strip
42 raise StandardError.new('git-branch failed.') if $? != 0
44 if current_branch != branch
45 fatal_system "git checkout --quiet '#{branch}'"
49 Given %r{I am working on the ([[:alnum:]./_-]+) branch based on ([[:alnum:]./_-]+)$} do |branch, base|
50 create_git unless git_exists?
52 current_branch = `git branch | awk '/^\*/ { print $2 }'`.strip
53 raise StandardError.new('git-branch failed.') if $? != 0
55 if current_branch != branch
56 fatal_system "git checkout --quiet -b '#{branch}' '#{base}'"
60 When /^I run ([[:alnum:]-]+)$/ do |command|
61 @output = `#{File.expand_path("../../../auto/scripts/#{command}", __FILE__)}`
62 raise StandardError.new("#{command} failed. Exit code: #{$?}") if $? != 0
65 Then /^I should see the ['"]?([[:alnum:].-]+)['"]? suite$/ do |suite|
66 @output.should have_suite(suite)
69 Then /^I should not see ['"]?([[:alnum:].-]+)['"]? suite$/ do |suite|
70 @output.should_not have_suite(suite)