3 # This is a convenience script for bumping Amarok's plugin framework version
4 # in the various engine desktop files and in pluginmanager.h.
6 # The script should be run once before each release, in order to ensure that
7 # no old and perhaps incompatible engines are getting loaded. After running, don't
8 # forget to commit to svn. The script must be started from the amarok/ folder.
10 # (c) 2005 Mark Kretschmann <markey@web.de>
11 # License: GNU General Public License V2
14 def bump_desktop_files( folder )
15 Dir.foreach( folder ) do |x|
16 next if x[0, 1] == "."
17 if FileTest.directory?( "#{folder}/#{x}" )
19 files = Dir["#{folder}/#{x}/*.desktop"].delete_if { |a| a.include?( "install.desktop" ) }
20 file = File.new( files.join(), File::RDWR )
24 str.sub!( /X-KDE-Amarok-framework-version=[0-9]*/, "X-KDE-Amarok-framework-version=#{@version}" )
32 # Make sure the current working directory is amarok
33 if not Dir::getwd().split( "/" ).last() == "amarok"
34 print "ERROR: This script must be started from the amarok/ folder. Aborting.\n\n"
39 # Bump FrameworkVersion in pluginmanager.h
40 file = File.new( "src/pluginmanager.h", File::RDWR )
44 temp = str.scan( /static const int FrameworkVersion = [0-9]*;/ )
45 @version = temp.join().scan( /[0-9]*/ ).join().to_i()
46 @version = @version + 1
48 print "Bumping the plugin framework version to: #{@version}"
50 str.sub!( /static const int FrameworkVersion = [0-9]*;/, "static const int FrameworkVersion = #{@version};" )
55 # Bump plugin desktop files
58 bump_desktop_files( "engine" )
59 bump_desktop_files( "mediadevice" )
60 bump_desktop_files( "device" )
66 print "Done :) Now commit the source to SVN."