summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2006-01-13 15:16:00 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2006-01-13 15:16:00 +0000
commitc7bff5057573ec8f889aa45de28cc423382aab5c (patch)
tree29639445ce5326a0a446ec72b23b059bca9c81c0
parentce51191bf8e40f9f87d561d7dbfd9cbaefb0584b (diff)
INTEGRATION: CWS ause046 (1.2.146); FILE MERGED
2005/12/20 15:54:53 hjs 1.2.146.1: #i59471# improve script
-rw-r--r--helpcontent2/helpers/create_ilst.pl69
1 files changed, 51 insertions, 18 deletions
diff --git a/helpcontent2/helpers/create_ilst.pl b/helpcontent2/helpers/create_ilst.pl
index 7da6f425cd..1963720869 100644
--- a/helpcontent2/helpers/create_ilst.pl
+++ b/helpcontent2/helpers/create_ilst.pl
@@ -1,38 +1,71 @@
-#!/usr/bin/perl
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: create_ilst.pl,v $
+#
+# $Revision: 1.3 $
+#
+# last change: $Author: rt $ $Date: 2006-01-13 16:16:00 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
# creates the ilst control file for the
# help specific images
-$helpdirprefix = "helpcontent2/source/";
+use File::Find;
$params = join "|", "",@ARGV,"";
($params =~ /-dir/) ? ($startdir = $params) =~ (s/.*-dir=([^\|]*).*$/$1/gs) : (($startdir = `pwd`) =~ s/\n//gs);
-($params =~ /-out/) ? ($outdir = $params) =~ (s/.*-out=([^\|]*).*$/$1/gs) : (($outdir = `pwd`) =~ s/\n//gs);
-($params =~ /-pre/) ? ($outdir = $params) =~ (s/.*-pre=([^\|]*).*$/$1/gs) : ($pre = "/res/helpimg/");
+($params =~ /-pre/) ? ($pre = $params) =~ (s/.*-pre=([^\|]*).*$/$1/gs) : ($pre = "helpimg");
-if (opendir DIR, $startdir) {
- print $startdir;
- @files = grep /png$/, readdir DIR;
+if ( -d $startdir ) {
+ find(sub{push @files, $File::Find::name if (($File::Find::name=~/\.png$/));},$startdir);
+ foreach ( @files ) { s#.*$startdir/##; };
for (sort(@files)) {
- print "%GLOBAL%".$pre.$_."\n";
+ print "%GLOBALRES%/$pre/$_\n";
}
} else {
- &terminate("Cannot access $startdir.");
+ &terminate("Cannot find $startdir.");
}
sub terminate {
$err = shift;
- print "$err\n\n";
+ printf STDERR "$err\n\n";
$msg = <<"MSG";
-create_ilst.pl -dir=[directory name] -out=[directory name]
- -dir root directory for the help images to
- be searched (default=current dir)
- Only *.png will be found.
- -pre directory prefix (default=/res/helpimg/)
- -out output directory for the helpimg.ilst file
- (default=current dir)
+create_ilst.pl -dir=directory [-pre=string]
+-dir root directory for the help images to
+ be searched (default=current dir)
+ Only *.png will be found.
+-pre define directory prefix (default=helpimg)
MSG
die "$msg\n";
-} \ No newline at end of file
+}