2 eval 'exec perl -wS $0 ${1+"$@"}'
5 #*************************************************************************
7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 # Copyright 2008 by Sun Microsystems, Inc.
11 # OpenOffice.org - a multi-platform office productivity suite
13 # $RCSfile: list_icons.pl,v $
17 # This file is part of OpenOffice.org.
19 # OpenOffice.org is free software: you can redistribute it and/or modify
20 # it under the terms of the GNU Lesser General Public License version 3
21 # only, as published by the Free Software Foundation.
23 # OpenOffice.org is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU Lesser General Public License version 3 for more details
27 # (a copy is included in the LICENSE file that accompanied this code).
29 # You should have received a copy of the GNU Lesser General Public License
30 # version 3 along with OpenOffice.org. If not, see
31 # <http://www.openoffice.org/license.html>
32 # for a copy of the LGPLv3 License.
34 #*************************************************************************
39 # package all .icns if XML::Parser module is not installed
40 eval 'use XML::Parser;'; if ( $@
) { print '*.icns'; exit 0; };
42 my $valuetype = "none";
50 my ($parser,$element,%attributes) = @_;
51 $valuetype = "$element";
55 my ($parser,$string) = @_;
56 if ( $key eq "CFBundleTypeIconFile" || $key eq "CFBundleIconFile" ) {
59 print "$string " if length($string) > 0;
61 $key = "$string" if $valuetype eq "key";
65 my ($parser,$string) = @_;
69 my ($parser,$element) = @_;
71 $key = "none" if $valuetype ne "key";
79 my $parser = new XML
::Parser
(ErrorContext
=> 2,
82 $parser->setHandlers( Start
=> \
&start_handler
,
84 Char
=> \
&char_handler
,
85 Default
=> \
&default_handler
);
86 $parser->parse(STDIN
);