Revert previous commit, was incorrect
[amarok.git] / release_scripts / tag_amarok.rb
blobdd0f86b1d46c227dd50d16e08df7637e3db8bdf7
1 #!/usr/bin/env ruby
3 # This script creates a new tag in SVN for Amarok. Upon startup, it asks you for name
4 # of the tag to create (e.g. "1.3-beta3"). Please note that the script creates the tag
5 # immediately on the live SVN repository.
7 # (c) 2005 Mark Kretschmann <markey@web.de>
8 # License: GNU General Public License V2
11 useStableBranch = false
12 # Ask whether using branch or trunk
13 location = `kdialog --combobox "Select checkout's place:" "Trunk" "Stable"`.chomp()
14 if location == "Stable"
15     useStableBranch = true
16     puts "using stable branch"
17 end
19 # Ask user for tag name
20 tagname  = `kdialog --inputbox "Enter tag name (e.g. "2.0-beta3"): "`.chomp()
21 puts "tag = #{tagname}"
22 user = `kdialog --inputbox "Your SVN user:"`.chomp()
23 puts "user = #{user}"
24 protocol = `kdialog --radiolist "Do you use https or svn+ssh?" https https 0 "svn+ssh" "svn+ssh" 1`.chomp()
25 puts "protocol = #{protocol}"
27 # Show safety check dialog
28 `kdialog --warningcontinuecancel "Really create the tag '#{tagname}' NOW in the svn repository?"`
29 if $?.exitstatus() == 2
30     print "Aborted.\n"
31     exit()
32 end
34 # Create destination folder
35 target = "#{protocol}://#{user}@svn.kde.org/home/kde/tags/amarok/#{tagname}/"
36 `svn mkdir -m "Create tag #{tagname} root directory" #{target}`
37 puts "root directory created"
38 `svn mkdir -m "Create tag #{tagname} multimedia directory" #{target}/multimedia`
39 puts "multimedia directory created"
40 `svn mkdir -m "Create tag #{tagname} doc directory" #{target}/multimedia/doc`
41 puts "doc directory created"
43 if useStableBranch
44     source = "#{protocol}://#{user}@svn.kde.org/home/kde/branches/stable/extragear/multimedia/amarok"
45     docs   = "#{protocol}://#{user}@svn.kde.org/home/kde/branches/stable/extragear/multimedia/doc/amarok"
46 else
47     source = "#{protocol}://#{user}@svn.kde.org/home/kde/trunk/extragear/multimedia/amarok"
48     docs   = "#{protocol}://#{user}@svn.kde.org/home/kde/trunk/extragear/multimedia/doc/amarok"
49 end
52 # Copy the files in the repository
53 `svn cp -m "Tag Amarok #{tagname}." #{source} #{target}/multimedia`
54 `svn cp -m "Tag Amarok #{tagname} - docs." #{docs} #{target}/multimedia/doc`
57 print "Tag created.\n"