File indexing completed on 2024-10-06 03:28:34

0001 #!/usr/bin/env ruby
0002 #
0003 # This script gets all KHangMan data currently in trunk/l10n-kde4 svn and makes
0004 # tarballs of it, removing svn hidden dirs and CMakeLists.txt
0005 #
0006 # (c) 2005 Mark Kretschmann <markey@web.de>
0007 # (c) 2007 - 2008  Anne-Marie Mahfouf <annma@kde.org>
0008 # modified by Carsten Niehaus
0009 # Some parts of this code taken from cvs2dist
0010 # License: GPL V2+
0011 
0012 # Each tarball is packaged <iso>.tar.bz2 where <iso> is the language
0013 # iso code used by KDE
0014 
0015 # Globally these tarballs should be unpacked under
0016 # $KDEDIRS/share/apps/kvtml
0017 # Locally, these tarballs should be unpacked under
0018 # $KDEHOME/share/apps/kvtml
0019 
0020 puts "Connecting to l10n-kde4".center(40, " - ")
0021 
0022 Dir.mkdir( "khangman-data")
0023 Dir.chdir( "khangman-data" )
0024 
0025 i18nlangs = `svn cat svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/subdirs`
0026 
0027 # docs
0028 for lang in i18nlangs
0029         print "doing #{lang}";
0030         lang.chomp!
0031         datadirname = "l10n-kde4/#{lang}/data/kdeedu/khangman"
0032         Dir.mkdir( "#{lang}" )
0033         Dir.chdir( "#{lang}" )
0034     `svn co -q svn://anonsvn.kde.org/home/kde/branches/stable/#{datadirname}`
0035         Dir.chdir( ".." )
0036         if !FileTest.exists?( "#{lang}/khangman" )
0037                 print "in if \n" 
0038                 Dir.rmdir("#{lang}")
0039         else
0040                 system `mv #{lang}/khangman/* #{lang}`
0041                 system `rm -Rf #{lang}/khangman/.*`
0042                 system `rmdir #{lang}/khangman`
0043                 system `rm #{lang}/CMakeLists.txt`
0044                 if FileTest.exists?( "#{lang}/IMPROVE.txt" )
0045                         system `rm #{lang}/IMPROVE.txt`
0046                 end
0047         end
0048 end
0049 
0050 Dir.foreach('.') { |dir|
0051         next if dir == "."
0052         next if dir == ".."
0053         `tar -cf #{dir}.tar #{dir}/`
0054         `bzip2 #{dir}.tar`
0055         system `rm -Rf #{dir}/`
0056 }