From e705781dcf203cc25a4ce9570e9e90c6fd7c54e166e298af39a21bfcb6243e57 Mon Sep 17 00:00:00 2001 From: Oliver Kurz Date: Tue, 30 Sep 2025 22:33:17 +0200 Subject: [PATCH] Add 0001-Replace-deprecated-Mojo-File-spew-with-spurt.patch. See https://github.com/jhthorsen/mojolicious-plugin-webpack/pull/17 --- ...deprecated-Mojo-File-spew-with-spurt.patch | 147 ++++++++++++++++++ cpanspec.yml | 5 +- perl-Mojolicious-Plugin-Webpack.changes | 6 + perl-Mojolicious-Plugin-Webpack.spec | 4 +- 4 files changed, 158 insertions(+), 4 deletions(-) create mode 100644 0001-Replace-deprecated-Mojo-File-spew-with-spurt.patch diff --git a/0001-Replace-deprecated-Mojo-File-spew-with-spurt.patch b/0001-Replace-deprecated-Mojo-File-spew-with-spurt.patch new file mode 100644 index 0000000..56b9aea --- /dev/null +++ b/0001-Replace-deprecated-Mojo-File-spew-with-spurt.patch @@ -0,0 +1,147 @@ +From 399fb9eaffd42972837ab0c1359171578199fc30 Mon Sep 17 00:00:00 2001 +From: Oliver Kurz +Date: Thu, 3 Jul 2025 20:46:40 +0200 +Subject: [PATCH] Replace deprecated 'Mojo::File::spew' with 'spurt' + +This fixes issues like observed in +https://github.com/openSUSE/qem-dashboard/actions/runs/16056912984/job/45313482646?pr=2666#step:11:13 + +``` +Error: Mojo::File::spurt is deprecated in favor of Mojo::File::spew at /opt/hostedtoolcache/perl/5.40.2/x64/lib/site_perl/5.40.2/Mojo/Alien/webpack.pm line 187. +``` + +same as local test errors using a current Mojolicious distribution like + +``` +t/plugin-built.t ............. Mojo::File::spurt is deprecated in favor of Mojo::File::spew at t/plugin-built.t line 24. +Mojo::File::spurt is deprecated in favor of Mojo::File::spew at t/plugin-built.t line 32. +``` +--- + lib/Mojo/Alien/webpack.pm | 2 +- + t/alien-rollup-api.t | 2 +- + t/alien-rollup-files.t | 2 +- + t/alien-webpack-css.t | 4 ++-- + t/alien-webpack-files.t | 2 +- + t/alien-webpack-js.t | 2 +- + t/plugin-build.t | 2 +- + t/plugin-built.t | 4 ++-- + 8 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/lib/Mojo/Alien/webpack.pm b/lib/Mojo/Alien/webpack.pm +index a1d156b..82ad7eb 100644 +--- a/lib/Mojo/Alien/webpack.pm ++++ b/lib/Mojo/Alien/webpack.pm +@@ -184,7 +184,7 @@ sub _render_file { + $self->_d('Render %s to %s', $name, $file) if DEBUG; + $file->dirname->make_path unless -d $file->dirname; + $content //= $self->_resources->{$name}; +- $file->spurt(sprintf "// Autogenerated by %s %s\n%s", ref($self), $VERSION, $content); ++ $file->spew(sprintf "// Autogenerated by %s %s\n%s", ref($self), $VERSION, $content); + return $self; + } + +diff --git a/t/alien-rollup-api.t b/t/alien-rollup-api.t +index 6243d5b..52d5271 100644 +--- a/t/alien-rollup-api.t ++++ b/t/alien-rollup-api.t +@@ -24,7 +24,7 @@ subtest 'basic' => sub { + subtest 'build' => sub { + my $rollup = Mojo::Alien::rollup->new; + +- $rollup->config->dirname->child(qw(assets))->make_path->child('index.js')->spurt("console.log(42);\n"); ++ $rollup->config->dirname->child(qw(assets))->make_path->child('index.js')->spew("console.log(42);\n"); + is $rollup->build, $rollup, 'build'; + + local $rollup->{binary} = '/no/such/bin/rollup'; +diff --git a/t/alien-rollup-files.t b/t/alien-rollup-files.t +index 44a2ef5..e4ae09f 100644 +--- a/t/alien-rollup-files.t ++++ b/t/alien-rollup-files.t +@@ -47,7 +47,7 @@ sub make_project_files { + for my $name (keys %$data) { + my $file = $rollup->assets_dir->child(split '/', $name); + $file->dirname->make_path; +- $file->spurt($data->{$name}); ++ $file->spew($data->{$name}); + } + + return $data; +diff --git a/t/alien-webpack-css.t b/t/alien-webpack-css.t +index 0182954..bf0bb0e 100644 +--- a/t/alien-webpack-css.t ++++ b/t/alien-webpack-css.t +@@ -9,8 +9,8 @@ note sprintf 'work_dir=%s', Mojo::Alien::npm->_setup_working_directory; + my $webpack = Mojo::Alien::webpack->new->include(['css']); + $webpack->assets_dir->make_path; + +-my $index_css = $webpack->assets_dir->child('index.css')->spurt(qq[body { background: #fefefe; }\n]); +-my $index_js = $webpack->assets_dir->child('index.js')->spurt(qq[require('./index.css');]); ++my $index_css = $webpack->assets_dir->child('index.css')->spew(qq[body { background: #fefefe; }\n]); ++my $index_js = $webpack->assets_dir->child('index.js')->spew(qq[require('./index.css');]); + my $dist_file = $webpack->config->dirname->child('dist', 'alien-webpack-css-t.development.css'); + + is $webpack->build, $webpack, 'build css'; +diff --git a/t/alien-webpack-files.t b/t/alien-webpack-files.t +index 6df86db..501db98 100644 +--- a/t/alien-webpack-files.t ++++ b/t/alien-webpack-files.t +@@ -46,7 +46,7 @@ sub make_project_files { + for my $name (keys %$data) { + my $file = $webpack->assets_dir->child(split '/', $name); + $file->dirname->make_path; +- $file->spurt($data->{$name}); ++ $file->spew($data->{$name}); + } + + return $data; +diff --git a/t/alien-webpack-js.t b/t/alien-webpack-js.t +index 3846d2b..3bf6145 100644 +--- a/t/alien-webpack-js.t ++++ b/t/alien-webpack-js.t +@@ -7,7 +7,7 @@ plan skip_all => 'TEST_JS=1' unless $ENV{TEST_JS} or $ENV{TEST_ALL}; + note sprintf 'work_dir=%s', Mojo::Alien::npm->_setup_working_directory; + + my $webpack = Mojo::Alien::webpack->new->include(['js']); +-my $index_js = $webpack->assets_dir->make_path->child('index.js')->spurt(qq[console.log('built $^T');]); ++my $index_js = $webpack->assets_dir->make_path->child('index.js')->spew(qq[console.log('built $^T');]); + my $dist_file = $webpack->config->dirname->child('dist', 'alien-webpack-js-t.development.js'); + + is $webpack->build, $webpack, 'build js'; +diff --git a/t/plugin-build.t b/t/plugin-build.t +index 3df0220..716f197 100644 +--- a/t/plugin-build.t ++++ b/t/plugin-build.t +@@ -28,7 +28,7 @@ $t->get_ok('/asset/plugin-build-t.development.js')->status_is(200)->header_is('C + done_testing; + + sub make_project_files { +- app->home->rel_file('assets')->make_path->child('index.js')->spurt('console.log(42);'); ++ app->home->rel_file('assets')->make_path->child('index.js')->spew('console.log(42);'); + } + + __DATA__ +diff --git a/t/plugin-built.t b/t/plugin-built.t +index 384c508..a74c6d3 100644 +--- a/t/plugin-built.t ++++ b/t/plugin-built.t +@@ -21,7 +21,7 @@ done_testing; + + sub make_project_files { + my $assets = app->home->rel_file('assets'); +- $assets->child('webpack.config.d')->make_path->child('custom.js')->spurt(<<'HERE'); ++ $assets->child('webpack.config.d')->make_path->child('custom.js')->spew(<<'HERE'); + module.exports = function(config) { + config.entry = { + 'cool': './assets/cool-beans.js', +@@ -29,7 +29,7 @@ module.exports = function(config) { + }; + HERE + +- $assets->child('cool-beans.js')->spurt('console.log(42);'); ++ $assets->child('cool-beans.js')->spew('console.log(42);'); + } + + __DATA__ +-- +2.51.0 + diff --git a/cpanspec.yml b/cpanspec.yml index 32e802c..83728b7 100644 --- a/cpanspec.yml +++ b/cpanspec.yml @@ -7,9 +7,8 @@ description_paragraphs: 4 #sources: # - source1 # - source2 -#patches: -# foo.patch: -p1 -# bar.patch: +patches: + 0001-Replace-deprecated-Mojo-File-spew-with-spurt.patch: -p1 PATCH-FIX-UPSTREAM https://github.com/jhthorsen/mojolicious-plugin-webpack/pull/17 #preamble: |- # BuildRequires: gcc-c++ #post_prep: |- diff --git a/perl-Mojolicious-Plugin-Webpack.changes b/perl-Mojolicious-Plugin-Webpack.changes index 3fe9ef6..a6c806e 100644 --- a/perl-Mojolicious-Plugin-Webpack.changes +++ b/perl-Mojolicious-Plugin-Webpack.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Sep 30 20:24:13 UTC 2025 - Oliver Kurz + +- Add 0001-Replace-deprecated-Mojo-File-spew-with-spurt.patch. See + https://github.com/jhthorsen/mojolicious-plugin-webpack/pull/17 + ------------------------------------------------------------------- Sat Jul 30 03:07:15 UTC 2022 - Tina Müller diff --git a/perl-Mojolicious-Plugin-Webpack.spec b/perl-Mojolicious-Plugin-Webpack.spec index 55d330e..fca81aa 100644 --- a/perl-Mojolicious-Plugin-Webpack.spec +++ b/perl-Mojolicious-Plugin-Webpack.spec @@ -26,6 +26,8 @@ URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/J/JH/JHTHORSEN/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml Source100: README.md +# PATCH-FIX-UPSTREAM https://github.com/jhthorsen/mojolicious-plugin-webpack/pull/17 +Patch0: 0001-Replace-deprecated-Mojo-File-spew-with-spurt.patch BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros @@ -51,7 +53,7 @@ Webpack. * 2. %prep -%autosetup -n %{cpan_name}-%{version} +%autosetup -n %{cpan_name}-%{version} -p1 %build perl Makefile.PL INSTALLDIRS=vendor -- 2.49.0