diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-06-02 08:04:29 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-06-02 08:04:29 +0200 |
commit | 1cab950be67dd778ce7e7fdce644c651eebff5fe (patch) | |
tree | b7a5cd38ad634744692f28b208d5f38b11e669db | |
parent | e2a1df3c8d1a72edce1a702fb4ee873fc558b0d5 (diff) | |
download | slackbuilder-1cab950be67dd778ce7e7fdce644c651eebff5fe.tar.gz slackbuilder-1cab950be67dd778ce7e7fdce644c651eebff5fe.tar.bz2 |
Minor changes
* lib/SlackBuild/Rc.pm (code): Use upgradepkg --install-new instead og
installpkg.
* lib/SlackBuild/Request.pm (prereq): Ignore %README% that can appear
in the REQUIRES variable.
* lib/SlackBuild/URI.pm (download): Set user agent.
* lib/SlackBuilder.pm (_build): Use security option seccomp=unconfined
(for building Emacs).
-rw-r--r-- | lib/SlackBuild/Rc.pm | 2 | ||||
-rw-r--r-- | lib/SlackBuild/Request.pm | 12 | ||||
-rw-r--r-- | lib/SlackBuild/URI.pm | 1 | ||||
-rw-r--r-- | lib/SlackBuilder.pm | 1 |
4 files changed, 15 insertions, 1 deletions
diff --git a/lib/SlackBuild/Rc.pm b/lib/SlackBuild/Rc.pm index 6129a6c..f7c7357 100644 --- a/lib/SlackBuild/Rc.pm +++ b/lib/SlackBuild/Rc.pm @@ -46,7 +46,7 @@ sub code { my @code = ('#! /bin/sh', 'set -e', '(. /etc/os-release; echo SLACKBUILDER: DISTRO $NAME; echo SLACKBUILDER: VERSION $VERSION)', - map { "/sbin/installpkg /var/pkg/$_" } @$pkglist); + map { "/sbin/upgradepkg --install-new /var/pkg/$_" } @$pkglist); my $env = $self->builder->environ; while (my ($k,$v) = each %$env) { diff --git a/lib/SlackBuild/Request.pm b/lib/SlackBuild/Request.pm index 0b9b83b..531c221 100644 --- a/lib/SlackBuild/Request.pm +++ b/lib/SlackBuild/Request.pm @@ -180,10 +180,22 @@ sub addinfo { } } +sub prereq { + my $self = shift; + croak "too many arguments" if @_ > 1; + if (my $v = shift) { + $v = [ $v ] unless ref($v) eq 'ARRAY'; + $v = [ grep { $_ ne '%README%' } @$v ]; + $self->{prereq} = $v; + } + return $self->{prereq}; +} + { no strict 'refs'; use feature 'state'; while (my ($attr,$descr) = each %attributes) { + next if __PACKAGE__->can($attr); *{ __PACKAGE__ . '::' . $attr } = sub { my $self = shift; croak "too many arguments" if @_ > 1; diff --git a/lib/SlackBuild/URI.pm b/lib/SlackBuild/URI.pm index 60b6b26..410a9ca 100644 --- a/lib/SlackBuild/URI.pm +++ b/lib/SlackBuild/URI.pm @@ -64,6 +64,7 @@ sub download { require "LWP/Protocol/$scheme.pm"; print "downloading $self\n"; my $ua = LWP::UserAgent->new(); + $ua->agent('Slackbuilder/0.90'); my $response = $ua->get($self->as_string, ':content_file' => $dst); $self->download_response($response); return $response->is_success; diff --git a/lib/SlackBuilder.pm b/lib/SlackBuilder.pm index 0c88c91..2cb462b 100644 --- a/lib/SlackBuilder.pm +++ b/lib/SlackBuilder.pm @@ -325,6 +325,7 @@ sub _build { 'run', '--rm=true', '--workdir=/usr/src', + '--security-opt=seccomp=unconfined', # This one is needed for Emacs '-v', $self->wd . ':/usr/src', '-v', $self->tmpdir . ':/tmp', '-v', $self->ospkgdir . ':/var/pkg:ro', |