summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorAndras Timar <timar@fsf.hu>2011-03-08 22:48:09 +0100
committerAndras Timar <timar@fsf.hu>2011-03-08 22:53:50 +0100
commit9849827a5b8e9c2189f236b452a58eaae95668c6 (patch)
treed168c3b5ed3cc000a75efd9a2bae1fa38fc9ad24 /l10ntools
parent1acfb268fdcd18894f04216983fda863f8f6f75e (diff)
adapt localize to LibreOffice directory structure
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/scripts/localize.pl8
-rw-r--r--l10ntools/source/localize.cxx66
-rw-r--r--l10ntools/source/srciter.cxx8
-rw-r--r--l10ntools/source/treeconfig.cxx12
4 files changed, 78 insertions, 16 deletions
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl
index 7249814febc7..340357cca45b 100644
--- a/l10ntools/scripts/localize.pl
+++ b/l10ntools/scripts/localize.pl
@@ -170,11 +170,11 @@ sub splitfile{
}
close( MYFILE );
- if( !defined $ENV{SOURCE_ROOT_DIR} ){
- print "Error, no SOURCE_ROOT_DIR in env found.\n";
+ if( !defined $ENV{SRC_ROOT} ){
+ print "Error, no SRC_ROOT in env found.\n";
exit( -1 );
}
- my $src_root = $ENV{SOURCE_ROOT_DIR};
+ my $src_root = $ENV{SRC_ROOT};
my $ooo_src_root = $ENV{SRC_ROOT};
my $so_l10n_path = $src_root."/sun/l10n_so/source";
my $ooo_l10n_path = $ooo_src_root."/l10n/source";
@@ -387,7 +387,7 @@ sub collectfiles{
STDOUT->autoflush( 1 );
my $working_path = getcwd();
- chdir $ENV{SOURCE_ROOT_DIR}, if defined $ENV{SOURCE_ROOT_DIR};
+ chdir $ENV{SRC_ROOT}, if defined $ENV{SRC_ROOT};
add_paths( $langhash_ref );
my ( $LOCALIZEPARTICLE , $localizeSDF ) = File::Temp::tempfile();
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 94c06e626e8f..9d8da0ebba7c 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -122,6 +122,56 @@ const char *PositiveList[] = {
"NULL"
};
+const char *ModuleList[] = {
+ "accessibility",
+ "avmedia",
+ "basctl",
+ "basic",
+ "chart2",
+ "connectivity",
+ "crashrep",
+ "cui",
+ "dbaccess",
+ "desktop",
+ "editeng",
+ "extensions",
+ "filter",
+ "forms",
+ "formula",
+ "fpicker",
+ "framework",
+ "helpcontent2",
+ "instsetoo_native",
+ "mysqlc",
+ "officecfg",
+ "padmin",
+ "readlicense_oo",
+ "reportbuilder",
+ "reportdesign",
+ "sc",
+ "scaddins",
+ "sccomp",
+ "scp2",
+ "sd",
+ "sdext",
+ "setup_native",
+ "sfx2",
+ "shell",
+ "starmath",
+ "svl",
+ "svtools",
+ "svx",
+ "sw",
+ "swext",
+ "sysui",
+ "ucbhelper",
+ "uui",
+ "vcl",
+ "wizards",
+ "xmlsecurity",
+ "NULL",
+};
+
const char PRJ_DIR_NAME[] = "prj";
const char DLIST_NAME[] = "d.lst";
@@ -263,8 +313,16 @@ const ByteString SourceTreeLocalizer::GetProjectRootRel()
bool skipProject( ByteString sPrj )
{
- static const ByteString READLICENSE( "readlicense" );
- return sPrj.EqualsIgnoreCaseAscii( READLICENSE );
+ int nIndex = 0;
+ bool bReturn = TRUE;
+ ByteString sModule( ModuleList[ nIndex ] );
+ while( !sModule.Equals( "NULL" ) && bReturn ) {
+ if( sPrj.Equals ( sModule ) )
+ bReturn = FALSE;
+ nIndex++;
+ sModule = ModuleList[ nIndex ];
+ }
+ return bReturn;
}
/*****************************************************************************/
@@ -937,9 +995,9 @@ int _cdecl main( int argc, char *argv[] )
{
string curRepository;
if( has_minor_ext )
- curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter + minor_ext;
+ curRepository = string( Export::GetEnv("SRC_ROOT") ) + "/" + *iter + minor_ext;
else
- curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter;
+ curRepository = string( Export::GetEnv("SRC_ROOT") ) + "/" + *iter;
cout << "Localizing repository " << curRepository << "\n";
SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bSkipLinks );
aIter.SetLanguageRestriction( sLanguages );
diff --git a/l10ntools/source/srciter.cxx b/l10ntools/source/srciter.cxx
index eb5d78f775af..6ec75336cf52 100644
--- a/l10ntools/source/srciter.cxx
+++ b/l10ntools/source/srciter.cxx
@@ -70,7 +70,9 @@ void SourceTreeIterator::ExecuteDirectory( transex::Directory& aDirectory )
static rtl::OUString WCARD4 ( RTL_CONSTASCII_USTRINGPARAM("common") );
static rtl::OUString WCARD5 ( RTL_CONSTASCII_USTRINGPARAM("unxmac") );
static rtl::OUString WCARD6 ( RTL_CONSTASCII_USTRINGPARAM("unxubt") );
- static rtl::OUString WCARD7 ( RTL_CONSTASCII_USTRINGPARAM(".svn") );
+ static rtl::OUString WCARD7 ( RTL_CONSTASCII_USTRINGPARAM(".git") );
+ static rtl::OUString WCARD8 ( RTL_CONSTASCII_USTRINGPARAM("clone") );
+ static rtl::OUString WCARD9 ( RTL_CONSTASCII_USTRINGPARAM("install") );
if( sDirName.indexOf( WCARD1 , 0 ) > -1 ||
@@ -79,7 +81,9 @@ void SourceTreeIterator::ExecuteDirectory( transex::Directory& aDirectory )
sDirName.indexOf( WCARD4 , 0 ) > -1 ||
sDirName.indexOf( WCARD5 , 0 ) > -1 ||
sDirName.indexOf( WCARD6 , 0 ) > -1 ||
- sDirName.indexOf( WCARD7 , 0 ) > -1
+ sDirName.indexOf( WCARD7 , 0 ) > -1 ||
+ sDirName.indexOf( WCARD8 , 0 ) > -1 ||
+ sDirName.indexOf( WCARD9 , 0 ) > -1
) return;
//printf("**** %s \n", OUStringToOString( sDirName , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() );
diff --git a/l10ntools/source/treeconfig.cxx b/l10ntools/source/treeconfig.cxx
index 9f02ff80ddc8..2b27e50dd48b 100644
--- a/l10ntools/source/treeconfig.cxx
+++ b/l10ntools/source/treeconfig.cxx
@@ -22,7 +22,7 @@ namespace transex3
bool Treeconfig::parseConfig(){
- string source_config_file = string( static_cast<ByteString>( Export::GetEnv("SOURCE_ROOT_DIR") ).GetBuffer() );
+ string source_config_file = string( static_cast<ByteString>( Export::GetEnv("SRC_ROOT") ).GetBuffer() );
if( source_config_file.empty() )
{
cerr << "Error: no suitable environment set?!?";
@@ -50,13 +50,13 @@ bool Treeconfig::getActiveRepositories( vector<string>& active_repos ){
string pwd;
string guessedRepo;
Export::getCurrentDir( pwd );
- string source_root = Export::GetEnv( "SOURCE_ROOT_DIR" );
+ string source_root = Export::GetEnv( "SRC_ROOT" );
string solarsrc = Export::GetEnv( "SOLARSRC" );
string partial;
// if we are inside of a repository root then active it otherwise let the app handle the return!
string::size_type pos = pwd.find_first_of( source_root );
- if( pos != string::npos && ( pos + source_root.length() +1 ) < pwd.length()){ // I am within SOURCE_ROOT_DIR
+ if( pos != string::npos && ( pos + source_root.length() +1 ) < pwd.length()){ // I am within SRC_ROOT
partial = pwd.substr( pos + source_root.length() +1 , pwd.length());
string::size_type nextPart = partial.find_first_of( "/" );
if( nextPart != string::npos )
@@ -64,7 +64,7 @@ bool Treeconfig::getActiveRepositories( vector<string>& active_repos ){
else
guessedRepo = partial;
}
- else // I am NOT within SOURCE_ROOT_DIR
+ else // I am NOT within SRC_ROOT
hasPath = true;
if( isPresent )
@@ -94,7 +94,7 @@ bool Treeconfig::getActiveRepositories( vector<string>& active_repos ){
if( !guessedRepo.empty() ){
active_repos.push_back( guessedRepo ); // add myrepo
}
- return hasPath; // are we deep inside of a source tree or outside of SOURCE_ROOT_DIR?
+ return hasPath; // are we deep inside of a source tree or outside of SRC_ROOT?
}
void Treeconfig::getCurrentDir( string& dir )
@@ -109,7 +109,7 @@ void Treeconfig::getCurrentDir( string& dir )
bool Treeconfig::isConfigFilePresent()
{
- string config_file = Export::GetEnv( "SOURCE_ROOT_DIR" );
+ string config_file = Export::GetEnv( "SRC_ROOT" );
config_file += "/source_config";
struct stat status;