summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLPOBJ.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPOBJ.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm36
1 files changed, 18 insertions, 18 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index 1530c1a06c8..6ff4908c0f8 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -1177,6 +1177,18 @@ sub _parse_hyphen_execute {
# member access functions
#
+sub _set_get_array_value {
+ my $self = shift;
+ my $key = shift;
+ if (@_) {
+ if (defined($_[0])) {
+ $self->{$key} = [ @_ ];
+ } else {
+ $self->{$key} = [ ];
+ }
+ }
+ return @{ $self->{$key} };
+}
sub name {
my $self = shift;
if (@_) { $self->{'name'} = shift }
@@ -1213,9 +1225,7 @@ sub catalogue {
return $self->{'catalogue'};
}
sub srcfiles {
- my $self = shift;
- if (@_) { $self->{'srcfiles'} = [ @_ ] }
- return @{ $self->{'srcfiles'} };
+ _set_get_array_value(shift, "srcfiles", @_);
}
sub containersize {
my $self = shift;
@@ -1280,9 +1290,7 @@ sub remove_srcfiles {
$self->remove_files("src",@files);
}
sub docfiles {
- my $self = shift;
- if (@_) { $self->{'docfiles'} = [ @_ ] }
- return @{ $self->{'docfiles'} };
+ _set_get_array_value(shift, "docfiles", @_);
}
sub clear_docfiles {
my $self = shift;
@@ -1338,9 +1346,7 @@ sub remove_binfiles {
$self->{'binfiles'}{$arch} = [ @finalfiles ];
}
sub runfiles {
- my $self = shift;
- if (@_) { $self->{'runfiles'} = [ @_ ] }
- return @{ $self->{'runfiles'} };
+ _set_get_array_value(shift, "runfiles", @_);
}
sub clear_runfiles {
my $self = shift;
@@ -1360,19 +1366,13 @@ sub remove_runfiles {
$self->remove_files("run",@files);
}
sub depends {
- my $self = shift;
- if (@_) { $self->{'depends'} = [ @_ ] }
- return @{ $self->{'depends'} };
+ _set_get_array_value(shift, "depends", @_);
}
sub executes {
- my $self = shift;
- if (@_) { $self->{'executes'} = [ @_ ] }
- return @{ $self->{'executes'} };
+ _set_get_array_value(shift, "executes", @_);
}
sub postactions {
- my $self = shift;
- if (@_) { $self->{'postactions'} = [ @_ ] }
- return @{ $self->{'postactions'} };
+ _set_get_array_value(shift, "postactions", @_);
}
sub containerdir {
my @self = shift;