summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-01-27 12:25:22 +0100
committerSergey Poznyakoff <gray@gnu.org.ua>2020-01-28 13:42:40 +0100
commitc990139d4966272e2999f088c77128b1ad704cc6 (patch)
tree5a23532b7b970a197fde90b841a44760066f74c9
parenta58e5a4da9312e93f79610be85311e8e5f9839c7 (diff)
downloadslackbuilder-c990139d4966272e2999f088c77128b1ad704cc6.tar.gz
slackbuilder-c990139d4966272e2999f088c77128b1ad704cc6.tar.bz2
Bugfixes
* lib/Net/SBo.pm: Escape the path in regex using \Q..\E * lib/SlackBuild/Registry/Backend/FS.pm (scan): Fix out-of-bounds error in last element of $self->{ls}. * lib/SlackBuilder.pm (run): Shift from @md5sums (instead of popping).
-rw-r--r--lib/Net/SBo.pm7
-rw-r--r--lib/SlackBuild/Registry/Backend/FS.pm2
-rw-r--r--lib/SlackBuilder.pm2
3 files changed, 5 insertions, 6 deletions
diff --git a/lib/Net/SBo.pm b/lib/Net/SBo.pm
index b16cb80..e62df81 100644
--- a/lib/Net/SBo.pm
+++ b/lib/Net/SBo.pm
@@ -162,7 +162,7 @@ sub scan {
=head2 $sbo->commit()
-Returns the SHA-1 hash identified the scanned commit.
+Returns the SHA-1 hash which identifies the scanned commit.
=cut
@@ -266,7 +266,6 @@ sub get {
open(my $fd, '-|', @gitcmd) or croak "can't run git: $!";
$path .= '/' unless $path =~ m{/$};
- my $rx = qr($path);
my $tar = new Archive::Tar($fd);
my @result;
@@ -275,7 +274,7 @@ sub get {
foreach my $file (tar->get_files) {
my $name = $file->full_path;
- if ($name =~ s{^$rx}{$dest}) {
+ if ($name =~ s{^\Q$path\E}{$dest}) {
if ($file->extract($name)) {
push @result, $name;
}
@@ -287,7 +286,7 @@ sub get {
}
foreach my $file ($tar->get_files) {
my $name = $file->full_path;
- if ($name =~ s{^$rx}{}) {
+ if ($name =~ s{^\Q$path\E}{}) {
$file->rename($name);
}
push @result, $name;
diff --git a/lib/SlackBuild/Registry/Backend/FS.pm b/lib/SlackBuild/Registry/Backend/FS.pm
index bb66894..788ab2c 100644
--- a/lib/SlackBuild/Registry/Backend/FS.pm
+++ b/lib/SlackBuild/Registry/Backend/FS.pm
@@ -99,7 +99,7 @@ sub scan {
$self->{index}{$self->{ls}[$i]->package}[0] = $i;
}
}
- $self->{index}{$self->{ls}[$i-1]->package}[1] = $i;
+ $self->{index}{$self->{ls}[$i-1]->package}[1] = $i-1;
}
=head2 lookup
diff --git a/lib/SlackBuilder.pm b/lib/SlackBuilder.pm
index 2b71738..9134443 100644
--- a/lib/SlackBuilder.pm
+++ b/lib/SlackBuilder.pm
@@ -337,7 +337,7 @@ sub run {
$self->request->extract_local_name($uri->as_string));
return $self->errno(E_FAIL)
unless $uri->download($dest);
- if (my $checksum = pop @md5sums) {
+ if (my $checksum = shift @md5sums) {
$self->logger->info("verifying $dest");
$self->logger->debug("$dest: reported digest $checksum");
if (open(my $fh, '<', $dest)) {

Return to:

Send suggestions and report system problems to the System administrator.