From ab17e86a66c29063952e40a14d56d52d15059700 Mon Sep 17 00:00:00 2001 From: Matt Madia Date: Sun, 3 Oct 2010 15:21:59 +0000 Subject: [PATCH] Reworked LocaleRules (again). The generated catkeys and catalogs are stored in a directory structure that reflects the catalogs in the repository. DoCatalogs accepts an optional folder parameter, which allows one to specify an additional subfolder to glob *.catkeys from. For example dstcheck in src/bin. Improves upon r38819 and should address the concerns in http://www.freelists.org/post/haiku/BOM-providing-catkeyszip-and-catkeyszipmd5-again,1 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38873 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/LocaleRules | 21 +++++++++++++++------ src/bin/Jamfile | 7 +++++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/build/jam/LocaleRules b/build/jam/LocaleRules index 21aac0e0d9..4d8b105fd8 100644 --- a/build/jam/LocaleRules +++ b/build/jam/LocaleRules @@ -57,8 +57,10 @@ rule ExtractCatalogEntries target : sources : signature : regexp SEARCH on $(sources) += $(SEARCH_SOURCE) ; + local subdir + = [ on $(signature) return $(HAIKU_CATALOGS_SUBDIR) ] ; MakeLocate $(target) - : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(signature) ] ; + : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(subdir) ] ; Depends $(target) : $(sources) collectcatkeys ; LocalClean clean : $(target).pre ; ExtractCatalogEntries1 $(target) : collectcatkeys $(sources) ; @@ -80,8 +82,10 @@ rule LinkApplicationCatalog target : sources : signature : language # if the fingerprint matches the one from the untranslated catalog for the # same file. + local subdir + = [ on $(signature) return $(HAIKU_CATALOGS_SUBDIR) ] ; MakeLocate $(target) - : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(signature) ] ; + : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(subdir) ] ; Depends $(target) : $(sources) linkcatkeys ; LocalClean clean : $(target) ; @@ -97,10 +101,10 @@ actions LinkApplicationCatalog1 -s $(HAIKU_CATALOG_SIGNATURE) -o "$(1)" } -rule DoCatalogs target : signature : sources : sourceLanguage : regexp +rule DoCatalogs target : signature : sources : sourceLanguage : regexp : subdir { # DoCatalogs : : [ : ] - # [ : ] + # [ : ] [ : ] # # Extracts the catkeys from a target's source files, generates the # default catalog from them, and also generates catalogs for all @@ -114,11 +118,16 @@ rule DoCatalogs target : signature : sources : sourceLanguage : regexp # the sources. Optional: default is "en". # regexp The regular expression used to parse the files. # Optional: default is matching be_catalog->GetString + # folder Optional: the subdirectory containing *.catkeys + + local subdir = $(SUBDIR_TOKENS[2-]) $(folder) ; + HAIKU_CATALOGS_SUBDIR on $(signature) = $(subdir) ; local generatedCatalog = [ FGristFiles $(sourceLanguage:E=en:S=.catalog) ] ; MakeLocate $(generatedCatalog) - : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(signature) ] ; + : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(subdir) ] ; + # generate catkeys file from sources ExtractCatalogEntries $(generatedCatalog:S=.catkeys) @@ -126,7 +135,7 @@ rule DoCatalogs target : signature : sources : sourceLanguage : regexp # find translations local translationsDir - = [ FDirName $(HAIKU_TOP) data catalogs $(SUBDIR_TOKENS[2-]) ] ; + = [ FDirName $(HAIKU_TOP) data catalogs $(folder) ] ; local translations = [ Glob $(translationsDir) : *.catkeys ] ; translations = [ FGristFiles $(translations:BS) ] ; SEARCH on $(translations) += $(translationsDir) ; diff --git a/src/bin/Jamfile b/src/bin/Jamfile index 2baabec525..bada2f4b13 100644 --- a/src/bin/Jamfile +++ b/src/bin/Jamfile @@ -215,9 +215,12 @@ StdBinCommands : libncurses.a : $(haiku-utils_rsrc) ; # Localization of some applications -DoCatalogs dstcheck : - x-vnd.Haiku-cmd-dstconfig +DoCatalogs dstcheck + : x-vnd.Haiku-cmd-dstconfig : dstcheck.cpp + : + : + : dstcheck ; SubInclude HAIKU_TOP src bin addattr ;