reassign 805105 libperl6-export-attrs-perl 0.000004-2
affects 805105 libatompub-perl
tags 805105 patch
forwarded 805105 https://rt.cpan.org/Ticket/Display.html?id=107627
thanks

On Sat, Nov 14, 2015 at 09:25:35PM +0200, Niko Tyni wrote:
> On Sat, Nov 14, 2015 at 09:19:14PM +0200, Niko Tyni wrote:
> > Package: libatombus-perl
> > Version: 1.0405-2
> > Severity: serious
> > 
> > This package fails to build on current sid:
> > 
> >   Atompub::DateTime does not export: datetime
> 
> > Looking at https://reproducible.debian.net/history/libatombus-perl.html
> > this regressed in sid between 2015-10-18 and 2015-10-27.
> 
> This was apparently broken by libperl6-export-attrs-perl_0.000004-2.
> 
> See https://rt.cpan.org/Public/Bug/Display.html?id=108287
> and https://rt.cpan.org/Public/Bug/Display.html?id=107627

It's indeed a trivial regression there, patch attached.
-- 
Niko Tyni   nt...@debian.org
>From 132e0e132ba7d5185433e760f390aa330ea3ab49 Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Sun, 22 Nov 2015 00:08:55 +0200
Subject: [PATCH] Fix a 0.000004 regression in exporting subroutines

While at it, add a test case catching the regression.

Bug: https://rt.cpan.org/Public/Bug/Display.html?id=107627
Bug-Debian: https://bugs.debian.org/805105
---
 lib/Perl6/Export/Attrs.pm |  2 +-
 t/01export.t              | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 t/01export.t

diff --git a/lib/Perl6/Export/Attrs.pm b/lib/Perl6/Export/Attrs.pm
index cbe36b0..03016aa 100644
--- a/lib/Perl6/Export/Attrs.pm
+++ b/lib/Perl6/Export/Attrs.pm
@@ -141,7 +141,7 @@ sub _generic_import {
     REQUEST:
     while ($argno < @_) {
         my $request = $_[$argno];
-        if (my ($sub_name) = $request =~ m/\A & ($IDENT) (?:\(\))? \z/xms) {
+        if (my ($sub_name) = $request =~ m/\A &? ($IDENT) (?:\(\))? \z/xms) {
             if (exists $request{$sub_name}) {
                 splice @_, $argno, 1;
                 next REQUEST;
diff --git a/t/01export.t b/t/01export.t
new file mode 100644
index 0000000..976e924
--- /dev/null
+++ b/t/01export.t
@@ -0,0 +1,12 @@
+use Test::More tests => 1;
+
+package Lib;
+use Perl6::Export::Attrs;
+sub doit :Export { "Do it!"; }
+1;
+
+package main;
+import Lib qw(doit);
+
+is(doit(), "Do it!", "function exported as expected");
+
-- 
2.6.2

Reply via email to