[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/utils/createtarball
From:       Tom Albers <tomalbers () kde ! nl>
Date:       2008-09-27 0:18:12
Message-ID: 1222474692.947843.26656.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 865201 by toma:

Fix the inclusion of translated documentation in the tarball. 


 M  +1 -0      config.ini  
 M  +36 -10    create_tarball.rb  


--- trunk/playground/utils/createtarball/config.ini #865200:865201
@@ -104,4 +104,5 @@
 submodule   = base
 kde_release = yes
 wholeModule = yes
+docs        = yes
 
--- trunk/playground/utils/createtarball/create_tarball.rb #865200:865201
@@ -4,13 +4,14 @@
 # Ruby script for generating amaroK tarball releases from KDE SVN
 #
 # (c) 2005 Mark Kretschmann <markey@web.de>
-# (c) 2006-2007 Tom Albers <tomalbers@kde.nl>
+# (c) 2006-2008 Tom Albers <tomalbers@kde.nl>
 # (c) 2007 Angelo Naselli <anaselli@linux.it> (command line parameters) 
 # Some parts of this code taken from cvs2dist
 # License: GNU General Public License V2
 
 require 'optparse'
 require 'ostruct'
+require 'find'
 
 # check command line parameters
 options = OpenStruct.new
@@ -92,7 +93,7 @@
 #kde_version = '4.0.4'
 
 #----------------------------------------------------------------
-# retrieve apps. 
+# initiate. 
 #----------------------------------------------------------------
 
 f = File.new("config.ini")
@@ -108,6 +109,7 @@
     f.close
 end
 
+puts "Last KDE version found: " + kde_version
 if (options.ask)
     puts "Which apps (multiple sep by space, posibilities: all kde_release " + \
app.join(" ") + ")?"  apps = gets.split(" ")
@@ -201,8 +203,7 @@
     end
     appdata = appdata.merge(temp)
 
-    #preparing----------------------------------------------------------------
-
+    # Preparing
     puts "-> Fetching " + appdata["mainmodule"] + "/" + appdata["submodule"] + "/" + \
app + " into " + appdata["folder"] + "..."  # Remove old folder, if exists
     `rm -rf #{appdata["folder"]} 2> /dev/null`
@@ -239,6 +240,9 @@
         end
         i18nlangs = i18nlangsCleaned
 
+        Dir.mkdir( "doc-translations" )
+        topmakefile = File.new( "doc-translations/CMakeLists.txt", File::CREAT | \
File::RDWR | File::TRUNC ) +
         Dir.mkdir( "l10n" )
         Dir.chdir( "l10n" )
 
@@ -251,21 +255,42 @@
                 `rm -rf #{dg}`
                 docdirname = \
"l10n-kde4/#{lang}/docs/#{appdata["mainmodule"]}-#{appdata["submodule"]}/#{dg}"  if ( \
                appdata["docs"] )
-                    puts "  -> Checking if #{dg} has translated documentation...\n"
+                    puts "  -> Checking if #{lang} has translated \
documentation...\n"  `svn co -q #{svnroot}/#{docdirname} > /dev/null 2>&1`
                 end
-                next unless FileTest.exists?( dg )
-                puts "    -> Copying #{lang}'s #{dg} documentation over...  "
-                `cp -R #{dg}/ ../doc/#{lang}_#{dg}`
+                next unless FileTest.exists?( dg + '/index.docbook' )
 
-                makefile = File.new( "../doc/#{lang}_#{dg}/CMakeLists.txt", \
                File::CREAT | File::RDWR | File::TRUNC )
-                makefile << "KDE4_CREATE_HANDBOOK(#{lang})\n"
+                print "    -> Copying #{lang}'s #{dg} documentation over...  "
+                Dir.mkdir( "../doc-translations/#{lang}_#{dg}/" )
+                `cp -R #{dg}/ ../doc-translations/#{lang}_#{dg}/#{dg}`
+                topmakefile << "add_subdirectory( #{lang}_#{dg}/#{dg} )\n"
+
+                makefile = File.new( \
"../doc-translations/#{lang}_#{dg}/#{dg}/CMakeLists.txt", File::CREAT | File::RDWR | \
File::TRUNC ) +                makefile << "kde4_create_handbook( index.docbook \
INSTALL_DESTINATION ${HTML_INSTALL_DIR}/#{lang}/)\n" +                Dir.chdir( \
"../doc-translations/#{lang}_#{dg}/#{dg}") +                `find -name ".svn" | \
xargs rm -rf` +                Find.find( "." ) do |path|
+                    if File.basename(path)[0] == ?.
+                        # skip this one...
+                    else
+                        if FileTest.directory?(path)
+                            makefile << "add_subdirectory( " + File.basename(path) + \
" )\n" +                            submakefile = File.new(  File.basename(path) + \
"/CMakeLists.txt", File::CREAT | File::RDWR | File::TRUNC ) +                         \
submakefile << "kde4_create_handbook( index.docbook INSTALL_DESTINATION \
${HTML_INSTALL_DIR}/#{lang}/#{dg}/)\n" +                            \
submakefile.close() +                            Find.prune
+                        end
+                    end
+                end
+                Dir.chdir( "../../../l10n")
                 makefile.close()
 
                 puts( "done.\n" )
             end
         end
+        topmakefile.close()
 
+        # app translations
         puts "-> Fetching l10n po for #{appdata["submodule"]}/#{app}...\n"
 
         Dir.chdir( ".." ) # in submodule now
@@ -314,6 +339,7 @@
         `echo "find_package(Msgfmt REQUIRED)" >> CMakeLists.txt`
         `echo "find_package(Gettext REQUIRED)" >> CMakeLists.txt`
         `echo "add_subdirectory( po )" >> CMakeLists.txt`
+        `echo "add_subdirectory( doc-translations )" >> CMakeLists.txt`
         if FileTest.exist?( "doc" )
             `echo "add_subdirectory( doc )" >> CMakeLists.txt`
         end


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic