#!/usr/bin/env ruby # # Copyright (C) 2008 Harald Sitter # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License or (at your option) version 3 or any later version # accepted by the membership of KDE e.V. (or its successor approved # by the membership of KDE e.V.), which shall act as a proxy # defined in Section 14 of version 3 of the license. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . require 'fileutils' def updateStandards(sV) file = File.new("./debian/control", File::RDWR) # open file str = file.read() # read file to variable str file.rewind() # go to first character in first line (read ends at last character in last line) file.truncate( 0 ) # remove everything after the current position (i.e. everything) str.gsub!(/Standards-Version: .*/, "Standards-Version: #{sV}" ) # replace old sv with new one file << str # write str to file again file.close() # write file system("dch -a 'Bump Standards-Version to #{sV}'") # add changelog entry end def exe(lang) Dir.chdir(@langDir) isoLang = lang.split("-")[2] sV = "3.8.0" # current standards version FileUtils.rm_rf(isoLang) Dir.mkdir(isoLang) Dir.chdir(isoLang) system("apt-get source #{lang}") Dir.chdir(Dir.glob("**/debian")[0]) Dir.chdir("..") version = Dir.pwd.split("/")[-1].split("-")[-1] file = File.new("./debian/rules", File::RDWR) str = file.read() str = str.split(" installlist= ;\\") str2 = str[1].split(" if test -e debian/tmp/usr/share/$$f; then \\") file.rewind() file.truncate( 0 ) file << str[0] file << " installlist= ;\\ for f in locale/$$i/LC_MESSAGES/desktop_kdevelop.mo \\ locale/$$i/LC_MESSAGES/kdevelop.mo \\ locale/$$i/LC_MESSAGES/kfilereplace.mo \\ locale/$$i/LC_MESSAGES/klinkstatus.mo \\ locale/$$i/LC_MESSAGES/quanta.mo \\ locale/$$i/LC_MESSAGES/kxsldbg.mo \\ locale/$$i/LC_MESSAGES/kimagemapeditor.mo \\ locale/$$i/LC_MESSAGES/kommander.mo \\ doc/kde/HTML/$$i/kommander \\ doc/kde/HTML/$$i/kxsldbg \\ doc/kde/HTML/$$i/klinkstatus \\ doc/kde/HTML/$$i/quanta \\ doc/kde/HTML/$$i/kfilereplace ; \\ do \\ if test -e debian/tmp/usr/share/$$f; then \\" file << str2[1] file.close() system("dch -i 'Only install kdewebdev and kdevelop'") updateStandards(sV) system("debuild -S -sa") uversion = IO.readlines("debian/changelog")[0].split("(")[1].split(")")[0].split(":")[1] package = lang + "_" + uversion orig = lang + "_" + version + ".orig.tar.gz" changes = package + "_source.changes" diff = package + ".diff.gz" dsc = package + ".dsc" Dir.chdir("..") upDir = @upDir + "/" + isoLang Dir.mkdir(upDir) FileUtils.cp(dsc, upDir) FileUtils.cp(diff, upDir) FileUtils.cp(changes, upDir) FileUtils.cp(orig, upDir) end @langDir = Dir.pwd() + "/langs" FileUtils.rm_rf(@langDir) Dir.mkdir(@langDir) @upDir = Dir.pwd() + "/uploads" FileUtils.rm_rf(@upDir) Dir.mkdir(@upDir) langs = %x[apt-cache pkgnames kde-i18n-] langs = langs.split("\n") for lang in langs exe(lang) end