Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
Petr Písař
54839f0c2d 6.95 bump 2025-07-08 09:29:13 +02:00
Petr Písař
33b0745e6d Remove an unused patch
The patch has already been merged into upstream release code.
2025-05-15 12:29:41 +02:00
Petr Písař
91d21b025c Remove non-free IETF documents from the package
A license of the documents allowed redistribution but did not allow
modification.
2025-05-15 12:29:40 +02:00
Petr Písař
4080ca0a66 Enable more gating tests 2025-05-15 12:29:09 +02:00
Petr Písař
3840b788e5 Modernize a spec file 2025-05-15 12:29:09 +02:00
Petr Písař
a48d1bd871 Fix webirc check in connection configuration 2025-05-15 12:29:08 +02:00
7 changed files with 116 additions and 154 deletions

2
.gitignore vendored
View file

@ -18,3 +18,5 @@ POE-Component-IRC-6.14.tar.gz
/POE-Component-IRC-6.91.tar.gz
/POE-Component-IRC-6.92.tar.gz
/POE-Component-IRC-6.93.tar.gz
/POE-Component-IRC-6.93_repackaged.tar.gz
/POE-Component-IRC-6.95_repackaged.tar.gz

View file

@ -1,146 +0,0 @@
From 8fec0161383143419d4cc957e001b0b2fc9fa304 Mon Sep 17 00:00:00 2001
From: Iain Arnell <iarnell@gmail.com>
Date: Thu, 20 May 2010 19:22:35 +0200
Subject: [PATCH] apply fixes for rhbz#591215
cherry-picked 4f46c29376359b3d7c5b5cd400115103fdef9ca8
cherry-picked 675f55cd40ceebbc1bd2f309311a066bed41d869
cherry-picked 9e2a01af6a908f9c1c97431bcbc5f483a7a99e2f
---
lib/POE/Component/IRC.pm | 19 +++++++------------
t/02_behavior/14_newline.t | 16 +++++++++-------
xt/perlcriticrc_t | 1 +
3 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/lib/POE/Component/IRC.pm b/lib/POE/Component/IRC.pm
index 4fe23da..ecaa50c 100644
--- a/lib/POE/Component/IRC.pm
+++ b/lib/POE/Component/IRC.pm
@@ -1038,9 +1038,7 @@ sub onlytwoargs {
# Handler for privmsg or notice events.
sub privandnotice {
- my ($kernel, $state, $to) = @_[KERNEL, STATE, ARG0];
- my $message = join ' ', @_[ARG1 .. $#_];
- my @messages = split /\n/, $message;
+ my ($kernel, $state, $to, $msg) = @_[KERNEL, STATE, ARG0, ARG1];
my $pri = $_[OBJECT]->{IRC_CMDS}->{$state}->[CMD_PRI];
$state =~ s/privmsglo/privmsg/;
@@ -1048,7 +1046,7 @@ sub privandnotice {
$state =~ s/noticelo/notice/;
$state =~ s/noticehi/notice/;
- if (!defined $to || !defined $message) {
+ if (!defined $to || !defined $msg) {
warn "The '$state' event requires two arguments\n";
return;
}
@@ -1056,9 +1054,7 @@ sub privandnotice {
$to = join ',', @$to if ref $to eq 'ARRAY';
$state = uc $state;
- for my $msg (@messages) {
- $kernel->yield(sl_prioritized => $pri, "$state $to :$msg");
- }
+ $kernel->yield(sl_prioritized => $pri, "$state $to :$msg");
return;
}
@@ -1214,14 +1210,14 @@ sub sl_prioritized {
my $now = time();
$self->{send_time} = $now if $self->{send_time} < $now;
+
+ # if we find a newline in the message, take that to be the end of it
+ $msg =~ s/[\015\012].*//s;
if (bytes::length($msg) > $self->{msg_length} - bytes::length($self->nick_name())) {
$msg = bytes::substr($msg, 0, $self->{msg_length} - bytes::length($self->nick_name()));
}
- # if we find a newline in the message, take that to be the end of it
- $msg =~ s/\n.*//gm;
-
if (@{ $self->{send_queue} }) {
my $i = @{ $self->{send_queue} };
$i-- while ($i && $priority < $self->{send_queue}->[$i-1]->[MSG_PRI]);
@@ -2188,8 +2184,7 @@ it will be treated as a PART message and dealt with accordingly.
Sends a public or private message to the nick(s) or channel(s) which
you specify. Takes 2 arguments: the nick or channel to send a message
to (use an array reference here to specify multiple recipients), and
-the text of the message to send. If the message contains newlines, it
-will be split up into multiple messages.
+the text of the message to send.
Have a look at the constants in
L<POE::Component::IRC::Common|POE::Component::IRC::Common> if you would
diff --git a/t/02_behavior/14_newline.t b/t/02_behavior/14_newline.t
index efad9f3..e59998d 100644
--- a/t/02_behavior/14_newline.t
+++ b/t/02_behavior/14_newline.t
@@ -3,16 +3,15 @@ use warnings;
use lib 't/inc';
use POE qw(Wheel::SocketFactory);
use Socket;
-use POE::Component::IRC::State;
-use POE::Component::IRC::Plugin::AutoJoin;
+use POE::Component::IRC;
use POE::Component::Server::IRC;
use Test::More tests => 9;
-my $bot1 = POE::Component::IRC::State->spawn(
+my $bot1 = POE::Component::IRC->spawn(
Flood => 1,
plugin_debug => 1,
);
-my $bot2 = POE::Component::IRC::State->spawn(
+my $bot2 = POE::Component::IRC->spawn(
Flood => 1,
plugin_debug => 1,
);
@@ -89,7 +88,7 @@ sub irc_join {
my ($sender, $heap, $who, $where) = @_[SENDER, HEAP, ARG0, ARG1];
my $nick = ( split /!/, $who )[0];
my $irc = $sender->get_heap();
-
+
return if $nick ne $irc->nick_name();
is($where, '#testchannel', 'Joined Channel Test');
@@ -98,10 +97,13 @@ sub irc_join {
$irc->yield(quote => "PRIVMSG $where :one\nPRIVMSG $where :two");
$irc->yield(privmsg => $where, "foo\nbar");
+ $irc->yield(privmsg => $where, "baz\rquux");
}
sub irc_public {
- my ($heap, $msg) = @_[HEAP, ARG2];
+ my ($sender, $heap, $where, $msg) = @_[SENDER, HEAP, ARG1, ARG2];
+ my $irc = $sender->get_heap();
+ my $chan = $where->[0];
$heap->{got_msg}++;
if ($heap->{got_msg} == 1) {
@@ -111,7 +113,7 @@ sub irc_public {
is($msg, 'foo', 'Second message');
}
elsif ($heap->{got_msg} == 3) {
- is($msg, 'bar', 'Third message');
+ is($msg, 'baz', 'Third message');
$bot1->yield('quit');
$bot2->yield('quit');
}
diff --git a/xt/perlcriticrc_t b/xt/perlcriticrc_t
index 3bd1ed9..9b1b549 100644
--- a/xt/perlcriticrc_t
+++ b/xt/perlcriticrc_t
@@ -25,3 +25,4 @@ verbose = 3
[-Modules::RequireExplicitPackage]
[-Modules::RequireFilenameMatchesPackage]
[-Subroutines::RequireFinalReturn]
+[-ControlStructures::ProhibitCascadingIfElse]
--
1.7.0.1

View file

@ -1,7 +1,16 @@
--- !Policy
product_versions:
- fedora-rawhide
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpmdeplint.functional}
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional}
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis}
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

View file

@ -1 +1,2 @@
addFilter('-tests\.noarch: W: no-documentation')
addFilter('invalid-url Source0: POE-Component-IRC-[\d\.]*_repackaged\.tar\.gz')

View file

@ -9,12 +9,29 @@
Name: perl-POE-Component-IRC
Summary: A POE component for building IRC clients
Version: 6.93
Release: 12%{?dist}
# Automatically converted from old format: GPL+ or Artistic - review is highly recommended.
Version: 6.95
Release: 1%{?dist}
# LICENSE: (GPL-1.0-or-later OR Artistic-1.0-Perl) declaration,
# GPL-1.0 text and Artistic-1.0 text
# other files: GPL-1.0-or-later OR Artistic-1.0-Perl
# t/inc/Crypt/PasswdMD5.pm: Beerware AND (GPL-1.0-or-later OR Artistic-1.0-Perl)
## Not used at build or in any binary package
# repackage.sh: GPL-2.0-or-later
## Stripped from source archive
# docs/draft-brocklesby-irc-isupport-03.txt: non-free
# docs/draft-mitchell-irc-capabilities-02.html: non-free
# docs/rfc2810.html: non-free
# docs/rfc2811.html: non-free
# docs/rfc2812.html: non-free
# docs/rfc2813.html: non-free
License: GPL-1.0-or-later OR Artistic-1.0-Perl
Source0: https://cpan.metacpan.org/authors/id/B/BI/BINGOS/POE-Component-IRC-%{version}.tar.gz
SourceLicense: (%{license}) AND Beerware AND GPL-2.0-or-later
URL: https://metacpan.org/release/POE-Component-IRC
# Origin Source0 URL:
# https://cpan.metacpan.org/authors/id/B/BI/BINGOS/POE-Component-IRC-%%{version}.tar.gz
# stripped from non-free IETF documents with repackage.sh script.
Source0: POE-Component-IRC-%{version}_repackaged.tar.gz
Source1: repackage.sh
BuildArch: noarch
BuildRequires: coreutils
BuildRequires: make
@ -115,6 +132,7 @@ is to it. Cool, no?
%package tests
Summary: Tests for %{name}
License: (GPL-1.0-or-later OR Artistic-1.0-Perl) AND Beerware
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: coreutils
Requires: perl-Test-Harness
@ -143,7 +161,7 @@ Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n POE-Component-IRC-%{version}
%autosetup -p1 -n POE-Component-IRC-%{version}
chmod -c -x examples/*
# Remove bundled modules
for D in t/inc/Crypt t/inc/Net; do
@ -191,13 +209,25 @@ make test
%files
%license LICENSE
%doc Changes docs/ examples/
%{perl_vendorlib}/*
%{_mandir}/man3/*.3*
%dir %{perl_vendorlib}/POE
%dir %{perl_vendorlib}/POE/Component
%{perl_vendorlib}/POE/Component/IRC{,.pm}
%dir %{perl_vendorlib}/POE/Filter
%{perl_vendorlib}/POE/Filter/IRC{,.pm}
%{_mandir}/man3/POE::Component::IRC{.,::}*
%{_mandir}/man3/POE::Filter::IRC{.,::}*
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Jul 08 2025 Petr Pisar <ppisar@redhat.com> - 6.95-1
- 6.95 bump
* Thu May 15 2025 Petr Pisar <ppisar@redhat.com> - 6.93-13
- Fix webirc check in connection configuration (CPAN RT#157738)
- Remove non-free IETF documents from the package
* Tue Aug 06 2024 Miroslav Suchý <msuchy@redhat.com> - 6.93-12
- convert license to SPDX

66
repackage.sh Executable file
View file

@ -0,0 +1,66 @@
#!/bin/bash
#
# Copyright (C) 2010, 2021 Red Hat, Inc.
# Authors:
# Thomas Woerner <twoerner@redhat.com>
# Petr Pisar <ppisar@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
version=$1
[ -z "$version" ] && { echo "Usage: $0 <version>"; exit 1; }
# files to be removed without the main SDL-<version>/ prefix
declare -a REMOVE
REMOVE[${#REMOVE[*]}]="docs/draft-brocklesby-irc-isupport-03.txt"
REMOVE[${#REMOVE[*]}]="docs/draft-mitchell-irc-capabilities-02.html"
REMOVE[${#REMOVE[*]}]="docs/rfc2810.html"
REMOVE[${#REMOVE[*]}]="docs/rfc2811.html"
REMOVE[${#REMOVE[*]}]="docs/rfc2812.html"
REMOVE[${#REMOVE[*]}]="docs/rfc2813.html"
# no changes below this line should be needed
orig="POE-Component-IRC-${version}"
orig_tgz="${orig}.tar.gz"
repackaged="${orig}_repackaged"
repackaged_tar="${repackaged}.tar"
repackaged_tgz="${repackaged_tar}.gz"
# pre checks
[ ! -f "${orig_tgz}" ] && { echo "ERROR: ${orig_tgz} does not exist"; exit 1; }
[ -d "${orig}" ] && { echo "ERROR: ${orig} directory already exist"; exit 1; }
[ -f "${repackaged_tgz}" ] && { echo "ERROR: ${repackaged_tgz} already exist"; exit 1; }
# repackage
failure=0
tar -xzf "${orig_tgz}"
for file in "${REMOVE[@]}"; do
rm "${orig}/${file}" 2>> repackage.log
[ $? != 0 ] && { echo "ERROR: Could not remove ${orig}/${file} file."; failure=1; } || echo "${orig}/${file} removed."
done
[ $failure != 0 ] && { echo "See repackage.log for the details."; exit 1; }
tar -czf "${repackaged_tgz}" "${orig}"
# post checks
RET=0
for file in "${REMOVE[@]}"; do
found=$(tar -ztvf "${repackaged_tgz}" | grep "${file}")
[ -n "$found" ] && { echo "ERROR: file ${file} is still in the repackaged archive."; RET=1; }
done
[ $RET == 0 ] && echo "Sucessfully repackaged ${orig}: ${repackaged_tgz}"
exit $RET

View file

@ -1 +1 @@
SHA512 (POE-Component-IRC-6.93.tar.gz) = 334535cb4f02c63fbc8b457b9e5c6d8cb96ef0ac159ac6f810d7cda337f55a729b73115a65dfca11c44ca286d355667500b021cd5408943a1afd2d325ece7be0
SHA512 (POE-Component-IRC-6.95_repackaged.tar.gz) = dc480db56d2eb9aeff51778f2fed488f7310f12e78013e13976c6ca0357d609dfcc0f0844ccbb0d2f8db3c2f5685cf164b07e5040f5be35018d952e2d41f291b