0
 >    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
<p>Additionally, a 403 Forbidden
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
      ˆl–ßi~”d
e¶¥8 ¸n¥1hßÅ0ÃÂ  "   	ˆl–Ðz¾”êe¶¥8 [¸Ð®*bÑ¿Æƒh¹ÄÃ      	03
  	   ˆ¿Æ0ÄÃ      ˆ940_•I|¥‰ÓMdœv ©ƒ&íK<óo¬ÅÄ ¬    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /ALFA_DATA/alfasymlink/root/usr/lib64/perl5/vendor_perl/Data</title>
 </head>
 <body>
<h1>Index of /ALFA_DATA/alfasymlink/root/usr/lib64/perl5/vendor_perl/Data</h1>
  <table>
   <tr><th valign="top">&nbsp;</th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr>
   <tr><th colspan="5"><hr></th></tr>
<tr><td valign="top">&nbsp;</td><td><a href="/ALFA_DATA/alfasymlink/root/usr/lib64/perl5/vendor_perl/">Parent Directory</a>       </td><td>&nbsp;</td><td align="right">  - </td><td>&nbsp;</td></tr>
<tr><td valign="top">&nbsp;</td><td><a href="Dumper.pm">Dumper.pm</a>              </td><td align="right">2013-03-15 12:49  </td><td align="right"> 43K</td><td>&nbsp;</td></tr>
   <tr><th colspan="5"><hr></th></tr>
</table>
</body></html>
  "   ˆl–äY>”jh¥4 ¸ \iµ1hßÈƒy°ƒÆÅ !>    #!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - ea_current_to_profile                  Copyright(c) 2022 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

use strict;
use warnings;

package ea_cpanel_tools::ea_current_to_profile;

use Cpanel::PackMan;
use Cpanel::Config::Httpd;
use Cpanel::JSON;
use Cpanel::Time::Local;
use Path::Tiny 'path';

our $ea4_profiles_dir = '/etc/cpanel/ea4/profiles';
our $_max_attempts    = 20;

our $manifest_file     = "/etc/cpanel/ea4/profiles/pkg-manifest.json";
our $ea4_metainfo_file = '/etc/cpanel/ea4/ea4-metainfo.json';

our %safe_to_ignore = (
    'ea-brotli'            => 1,
    'ea-brotli-devel'      => 1,
    'ea-libargon2'         => 1,
    'ea-libargon2-devel'   => 1,
    'ea-libcurl'           => 1,
    'ea-libcurl-devel'     => 1,
    'ea-libnghttp2'        => 1,
    'ea-libxml2'           => 1,
    'ea-libzip'            => 1,
    'ea-nghttp2'           => 1,
    'ea-oniguruma'         => 1,
    'ea-oniguruma-devel'   => 1,
    'ea-openssl11'         => 1,
    'ea-openssl11-devel'   => 1,
    'ea-openssl11-libs'    => 1,
    'ea-openssl'           => 1,
    'ea-openssl-devel'     => 1,
    'ea-openssl-libs'      => 1,
    'ea-php73-libc-client' => 1,
    'ea-php74-libc-client' => 1,
    'ea-php80-libc-client' => 1,
    'ea-php81-libc-client' => 1
);

our %os_type = (
    "CentOS_7"      => "rpm",
    "CentOS_8"      => "rpm",
    "CentOS_9"      => "rpm",
    "xUbuntu_20.04" => "deb",
    "xUbuntu_22.04" => "deb",
);

exit( script(@ARGV) ) unless caller();

sub script {
    my (@args) = @_;

    my $custom_json;
    my $new_name;
    my $target_os;
    my $manifest_os;
    my $modified = 0;
    my $source_pkmgr = -x '/usr/bin/apt' ? 'deb' : 'rpm';

    # We need to get OS aliases
    my %ea4_metainfo        = %{ Cpanel::JSON::LoadFile($ea4_metainfo_file) };
    my %obs_project_aliases = %{ $ea4_metainfo{obs_project_aliases} };
    die "obs_project_aliases is empty" if ( !%obs_project_aliases );

    foreach my $arg (@args) {
        if ( $arg eq "--help" ) {
            my $os_string = join( ' ', keys %obs_project_aliases );

            print <<USAGE;
    $0 [--help] [--output=profile_file] [--target-os=os]
        Take the current ea rpms and create a custom profile.
        Profile is written to /etc/cpanel/ea4/profiles/custom

        --output=profile_file, where the profile is written to.
           Note: forceful