Software-Packager-Aix

 view release on metacpan or  search on metacpan

lib/Software/Packager/Object/Aix.pm  view on Meta::CPAN

sub inventory_type
{
	my $self = shift;
	return $m_inventory_type_map->{lc $self->type()};
}

################################################################################
# Function:	destination()

=head2 B<destination()>

 $object->destination($value);
 $destination = $object->destination();

This method sets or returns the destination location for this object.
The name of objects being installed cannot contain commas or colons. This is
because commas and colons are used as delimiters in the control files used
during the software installation process.
Object names can contain non-ASCII charaters.

=cut 
sub destination
{
	my $self = shift;
	my $value = shift;

	if ($value)
	{
		if ($value =~ /\,|\:/)
		{
			warn "Error: Cannot add object to the package: Objects cannot have names containing commas or colons.\n";
			return undef;
		}
		$self->{'DESTINATION'} = $value;
	}
	else
	{
		return $self->{'DESTINATION'};
	}
}

################################################################################
# Function:	user()

=head2 B<user()>

This method sets or returns the user name that this object should be installed
as.

=cut 
sub user
{
	my $self = shift;
	my $value = shift;

	if ($value)
	{
		# if we only have digits then get the name.
		if ($value =~ /^\d+$/) 
		{
			$value = getpwuid($value);
		}
		$self->{'USER'} = $value;
	}
	else
	{
		unless (scalar $self->{'USER'})
		{
			$self->{'USER'} = getpwuid($<);
		}
		return $self->{'USER'};
	}
}

################################################################################
# Function:	group()

=head2 B<group()>

 $object->group($value);
 $group = $object->group();

This method sets or returns the group name that this object should be installed
as.

=cut 
sub group
{
	my $self = shift;
	my $value = shift;

	if ($value)
	{
		# if we only have digits then get the name.
		if ($value =~ /^\d+$/) 
		{
			$value = getgrgid($value);
		}
		$self->{'GROUP'} = $value;
	}
	else
	{
		unless (scalar $self->{'GROUP'})
		{
			my $groups = $(;
			my ($group, @rest) = split / /, $groups;
			$self->{'GROUP'} = getgrgid($group);
		}
		return $self->{'GROUP'};
	}
}

################################################################################
# Function:	links()

=head2 B<links()>

This method adds to the list of hard links to add for the file.
If no arguments are passed then a string containing the list is returned.

=cut 
sub links
{
	my $self = shift;
	my $value = shift;

	if (defined $value)
	{
		push @{$self->{'LINKS'}}, $value;



( run in 1.143 second using v1.01-cache-2.11-cpan-39bf76dae61 )