diff options
author | Tor Lillqvist <tml@iki.fi> | 2011-05-15 00:49:25 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@novell.com> | 2011-05-15 00:49:25 +0300 |
commit | cce4f3a1afc99f7f2cc612ca78d0561fe0301df9 (patch) | |
tree | f641b07070e0d6c7537eb8f9b418361e19f1ae35 | |
parent | 4af352e0134a1ea1a35a38e0e3d08a0f350ae926 (diff) |
Bin weird stuff like \\jumbo2.germany.sun.com\R-Laufwerk
-rw-r--r-- | tools/StaticLibrary_toolshelpers.mk | 1 | ||||
-rw-r--r-- | tools/bootstrp/appdef.cxx | 117 | ||||
-rw-r--r-- | tools/bootstrp/inimgr.cxx | 213 | ||||
-rw-r--r-- | tools/bootstrp/prj.cxx | 1 | ||||
-rw-r--r-- | tools/inc/bootstrp/appdef.hxx | 22 | ||||
-rw-r--r-- | tools/inc/bootstrp/inimgr.hxx | 63 |
6 files changed, 0 insertions, 417 deletions
diff --git a/tools/StaticLibrary_toolshelpers.mk b/tools/StaticLibrary_toolshelpers.mk index b7c479677854..a63ac47a7eac 100644 --- a/tools/StaticLibrary_toolshelpers.mk +++ b/tools/StaticLibrary_toolshelpers.mk @@ -42,7 +42,6 @@ $(eval $(call gb_StaticLibrary_set_cxxflags,toolshelpers,\ $(eval $(call gb_StaticLibrary_add_exception_objects,toolshelpers,\ tools/bootstrp/appdef \ tools/bootstrp/cppdep \ - tools/bootstrp/inimgr \ tools/bootstrp/prj \ )) diff --git a/tools/bootstrp/appdef.cxx b/tools/bootstrp/appdef.cxx index e411ea022d3a..9600272ca858 100644 --- a/tools/bootstrp/appdef.cxx +++ b/tools/bootstrp/appdef.cxx @@ -35,123 +35,6 @@ #include "bootstrp/appdef.hxx" -const char* GetDefStandList() -{ - char* pRet; - char* pEnv = getenv("STAR_STANDLST"); - if ( pEnv ) - { - int nLen = strlen( pEnv ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, pEnv ); - } - else - { - int nLen = strlen( _DEF_STAND_LIST ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, _DEF_STAND_LIST ); - } - return pRet; -} - - -const char* GetIniRoot() -{ - char* pRet; - char* pEnv = getenv("STAR_INIROOT"); - if ( pEnv ) - { - int nLen = strlen( pEnv ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, pEnv ); - } - else - { - int nLen = strlen( _INIROOT ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, _INIROOT ); - } - return pRet; -} - -const char* GetIniRootOld() -{ - char* pRet; - char* pEnv = getenv("STAR_INIROOTOLD"); - if ( pEnv ) - { - int nLen = strlen( pEnv ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, pEnv ); - } - else - { - int nLen = strlen( _INIROOT_OLD ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, _INIROOT_OLD ); - } - return pRet; -} - -const char* GetSSolarIni() -{ - char* pRet; - char* pEnv = getenv("STAR_SSOLARINI"); - if ( pEnv ) - { - int nLen = strlen( pEnv ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, pEnv ); - } - else - { - int nLen = strlen( _DEF_SSOLARINI ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, _DEF_SSOLARINI ); - } - return pRet; -} - - -const char* GetSSCommon() -{ - char* pRet; - char* pEnv = getenv("STAR_SSCOMMON"); - if ( pEnv ) - { - int nLen = strlen( pEnv ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, pEnv ); - } - else - { - int nLen = strlen( _DEF_SSCOMMON ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, _DEF_SSCOMMON ); - } - return pRet; -} - - -const char* GetBServerRoot() -{ - char* pRet; - char* pEnv = getenv("STAR_BSERVERROOT"); - if ( pEnv ) - { - int nLen = strlen( pEnv ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, pEnv ); - } - else - { - int nLen = strlen( B_SERVER_ROOT ); - pRet = ( char *) malloc( nLen + 1 ); - (void) strcpy( pRet, B_SERVER_ROOT ); - } - return pRet; -} - const char* GetEnv( const char *pVar ) { char const *pRet = getenv( pVar ); diff --git a/tools/bootstrp/inimgr.cxx b/tools/bootstrp/inimgr.cxx deleted file mode 100644 index 3d9d818e1a38..000000000000 --- a/tools/bootstrp/inimgr.cxx +++ /dev/null @@ -1,213 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_tools.hxx" -#if !defined( UNX ) -#include <direct.h> -#else -#include <sys/stat.h> -#endif -#include <stdlib.h> -#include <stdio.h> - - -#include "bootstrp/inimgr.hxx" -#include "bootstrp/appdef.hxx" - -/****************************************************************************/ -IniManager::IniManager( ByteString &rDir, ByteString &rLocalDir ) -/****************************************************************************/ - : bUpdate( sal_True ) -{ - sLocalPath = ByteString( getenv( "LOCALINI" )); - if ( !sLocalPath.Len()) - sLocalPath = rLocalDir; - - sGlobalDir = rDir; -#if !defined( UNX ) && !defined( OS2 ) - mkdir(( char * ) sLocalPath.GetBuffer()); -#else - mkdir( sLocalPath.GetBuffer() ,00777 ); -#endif -} - -/****************************************************************************/ -IniManager::IniManager( ByteString &rDir ) -/****************************************************************************/ - : bUpdate( sal_True ) -{ - sLocalPath = GetLocalIni(); - sGlobalDir = rDir; -#if !defined( UNX ) && !defined( OS2 ) - mkdir(( char * ) sLocalPath.GetBuffer()); -#else - mkdir( sLocalPath.GetBuffer() ,00777 ); -#endif -} - -/****************************************************************************/ -IniManager::IniManager() -/****************************************************************************/ - : bUpdate( sal_True ) -{ - sLocalPath = GetLocalIni(); - -#if !defined( UNX ) && !defined( OS2 ) - mkdir(( char * ) sLocalPath.GetBuffer()); -#else - mkdir( sLocalPath.GetBuffer(), 00777 ); -#endif - - sGlobalDir = GetGlobalIni(); -} - -/****************************************************************************/ -ByteString IniManager::ToLocal( ByteString &rPath ) -/****************************************************************************/ -{ - ByteString sTmp( rPath ); -#if !defined( UNX ) - ByteString sUnc( _INI_UNC ); - sUnc.ToUpperAscii(); - ByteString sOldUnc( _INI_UNC_OLD ); - sOldUnc.ToUpperAscii(); - sTmp.ToUpperAscii(); - - sTmp.SearchAndReplace( sUnc, _INI_DRV ); - sTmp.SearchAndReplace( sOldUnc, _INI_DRV ); - sTmp.ToUpperAscii(); - - ByteString sIni( sGlobalDir ); - sIni.ToUpperAscii(); - - sTmp.SearchAndReplace( sIni, sLocalPath ); - - while ( sTmp.SearchAndReplace( "\\\\", "\\" ) != STRING_NOTFOUND ) ; -#else - sTmp.SearchAndReplace( sGlobalDir, sLocalPath ); - - ByteString sOldGlobalDir( GetIniRootOld() ); - sTmp.SearchAndReplace( sOldGlobalDir, sLocalPath ); - - while ( sTmp.SearchAndReplace( "//", "/" ) != STRING_NOTFOUND ) ; -#endif - - return sTmp; -} - -/****************************************************************************/ -ByteString IniManager::GetLocalIni() -/****************************************************************************/ -{ - ByteString sLocalPath = ByteString( getenv( "LOCALINI" )); - - if ( !sLocalPath.Len()) { -#ifdef UNX - ByteString sLocal( getenv( "HOME" )); - sLocal += ByteString( "/localini" ); -#else - ByteString sLocal( getenv( "TMP" )); - sLocal += ByteString( "\\localini" ); -#endif - - sLocalPath = sLocal; - } - - return sLocalPath; -} - -/****************************************************************************/ -ByteString IniManager::GetGlobalIni() -/****************************************************************************/ -{ - ByteString sGlobalPath = ByteString( GetEnv( "GLOBALINI" )); - - if ( !sGlobalPath.Len()) - sGlobalPath = ByteString( _INIROOT ); - - return sGlobalPath; -} - -/****************************************************************************/ -void IniManager::ForceUpdate() -/****************************************************************************/ -{ - UniString sUniGlobalDir( sGlobalDir, gsl_getSystemTextEncoding()); - DirEntry aPath( UniString( sGlobalDir, gsl_getSystemTextEncoding())); - Dir aDir( aPath, FSYS_KIND_DIR | FSYS_KIND_FILE); - -#ifndef UNX - sLocalPath.EraseTrailingChars( '\\' ); - sLocalPath += "\\"; -#else - sLocalPath.EraseTrailingChars( '/' ); - sLocalPath += "/"; -#endif - - for ( sal_uInt16 i=0; i < aDir.Count(); i++ ) { - ByteString sEntry( aDir[i].GetName(), gsl_getSystemTextEncoding()); - if (( sEntry != "." ) && - ( sEntry != ".." )) - { - if ( !FileStat( aDir[i] ).IsKind( FSYS_KIND_DIR )) { - ByteString sSrc( aDir[i].GetFull(), gsl_getSystemTextEncoding()); - ByteString sDestination( sLocalPath ); - sDestination += sEntry; - - UniString sUniDestination( sDestination, gsl_getSystemTextEncoding()); - DirEntry aDestEntry( sUniDestination ); - FileStat aDestStat( aDestEntry ); - FileStat aSrcStat( aDir[i] ); - - if (( !aDestEntry.Exists() ) || - ( aSrcStat.IsYounger( aDestStat ))) - { - FileCopier aFileCopier( aDir[ i ], aDestEntry ); - aFileCopier.Execute(); - - while ( !aDestEntry.Exists()) - aFileCopier.Execute(); - } - } - } - } -} - -/****************************************************************************/ -void IniManager::Update() -/****************************************************************************/ -{ - if ( bUpdate ) - { - ForceUpdate(); - bUpdate = sal_False; - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx index 61228e170a10..d5940d805097 100644 --- a/tools/bootstrp/prj.cxx +++ b/tools/bootstrp/prj.cxx @@ -35,7 +35,6 @@ #include <tools/stream.hxx> #include <tools/geninfo.hxx> #include "bootstrp/prj.hxx" -#include "bootstrp/inimgr.hxx" #if defined(WNT) || defined(OS2) #define LIST_DELIMETER ';' diff --git a/tools/inc/bootstrp/appdef.hxx b/tools/inc/bootstrp/appdef.hxx index 0444478f30ee..833cd404847f 100644 --- a/tools/inc/bootstrp/appdef.hxx +++ b/tools/inc/bootstrp/appdef.hxx @@ -31,36 +31,14 @@ #ifdef UNX -#define DEFAULT_INI_ROOT "/so/env" -#define DEFAULT_BS_ROOT "/so/env/b_server" #define PATH_SEPARATOR '/' #define S_PATH_SEPARATOR "/" #else -#define DEFAULT_INI_ROOT "r:" -#define DEFAULT_BS_ROOT "n:" #define PATH_SEPARATOR '\\' #define S_PATH_SEPARATOR "\\" #endif -#define _INI_DRV DEFAULT_INI_ROOT -#define B_SERVER_ROOT DEFAULT_BS_ROOT -#define _SOLARLIST B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "solar.lst" -#define _DEF_STAND_LIST B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "stand.lst" -#define _DEF_SSOLARINI B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "ssolar.ini" -#define _DEF_SSCOMMON B_SERVER_ROOT S_PATH_SEPARATOR "config" S_PATH_SEPARATOR "ssolar.cmn" -#define _INIROOT B_SERVER_ROOT S_PATH_SEPARATOR "config" -#define _INIROOT_OLD B_SERVER_ROOT S_PATH_SEPARATOR "config" -#define _INI_UNC "\\\\jumbo2.germany.sun.com\\R-Laufwerk" -#define _INI_UNC_OLD "\\\\jumbo2.germany.sun.com\\R-Laufwerk" - - // path conversion -const char* GetDefStandList(); -const char* GetIniRoot(); -const char* GetIniRootOld(); -const char* GetSSolarIni(); -const char* GetSSCommon(); -const char* GetBServerRoot(); const char* GetEnv( const char *pVar ); const char* GetEnv( const char *pVar, const char *pDefault ); diff --git a/tools/inc/bootstrp/inimgr.hxx b/tools/inc/bootstrp/inimgr.hxx deleted file mode 100644 index 016eee7bcb76..000000000000 --- a/tools/inc/bootstrp/inimgr.hxx +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _INIMGR_HXX -#define _INIMGR_HXX - -#include <tools/fsys.hxx> -#include <tools/string.hxx> - -/***************************************************************************** -Purpose: Allows to work on a local set of initialisation files -If Update is used, the user must ensure that only one set of -Source and Destination Dir is used. Otherwise ForceUpdate has to be used -*****************************************************************************/ - -class IniManager -{ -private: - sal_Bool bUpdate; - - ByteString sGlobalDir; /// holds the org. ini dir - ByteString sLocalPath; /// holds path of local ini dir - -public: - IniManager( ByteString &rDir, ByteString &rLocalDir ); - IniManager( ByteString &rDir ); - IniManager(); - - ByteString ToLocal( ByteString &rPath ); - void Update(); /// Call ForceUpdate the First Time called - void ForceUpdate(); - - static ByteString GetLocalIni(); - static ByteString GetGlobalIni(); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |