2 eval 'exec perl -wS $0 ${1+"$@"}'
5 #*************************************************************************
7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 # Copyright 2000, 2010 Oracle and/or its affiliates.
11 # OpenOffice.org - a multi-platform office productivity suite
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
35 # package all .icns if XML::Parser module is not installed
36 eval 'use XML::Parser;'; if ( $@
) { print '*.icns'; exit 0; };
38 my $valuetype = "none";
46 my ($parser,$element,%attributes) = @_;
47 $valuetype = "$element";
51 my ($parser,$string) = @_;
52 if ( $key eq "CFBundleTypeIconFile" || $key eq "CFBundleIconFile" ) {
55 print "$string " if length($string) > 0;
57 $key = "$string" if $valuetype eq "key";
61 my ($parser,$string) = @_;
65 my ($parser,$element) = @_;
67 $key = "none" if $valuetype ne "key";
75 my $parser = new XML
::Parser
(ErrorContext
=> 2,
78 $parser->setHandlers( Start
=> \
&start_handler
,
80 Char
=> \
&char_handler
,
81 Default
=> \
&default_handler
);
82 $parser->parse(STDIN
);