summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2010-06-07 10:13:44 +0200
committerJoachim Lingner <jl@openoffice.org>2010-06-07 10:13:44 +0200
commit79dc6b2d075493f49875ea0a1308849fdc7a43d9 (patch)
treeca35012d50d6d12ca6847c36072cc30f2f6c343c /l10ntools
parent0ddbd71a7ac5a25aa92666d26d5f264821c3bad8 (diff)
parentd21adcdca61a7c54b3bf1584d80746dc0d2d1fc0 (diff)
jl152 merge with DEV300_m80
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/help/HelpIndexerTool.java30
1 files changed, 27 insertions, 3 deletions
diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java
index 1245247c3c9a..2a49f964d48f 100644
--- a/l10ntools/source/help/HelpIndexerTool.java
+++ b/l10ntools/source/help/HelpIndexerTool.java
@@ -69,6 +69,7 @@ public class HelpIndexerTool
String aModule = "";
String aTargetZipFileStr = "";
String aCfsName = "";
+ String aSegmentName = "";
// Scan arguments
boolean bLang = false;
@@ -77,6 +78,7 @@ public class HelpIndexerTool
boolean bSrcDir = false;
boolean bOutput = false;
boolean bCfsName = false;
+ boolean bSegmentName = false;
int nArgCount = args.length;
for( int i = 0 ; i < nArgCount ; i++ )
@@ -126,7 +128,7 @@ public class HelpIndexerTool
}
i++;
}
- else if( "-checkcfsname".equals(args[i]) )
+ else if( "-checkcfsandsegname".equals(args[i]) )
{
if( i + 1 < nArgCount )
{
@@ -134,6 +136,17 @@ public class HelpIndexerTool
bCfsName = true;
}
i++;
+ if( i + 1 < nArgCount )
+ {
+ aSegmentName = "segments" + args[i + 1];
+ bSegmentName = true;
+ }
+ i++;
+ if (!(bCfsName && bSegmentName))
+ {
+ System.out.println("Usage: HelpIndexer -checkcfsandsegname _0 _3 (2 arguments needed)");
+ System.exit( -1 );
+ }
}
}
@@ -173,12 +186,17 @@ public class HelpIndexerTool
writer.close();
boolean bCfsFileOk = true;
- if( bCfsName && !bExtensionMode && nRet != -1 )
+ boolean bSegmentFileOk = true;
+ if( bCfsName && bSegmentName && !bExtensionMode && nRet != -1 )
{
String aCompleteCfsFileName = aDirToZipStr + File.separator + aIndexDirName + File.separator + aCfsName;
+ String aCompleteSegmentFileName = aDirToZipStr + File.separator + aIndexDirName + File.separator + aSegmentName;
File aCfsFile = new File( aCompleteCfsFileName );
+ File aSegmentFile = new File( aCompleteSegmentFileName );
bCfsFileOk = aCfsFile.exists();
+ bSegmentFileOk = aSegmentFile.exists();
System.out.println( "Checking cfs file " + aCfsName+ ": " + (bCfsFileOk ? "Found" : "Not found") );
+ System.out.println( "Checking segment file " + aSegmentName+ ": " + (bSegmentFileOk ? "Found" : "Not found") );
}
if( bExtensionMode )
@@ -194,7 +212,7 @@ public class HelpIndexerTool
if( nRet == -1 )
deleteRecursively( aIndexDir );
- if( bCfsFileOk )
+ if( bCfsFileOk && bSegmentFileOk )
System.out.println( "Zipping ..." );
File aDirToZipFile = new File( aDirToZipStr );
createZipFile( aDirToZipFile, aTargetZipFileStr );
@@ -207,6 +225,12 @@ public class HelpIndexerTool
System.exit( -1 );
}
+ if( !bSegmentFileOk )
+ {
+ System.out.println( "segment file check failed, terminating..." );
+ System.exit( -1 );
+ }
+
Date end = new Date();
if( !bExtensionMode )
System.out.println(end.getTime() - start.getTime() + " total milliseconds");