linux cc&指定32位库,查找32位Linux Perl库以运行Perl脚本

我正在尝试使用this example创建CentOS kickstart安装文件,但它需要一些perl库。以下是本文建议在我的6.4 32位CentOS中安装这些文件的方式,但这些库是64位的,并且该命令不起作用。安装所需的32位perl库的最简单方法是什么,以便我可以运行下面的perl脚本?从链接查找32位Linux Perl库以运行Perl脚本

Librares:

sudo rpm -Uvh \

perl-Compress-Raw-Zlib-2.023-119.el6.x86_64.rpm \

perl-Compress-Zlib-2.020-119.el6.x86_64.rpm \

perl-HTML-Parser-3.64-2.el6.x86_64.rpm \

perl-HTML-Tagset-3.20-4.el6.noarch.rpm \

perl-IO-Compress-Base-2.020-119.el6.x86_64.rpm \

perl-IO-Compress-Zlib-2.020-119.el6.x86_64.rpm \

perl-libwww-perl-5.833-2.el6.noarch.rpm \

perl-URI-1.40-2.el6.noarch.rpm \

perl-XML-Parser-2.36-7.el6.x86_64.rpm \

perl-XML-Simple-2.18-6.el6.noarch.rpm

的Perl脚本我想要运行:

#!/usr/bin/perl

use XML::Simple;

my ($comps_file, $rpm_path, $arch) = @ARGV;

if (!-e $comps_file)

{

print_usage ("Can't find '$comps_file'");

}

if (!-e $rpm_path)

{

print_usage ("RPM path '$comps_file' does not exist");

}

if (!$arch)

{

print_usage ("Architecture not specified");

}

print "reading $comps_file...\n";

print "getting RPMs from $rpm_path...\n";

$xml = new XML::Simple;

$comps = $xml->XMLin($comps_file);

%copied_packages = {};

foreach $group (@{$comps->{group}})

{

$id = $group->{id};

if (!($id eq 'base' || $id eq 'core'))

{

next;

}

print "#### group \@$id\n";

$packagelist = $group->{packagelist};

foreach $pr (@{$packagelist->{packagereq}})

{

if ($pr->{type} eq 'optional')

{

next;

}

$cmd = "cp $rpm_path/" . $pr->{content} . "-[0-9]*.$arch.rpm"

. " $rpm_path/" . $pr->{content} . "-[0-9]*.noarch.rpm .";

print "$cmd\n";

`$cmd 2>&1`;

$copied_packages{$pr->{content}} = 1;

}

}

sub print_usage

{

my ($msg) = @_;

($msg) && print "$msg\n\n";

print <<__text__>

parse_comps.pl comps_file rpm_path arch

comps_file the full path to the comps.xml file (as provided in the

original distro

rpm_path the full path to the directory of all RPMs from the distro

arch the target system architecture (e.g. x86_64)

__TEXT__

exit;

}

2013-05-16

c12

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值