diff --git a/scripts/partitionmanagerapp.rb b/scripts/partitionmanagerapp.rb index bec792a..bd978a7 100755 --- a/scripts/partitionmanagerapp.rb +++ b/scripts/partitionmanagerapp.rb @@ -28,33 +28,38 @@ class PartitionManagerApp < Application end def applyFixes(workingDir, outputDir) - puts "applying fixes for partition manager" + puts 'applying fixes for partition manager' Dir.chdir "#{workingDir}/#{outputDir}" - return if !File.exists? 'doc' + puts 'removing scripts subdir...' + FileUtils.rm_rf 'scripts' - FileUtils.mv('CMakeLists.txt', 'CMakeLists.txt.orig') + if File.exists? 'doc' then + puts 'patching CMakeLists.txt to build docs only with new kdelibs...' + + FileUtils.mv('CMakeLists.txt', 'CMakeLists.txt.orig') - newFile = File.new('CMakeLists.txt', File::CREAT | File::TRUNC | File::RDWR) + newFile = File.new('CMakeLists.txt', File::CREAT | File::TRUNC | File::RDWR) - IO.foreach('CMakeLists.txt.orig') do |line| - if line =~ /\s*macro_optional_add_subdirectory\s*\(\s*doc\s*\)\s*/i - newFile.print <