AIX-LPP
view release on metacpan or search on metacpan
LPP/lpp_name.pm view on Meta::CPAN
my %param = @_;
my $self = {};
if (defined $param{FORMAT}) { $self->{FORMAT} = $param{FORMAT}}
else { $self->{FORMAT} = '4'}
if (defined $param{PLATFORM}) { $self->{PLATFORM} = $param{PLATFORM}}
else { $self->{PLATFORM} = 'R'}
if (defined $param{TYPE}) { $self->{TYPE} = $param{TYPE}}
else { $self->{TYPE} = 'I'}
if (defined $param{NAME}) { $self->{NAME} = $param{NAME}}
else { $self->{NAME} = 'test.lpp'}
$self->{FILESET} = {};
bless $self, $class;
return $self;
}
sub lpp {
my $self = shift;
return ( $self->{NAME},$self->{TYPE},$self->{FORMAT},$self->{PLATFORM},
keys %{$self->{FILESET}} ) unless @_;
my %param = @_;
LPP/lpp_name.pm view on Meta::CPAN
__END__
=head1 NAME
AIX::LPP::lpp_name - Perl module for manipulation of an AIX lpp_name file
=head1 SYNOPSIS
use AIX::LPP::lpp_name;
$x = lpp_name->new();
$x->lpp(NAME => 'test.lpp',TYPE => 'I',PLATFORM => 'R',FORMAT => '4');
$x->fileset('test.lpp.rte', VRMF => '1.0.0.0',DISK => '01',BOSBOOT => 'N',
CONTENT => 'I', LANG => 'en_US', DESCRIPTION => 'test.lpp description',
COMMENTS => '');
my @reqs = [ ['*prereq','bos.rte','4.3.3.0'] ];
$x->requisites('test.lpp.rte', \@reqs);
my %sizes = { '/usr' => '5', '/etc' => '1' };
$x->sizeinfo('test.lpp.rte', \%sizes);
$x->write(\*out_fh);
or
$x = lpp_name->read(\*in_fh);
my %lppdata = $x->lpp();
my %fsdata = $x->fileset('test.lpp.rte');
my $req_ref = $x->requisites('test.lpp.rte');
my $size_ref = $x->sizeinfo('test.lpp.rte');
=head1 DESCRIPTION
AIX::LPP::lpp_name is a class module for reading, creating, and modifying
AIX lpp_name files. The lpp_name file is an internal component of AIX
packages (called LPPs). LPPs consist of filesets and information about
installing them. This information can include: prerequisites, filesystem
requirements, copywrites, etc..
=head1 CONSTRUCTOR METHODS
The following module is under development:
AIX::LPP.pm
Provide an abstration layer to related AIX::LPP components, and read
and report *installed* package information.
Other modules are under consideration.
PREREQUISITES
-------------
1. Perl 5.005_62 or later (earlier versions untested)
2. AIX 4.3 (AIX 5L is untested)
INSTALLATION
------------
1. Check you have all the prequisites installed and working.
2. Run 'perl Makefile.PL && make test'
3. If successful, run 'make install'
HOW TO USE
----------
use AIX::LPP::lpp_name;
$x = lpp_name->new();
$x->lpp(NAME => 'test.lpp',TYPE => 'I',PLATFORM => 'R',FORMAT => '4');
$x->fileset('test.lpp.rte', VRMF => '1.0.0.0',DISK => '01',BOSBOOT => 'N',
CONTENT => 'I', LANG => 'en_US', DESCRIPTION => 'test.lpp description',
COMMENTS => '');
my @reqs = [ ['*prereq','bos.rte','4.3.3.0'] ];
$x->requisites('test.lpp.rte', \@reqs);
my %sizes = { '/usr' => '5', '/etc' => '1' };
$x->sizeinfo('test.lpp.rte', \%sizes);
$x->write(\*out_fh);
or
$x = lpp_name->read(\*in_fh);
my %lppdata = $x->lpp();
my %fsdata = $x->fileset('test.lpp.rte');
my $req_ref = $x->requisites('test.lpp.rte');
my $size_ref = $x->sizeinfo('test.lpp.rte');
Read the installp manpage and the IBM LPP package format documentation
for more detail. The use maintained lppbuild package is also a good
source of documentation.
Support questions and suggestions can be directed to critter@aixadm.org
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
######################### We start with some black magic to print on failure.
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
BEGIN { $| = 1; print "1..1\n"; }
END {print "not ok 1\n" unless $loaded;}
use AIX::LPP::lpp_name;
$loaded = 1;
print "ok 1\n";
######################### End of black magic.
# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
use AIX::LPP::lpp_name;
print "1..8\n";
$package = AIX::LPP::lpp_name->new(NAME => 'test.lpp',TYPE => 'I',
PLATFORM => 'R',FORMAT => '4');
print "ok 1\n";
$package->fileset('test.lpp.rte',VRMF => '1.0.0.0',DISK => '01',BOSBOOT => 'N',
CONTENT => 'I',LANG => 'en_US',DESCRIPTION => 'test.lpp description',
COMMENTS => '');
print "ok 2\n";
$package->fileset('test.lpp.adt');
print "ok 3\n";
my @reqs = [ ['*prereq','bos.rte','4.3.3.0'] ];
$package->requisites('test.lpp.adt', \@reqs);
print "ok 4\n";
$package->sizeinfo('test.lpp.adt');
print "ok 5\n";
$package->lpp(FORMAT => 5) && print "ok 6\n";
$package->lpp() && print "ok 7\n";
$package->{FORMAT} && print "ok 8\n";
use AIX::LPP::lpp_name;
print "1..1\n";
open(LPP_NAME,">data/lpp_test.2") or die "Can't open file lpp_name: $!";
$package = AIX::LPP::lpp_name->new(NAME => 'test.lpp',TYPE => 'I',
FORMAT => '4', PLATFORM => 'R');
$package->fileset('test.lpp.rte', VRMF => '01.01.0000.0000',DISK => '01',
BOSBOOT => 'N',CONTENT => 'U', LANG => 'en_US',
DESCRIPTION => 'test package description' );
# $package->requisites();
# $package->sizeinfo();
$package->write(\*LPP_NAME);
print "ok 1\n";
use AIX::LPP::lpp_name;
print "1..1\n";
open(INLPP,"<data/lpp_name") or die "Can't open file lpp_name: $!";
open(OUTLPP,">data/lpp_test.3") or die "Can't open file lpp_name: $!";
$package = AIX::LPP::lpp_name->read(\*INLPP);
$package->write(\*OUTLPP);
print "ok 1\n";
( run in 0.274 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )