3 # Generic ruby library for KDE extragear/playground releases
5 # Copyright (C) 2007 Harald Sitter <harald@getamarok.com>
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 require './lib/libkdialog.rb'
23 @dlg = KDialog.new("#{NAME} release script","cookie")
25 def InformationQuery()
26 def CheckoutLocation()
27 location = @dlg.combobox("Select checkout\\'s place:", "Trunk Stable Tag")
29 if location == "Stable"
31 elsif location == "Tag"
32 @tag = @dlg.inputbox("Enter the tag name:")
38 if @tag and not @tag.empty?()
41 @version = @dlg.inputbox("Enter the release version:")
47 @protocol = @dlg.radiolist("Do you use svn+ssh, https or anonsvn :",["svn+ssh","https","anonsvn"],1)
52 if @protocol == "anonsvn"
56 @user = @dlg.inputbox("Your SVN user:")
62 @version = "2.0.0" #DEBUG
63 @protocol = "anonsvn" #DEBUG
72 bar = @dlg.progressbar("fetching source code",1)
73 FileUtils.rm_rf( @folder )
74 FileUtils.rm_rf( "#{@folder}.tar.bz2" )
79 branch = "branches/stable"
80 elsif @tag and not @tag.empty?()
81 branch = "tags/#{NAME}/#{@tag}"
84 @repo = "#{@protocol}://#{@user}.kde.org/home/kde/#{branch}"
87 puts "Fetching source from #{branch}...\n\n"
89 `svn co #{@repo}/#{COMPONENT}/#{SECTION}/#{NAME} #{@folder}`
97 bar = @dlg.progressbar("creating tarball",4)
98 `find -name ".svn" | xargs rm -rf`
100 `tar -cf #{@folder}.tar #{@folder}`
102 `bzip2 #{@folder}.tar`
104 FileUtils.rm_rf(@folder)