File: //scripts.20110531.215904.25158/fontconfigfix
#!/usr/bin/perl
# cpanel12 - fontconfigfix Copyright(c) 2004-2008 cPanel, Inc.
# All rights Reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
exit if !-e '/etc/redhat-release';
my $rpm = find_rpm();
exit if !$rpm;
if ( -e '/usr/share/man/man5/fonts-conf.5.gz' && -x $rpm ) {
my $rpmdata = `$rpm -q --qf "%{ARCH} %{VERSION} %{RELEASE}" fontconfig`;
chomp $rpmdata;
my ( $arch, $version, $build ) = split( /\s+/, $rpmdata );
if ( $arch && $version && $build && $arch eq 'x86_64' && $version eq '2.2.3' && $build eq '7' ) {
system $rpm, '-e', '--nodeps', 'fontconfig-2.2.3-7';
}
}
sub find_rpm {
#FIXME: should use _find_bin here after it gets broken out from MysqlUtils
my @locations = qw( /bin /usr/bin /sbin /usr/sbin );
foreach my $dir (@location) {
if ( -x $dir . '/rpm' ) {
return $dir . '/rpm';
last;
}
}
return;
}