summaryrefslogtreecommitdiffstats
path: root/abs/core/perl_modules/perl-xml-libxml/perl-xml-libxml.install
blob: 3a8eb1eddd9b60918ba2d372244199e0788fd475 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
post_install() {
  echo ":: Installing SAX XML Parsers"
  perl -MXML::SAX -e "XML::SAX->add_parser(q(XML::LibXML::SAX::Parser))->save_parsers()"
  perl -MXML::SAX -e "XML::SAX->add_parser(q(XML::LibXML::SAX))->save_parsers()"
}

post_upgrade() {
  if [[ ! -f /usr/share/perl5/vendor_perl/XML/SAX/ParserDetails.ini ]]; then
    post_install
  else
    libxmlcount=`grep -c XML::LibXML::SAX /usr/share/perl5/vendor_perl/XML/SAX/ParserDetails.ini`
    if [[ $libxmlcount == 0 ]]; then
      post_install
    fi
  fi
}

pre_remove() {
  if [[ -f /usr/share/perl5/vendor_perl/XML/SAX/ParserDetails.ini ]]; then
    perl -MXML::SAX -e "XML::SAX->remove_parser(q(XML::LibXML::SAX::Parser))->save_parsers()"
    perl -MXML::SAX -e "XML::SAX->remove_parser(q(XML::LibXML::SAX))->save_parsers()"
  fi
}