2 eval 'exec perl -wS $0 ${1+"$@"}'
6 # This file is part of the LibreOffice project.
8 # This Source Code Form is subject to the terms of the Mozilla Public
9 # License, v. 2.0. If a copy of the MPL was not distributed with this
10 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 # This file incorporates work covered by the following license notice:
14 # Licensed to the Apache Software Foundation (ASF) under one or more
15 # contributor license agreements. See the NOTICE file distributed
16 # with this work for additional information regarding copyright
17 # ownership. The ASF licenses this file to you under the Apache
18 # License, Version 2.0 (the "License"); you may not use this file
19 # except in compliance with the License. You may obtain a copy of
20 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
26 # package all .icns if XML::Parser module is not installed
27 eval 'use XML::Parser;'; if ( $@
) { print '*.icns'; exit 0; };
29 my $valuetype = "none";
37 my ($parser,$element,%attributes) = @_;
38 $valuetype = "$element";
42 my ($parser,$string) = @_;
43 if ( $key eq "CFBundleTypeIconFile" || $key eq "CFBundleIconFile" ) {
46 print "$string " if length($string) > 0;
48 $key = "$string" if $valuetype eq "key";
52 my ($parser,$string) = @_;
56 my ($parser,$element) = @_;
58 $key = "none" if $valuetype ne "key";
66 my $parser = new XML
::Parser
(ErrorContext
=> 2,
69 $parser->setHandlers( Start
=> \
&start_handler
,
71 Char
=> \
&char_handler
,
72 Default
=> \
&default_handler
);
73 $parser->parse(STDIN
);