summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-02-04 15:40:43 +0100
committerSergey Poznyakoff <gray@gnu.org.ua>2020-02-04 15:40:43 +0100
commit4df67ed9062a8593290572a6979a38d5d1b5c54c (patch)
tree31b2133f14982bcd7a91c9427c04cef9f59199fa
parentba278845c2a701eba0df23c554ce6af977057fda (diff)
downloadslackbuilder-4df67ed9062a8593290572a6979a38d5d1b5c54c.tar.gz
slackbuilder-4df67ed9062a8593290572a6979a38d5d1b5c54c.tar.bz2
Bugfixes in SlackBuild::Archive::Tar
* lib/SlackBuild/Archive/Tar.pm (list): Sort the list if necessary. (add_file): Update file list. (save): Disable recursion when creating archive.
-rw-r--r--lib/SlackBuild/Archive/Tar.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/SlackBuild/Archive/Tar.pm b/lib/SlackBuild/Archive/Tar.pm
index 0580e14..a0abddb 100644
--- a/lib/SlackBuild/Archive/Tar.pm
+++ b/lib/SlackBuild/Archive/Tar.pm
@@ -82,6 +82,10 @@ sub list {
$self->{_list} = [];
}
}
+ if ($self->{_sort}) {
+ $self->{_list} = [sort @{$self->{_list}}];
+ $self->{_sort} = 0;
+ }
return @{$self->{_list}};
}
@@ -260,7 +264,10 @@ sub add_file {
$self->logger->error("can't create $fullname: $!");
return;
};
- $self->{_changed} = 1;
+ unless ($self->has_file($filename)) {
+ push @{$self->{_list}}, $filename;
+ }
+ $self->{_changed} = $self->{_sort} = 1;
return $fh;
}
@@ -302,7 +309,8 @@ sub save {
unlink $self->filename;
}
if (my $ret = $self->tarcmd('-c', '-C', $self->workdir,
- grep { $_ ne '.' } $self->list)) {
+ '--no-recursion',
+ $self->list)) {
$self->{_changed} = 0;
return $ret;
}

Return to:

Send suggestions and report system problems to the System administrator.