MOON
Server: Apache
System: Linux vps.thepromohut.com 2.6.18-398.el5 #1 SMP Tue Sep 16 20:51:48 EDT 2014 i686
User: caretrak (507)
PHP: 5.2.10
Disabled: NONE
Upload Files
File: //scripts.20110601.041516.15411/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;
}