forked from pool/perl-Mojo-IOLoop-ReadWriteProcess
Accepting request 1111533 from devel:languages:perl
OBS-URL: https://build.opensuse.org/request/show/1111533 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/perl-Mojo-IOLoop-ReadWriteProcess?expand=0&rev=19
This commit is contained in:
@@ -7,8 +7,8 @@
|
|||||||
#sources:
|
#sources:
|
||||||
# - source1
|
# - source1
|
||||||
# - source2
|
# - source2
|
||||||
#patches:
|
patches:
|
||||||
# foo.patch: -p1
|
deprecated-spurt.patch: -p1 PATCH-FIX-UPSTREAM https://github.com/openSUSE/Mojo-IOLoop-ReadWriteProcess/pull/51
|
||||||
# bar.patch:
|
# bar.patch:
|
||||||
#preamble: |-
|
#preamble: |-
|
||||||
# BuildRequires: gcc-c++
|
# BuildRequires: gcc-c++
|
||||||
|
156
deprecated-spurt.patch
Normal file
156
deprecated-spurt.patch
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
From 91220d3c90c97f9339220aa9166bbd35880faff0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Oliver Kurz <okurz@suse.de>
|
||||||
|
Date: Thu, 14 Sep 2023 08:05:39 +0200
|
||||||
|
Subject: [PATCH] Adapt to deprecation of spurt in upstream Mojolicious
|
||||||
|
|
||||||
|
Related progress issue: https://progress.opensuse.org/issues/135632
|
||||||
|
---
|
||||||
|
Build.PL | 2 +-
|
||||||
|
META.json | 2 +-
|
||||||
|
cpanfile | 2 +-
|
||||||
|
lib/Mojo/IOLoop/ReadWriteProcess.pm | 2 +-
|
||||||
|
lib/Mojo/IOLoop/ReadWriteProcess/CGroup.pm | 2 +-
|
||||||
|
t/10_cgroupv1.t | 2 +-
|
||||||
|
t/10_cgroupv2.t | 17 ++++++++---------
|
||||||
|
7 files changed, 14 insertions(+), 15 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Build.PL b/Build.PL
|
||||||
|
index ad9d29b..a3ab8a4 100644
|
||||||
|
--- a/Build.PL
|
||||||
|
+++ b/Build.PL
|
||||||
|
@@ -24,7 +24,7 @@ my %args = (
|
||||||
|
|
||||||
|
requires => {
|
||||||
|
'IPC::SharedMem' => '0',
|
||||||
|
- 'Mojolicious' => '0',
|
||||||
|
+ 'Mojolicious' => '>=9.34',
|
||||||
|
},
|
||||||
|
|
||||||
|
recommends => {
|
||||||
|
diff --git a/META.json b/META.json
|
||||||
|
index 4a2bf53..8073a41 100644
|
||||||
|
--- a/META.json
|
||||||
|
+++ b/META.json
|
||||||
|
@@ -47,7 +47,7 @@
|
||||||
|
"runtime" : {
|
||||||
|
"requires" : {
|
||||||
|
"IPC::SharedMem" : "0",
|
||||||
|
- "Mojolicious" : "0"
|
||||||
|
+ "Mojolicious" : ">= 9.34"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test" : {
|
||||||
|
diff --git a/cpanfile b/cpanfile
|
||||||
|
index 9e6efb4..c51046a 100644
|
||||||
|
--- a/cpanfile
|
||||||
|
+++ b/cpanfile
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-requires 'Mojolicious';
|
||||||
|
+requires 'Mojolicious', '>= 9.34';
|
||||||
|
requires 'IPC::SharedMem';
|
||||||
|
|
||||||
|
on configure => sub {
|
||||||
|
diff --git a/lib/Mojo/IOLoop/ReadWriteProcess.pm b/lib/Mojo/IOLoop/ReadWriteProcess.pm
|
||||||
|
index aea520e..a617424 100644
|
||||||
|
--- a/lib/Mojo/IOLoop/ReadWriteProcess.pm
|
||||||
|
+++ b/lib/Mojo/IOLoop/ReadWriteProcess.pm
|
||||||
|
@@ -412,7 +412,7 @@ sub write_pidfile {
|
||||||
|
return unless $self->pid;
|
||||||
|
return unless $self->pidfile;
|
||||||
|
|
||||||
|
- path($self->pidfile)->spurt($self->pid);
|
||||||
|
+ path($self->pidfile)->spew($self->pid);
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/lib/Mojo/IOLoop/ReadWriteProcess/CGroup.pm b/lib/Mojo/IOLoop/ReadWriteProcess/CGroup.pm
|
||||||
|
index 1acf478..6ba28b0 100644
|
||||||
|
--- a/lib/Mojo/IOLoop/ReadWriteProcess/CGroup.pm
|
||||||
|
+++ b/lib/Mojo/IOLoop/ReadWriteProcess/CGroup.pm
|
||||||
|
@@ -72,7 +72,7 @@ sub _contains {
|
||||||
|
|
||||||
|
sub _setget {
|
||||||
|
$_[2]
|
||||||
|
- ? shift->_cgroup->child($_[0])->spurt($_[1])
|
||||||
|
+ ? shift->_cgroup->child($_[0])->spew($_[1])
|
||||||
|
: shift->_cgroup->child($_[0])->slurp;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/t/10_cgroupv1.t b/t/10_cgroupv1.t
|
||||||
|
index 5c18ff9..c3509a4 100644
|
||||||
|
--- a/t/10_cgroupv1.t
|
||||||
|
+++ b/t/10_cgroupv1.t
|
||||||
|
@@ -87,7 +87,7 @@ subtest mock => sub {
|
||||||
|
|
||||||
|
sub mockwrite {
|
||||||
|
my $c = shift;
|
||||||
|
- $c->cgroup->_cgroup->child(shift)->spurt(shift);
|
||||||
|
+ $c->cgroup->_cgroup->child(shift)->spew(shift);
|
||||||
|
}
|
||||||
|
|
||||||
|
subtest dev_freez_pid_rdma_controller => sub {
|
||||||
|
diff --git a/t/10_cgroupv2.t b/t/10_cgroupv2.t
|
||||||
|
index 37f12f2..c259c26 100644
|
||||||
|
--- a/t/10_cgroupv2.t
|
||||||
|
+++ b/t/10_cgroupv2.t
|
||||||
|
@@ -104,7 +104,7 @@ subtest mock => sub {
|
||||||
|
|
||||||
|
$cgroup->io->cgroup->_cgroup->child(
|
||||||
|
Mojo::IOLoop::ReadWriteProcess::CGroup::v2::IO::STAT_INTERFACE())
|
||||||
|
- ->spurt('20');
|
||||||
|
+ ->spew('20');
|
||||||
|
is $cgroup->io->stat, '20', 'Correct io.max set';
|
||||||
|
|
||||||
|
$cgroup->cpu->max('30');
|
||||||
|
@@ -115,27 +115,27 @@ subtest mock => sub {
|
||||||
|
is $cgroup->cpu->weight_nice, '42', 'Correct cpu.weight_nice set';
|
||||||
|
$cgroup->cpu->cgroup->_cgroup->child(
|
||||||
|
Mojo::IOLoop::ReadWriteProcess::CGroup::v2::CPU::STAT_INTERFACE())
|
||||||
|
- ->spurt('20');
|
||||||
|
+ ->spew('20');
|
||||||
|
is $cgroup->cpu->stat, '20', 'Correct cpu.stat set';
|
||||||
|
|
||||||
|
$cgroup->memory->cgroup->_cgroup->child(
|
||||||
|
Mojo::IOLoop::ReadWriteProcess::CGroup::v2::Memory::EVENTS_INTERFACE())
|
||||||
|
- ->spurt('230');
|
||||||
|
+ ->spew('230');
|
||||||
|
is $cgroup->memory->events, '230', 'Correct memory.events set';
|
||||||
|
|
||||||
|
$cgroup->memory->cgroup->_cgroup->child(
|
||||||
|
Mojo::IOLoop::ReadWriteProcess::CGroup::v2::Memory::STAT_INTERFACE())
|
||||||
|
- ->spurt('333');
|
||||||
|
+ ->spew('333');
|
||||||
|
is $cgroup->memory->stat, '333', 'Correct memory.stat set';
|
||||||
|
|
||||||
|
$cgroup->memory->cgroup->_cgroup->child(
|
||||||
|
Mojo::IOLoop::ReadWriteProcess::CGroup::v2::Memory::CURRENT_INTERFACE())
|
||||||
|
- ->spurt('foo');
|
||||||
|
+ ->spew('foo');
|
||||||
|
is $cgroup->memory->current, 'foo', 'Correct memory.stat set';
|
||||||
|
|
||||||
|
$cgroup->memory->cgroup->_cgroup->child(
|
||||||
|
Mojo::IOLoop::ReadWriteProcess::CGroup::v2::Memory::SWAP_CURRENT_INTERFACE(
|
||||||
|
- ))->spurt('bar');
|
||||||
|
+ ))->spew('bar');
|
||||||
|
is $cgroup->memory->swap_current, 'bar', 'Correct memory.stat set';
|
||||||
|
|
||||||
|
$cgroup->memory->max('4');
|
||||||
|
@@ -158,7 +158,7 @@ subtest mock => sub {
|
||||||
|
|
||||||
|
$cgroup->pid->cgroup->_cgroup->child(
|
||||||
|
Mojo::IOLoop::ReadWriteProcess::CGroup::v2::PID::CURRENT_INTERFACE())
|
||||||
|
- ->spurt('test');
|
||||||
|
+ ->spew('test');
|
||||||
|
is $cgroup->pid->current, 'test', 'Can get cgroup max';
|
||||||
|
|
||||||
|
my $cgroup2
|
||||||
|
@@ -195,8 +195,7 @@ subtest mock => sub {
|
||||||
|
|
||||||
|
|
||||||
|
$cgroup2->_cgroup->child(
|
||||||
|
- Mojo::IOLoop::ReadWriteProcess::CGroup::v2::STAT_INTERFACE())
|
||||||
|
- ->spurt('test');
|
||||||
|
+ Mojo::IOLoop::ReadWriteProcess::CGroup::v2::STAT_INTERFACE())->spew('test');
|
||||||
|
is $cgroup2->stat, 'test', 'Can get cgroup stats';
|
||||||
|
|
||||||
|
|
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Sep 15 10:32:21 UTC 2023 - Tina Müller <tina.mueller@suse.com>
|
||||||
|
|
||||||
|
- Add patch deprecated-spurt.patch
|
||||||
|
https://github.com/openSUSE/Mojo-IOLoop-ReadWriteProcess/pull/51
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Dec 12 20:21:31 UTC 2022 - Tina Müller <timueller+perl@suse.de>
|
Mon Dec 12 20:21:31 UTC 2022 - Tina Müller <timueller+perl@suse.de>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package perl-Mojo-IOLoop-ReadWriteProcess
|
# spec file for package perl-Mojo-IOLoop-ReadWriteProcess
|
||||||
#
|
#
|
||||||
# Copyright (c) 2022 SUSE LLC
|
# Copyright (c) 2023 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -25,11 +25,13 @@ Summary: Execute external programs or internal code blocks as separate pr
|
|||||||
URL: https://metacpan.org/release/%{cpan_name}
|
URL: https://metacpan.org/release/%{cpan_name}
|
||||||
Source0: https://cpan.metacpan.org/authors/id/S/SZ/SZARATE/%{cpan_name}-%{version}.tar.gz
|
Source0: https://cpan.metacpan.org/authors/id/S/SZ/SZARATE/%{cpan_name}-%{version}.tar.gz
|
||||||
Source1: cpanspec.yml
|
Source1: cpanspec.yml
|
||||||
|
# PATCH-FIX-UPSTREAM https://github.com/openSUSE/Mojo-IOLoop-ReadWriteProcess/pull/51
|
||||||
|
Patch0: deprecated-spurt.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: perl
|
BuildRequires: perl
|
||||||
BuildRequires: perl-macros
|
BuildRequires: perl-macros
|
||||||
BuildRequires: perl(IPC::SharedMem)
|
BuildRequires: perl(IPC::SharedMem)
|
||||||
BuildRequires: perl(Module::Build) >= 0.400500
|
BuildRequires: perl(Module::Build) >= 0.4005
|
||||||
BuildRequires: perl(Mojolicious)
|
BuildRequires: perl(Mojolicious)
|
||||||
BuildRequires: perl(Test::Exception)
|
BuildRequires: perl(Test::Exception)
|
||||||
Requires: perl(IPC::SharedMem)
|
Requires: perl(IPC::SharedMem)
|
||||||
@@ -40,22 +42,23 @@ Requires: perl(Mojolicious)
|
|||||||
Mojo::IOLoop::ReadWriteProcess is yet another process manager.
|
Mojo::IOLoop::ReadWriteProcess is yet another process manager.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{cpan_name}-%{version}
|
%autosetup -n %{cpan_name}-%{version} -p1
|
||||||
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
|
|
||||||
|
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644
|
||||||
|
|
||||||
%build
|
%build
|
||||||
perl Build.PL installdirs=vendor
|
perl Build.PL --installdirs=vendor
|
||||||
./Build build flags=%{?_smp_mflags}
|
./Build build --flags=%{?_smp_mflags}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
./Build test
|
./Build test
|
||||||
|
|
||||||
%install
|
%install
|
||||||
./Build install destdir=%{buildroot} create_packlist=0
|
./Build install --destdir=%{buildroot} --create_packlist=0
|
||||||
%perl_gen_filelist
|
%perl_gen_filelist
|
||||||
|
|
||||||
%files -f %{name}.files
|
%files -f %{name}.files
|
||||||
%doc Changes codecov.yml minil.toml README.md
|
%doc Changes README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Reference in New Issue
Block a user