PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread Svante Signell
Hi,

The following patch is sufficient to make Debian GNU/Hurd build again with the
latest perl 5.22.1-1:

Index: hurd-0.7/libdde-linux26/lib/src/kernel/timeconst.pl
===
--- hurd-0.7.orig/libdde-linux26/lib/src/kernel/timeconst.pl
+++ hurd-0.7/libdde-linux26/lib/src/kernel/timeconst.pl
@@ -369,10 +369,7 @@ if ($hz eq '--can') {
    die "Usage: $0 HZ\n";
    }
 
-   @val = @{$canned_values{$hz}};
-   if (!defined(@val)) {
-   @val = compute_values($hz);
-   }
+   @val = compute_values($hz);
    output($hz, @val);
 }
 exit 0;



Re: PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread Svante Signell
On Mon, 2016-01-04 at 22:50 +0100, Samuel Thibault wrote:
> Svante Signell, on Mon 04 Jan 2016 22:02:02 +0100, wrote:
> > -   @val = @{$canned_values{$hz}};
> > -   if (!defined(@val)) {
> > -   @val = compute_values($hz);
> > -   }
> > +   @val = compute_values($hz);
> 
> Don't we want to still try to use canned_values?

As I wrote in IRC you should solve this, not me. Obviously the !defined(@val) is
no longer allowed, and I don't know how to rewrite that condition. The
suggestion when it failed was:
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at
/.../timeconst.pl line 373.



Re: PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread Samuel Thibault
Svante Signell, on Mon 04 Jan 2016 23:09:00 +0100, wrote:
> On Mon, 2016-01-04 at 22:50 +0100, Samuel Thibault wrote:
> > Svante Signell, on Mon 04 Jan 2016 22:02:02 +0100, wrote:
> > > - @val = @{$canned_values{$hz}};
> > > - if (!defined(@val)) {
> > > - @val = compute_values($hz);
> > > - }
> > > + @val = compute_values($hz);
> > 
> > Don't we want to still try to use canned_values?
> 
> As I wrote in IRC you should solve this, not me.

Me taking the time to solve it means I have less time to solve other
issues. I already took time for the Hurd the other day to track the
difficult pfinet crash we've been having for years. I can't spend all my
free time on the Hurd.

> Obviously the !defined(@val) is
> no longer allowed, and I don't know how to rewrite that condition.

Perhaps juste !@val?
I have no idea, I don't know perl. But probably worth trying and
investigating, and I believe you can do it.

> The suggestion when it failed was:  Can't use 'defined(@array)' (Maybe
> you should just omit the defined()?) at /.../timeconst.pl line 373.

Which means omitting the call, but not the parameter.

Samuel



Re: PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread Samuel Thibault
Svante Signell, on Mon 04 Jan 2016 22:02:02 +0100, wrote:
> - @val = @{$canned_values{$hz}};
> - if (!defined(@val)) {
> - @val = compute_values($hz);
> - }
> + @val = compute_values($hz);

Don't we want to still try to use canned_values?

Samuel



Re: PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread Samuel Thibault
James Clarke, on Mon 04 Jan 2016 22:38:28 +, wrote:
> > -   if (!defined(@val)) {
> > +   if (!@val) {

Applied, thanks!

Samuel



Re: PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread Svante Signell
On Tue, 2016-01-05 at 17:36 +1100, William ML Leslie wrote:
> On 5 January 2016 at 16:56, Svante Signell  wrote:
> > BTW: Why does Hurd contain such crappy dependencies such as perl. Is this
> > part
> > of upstream or Debian specific? The Debian package does not have it:
> > apt-cache showsrc hurd | grep Build-Depends | grep -i perl
> > 
> > Is there more perl code in upstream Hurd? If not, how about rewrite this
> > code
> > snippet in C and "remove a should be added" language dependency!
> > 
> 
> It's used by a ported linux driver as part of libdde, as the path of
> the patch indicates.

Well, the source is from the Hurd package, not netdde. It's in 
hurd_0.7.orig-libdde-linux26.tar.bz2 so a build dependency on perl should be
added to the Hurd source package.



Re: PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread William ML Leslie
On 5 January 2016 at 16:56, Svante Signell  wrote:
> BTW: Why does Hurd contain such crappy dependencies such as perl. Is this part
> of upstream or Debian specific? The Debian package does not have it:
> apt-cache showsrc hurd | grep Build-Depends | grep -i perl
> 
> Is there more perl code in upstream Hurd? If not, how about rewrite this code
> snippet in C and "remove a should be added" a language dependency!
>

It's used by a ported linux driver as part of libdde, as the path of
the patch indicates.

-- 
William Leslie

Notice:
Likely much of this email is, by the nature of copyright, covered
under copyright law.  You absolutely MAY reproduce any part of it in
accordance with the copyright law of the nation you are reading this
in.  Any attempt to DENY YOU THOSE RIGHTS would be illegal without
prior contractual agreement.



Re: PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread Svante Signell
On Mon, 2016-01-04 at 22:38 +, James Clarke wrote:
> On 4 Jan 2016, at 22:13, Samuel Thibault  wrote:
> > Svante Signell, on Mon 04 Jan 2016 23:09:00 +0100, wrote:
> 
> It is indeed just !@val (this use of defined was deprecated in 5.6.1 and
> raised warnings since 5.16[1]). Here's the simplified patch (untested):
> 
> > -   if (!defined(@val)) {
> > +   if (!@val) {
> > 

Thanks James, problem solved for now.

BTW: Why does Hurd contain such crappy dependencies such as perl. Is this part
of upstream or Debian specific? The Debian package does not have it:
apt-cache showsrc hurd | grep Build-Depends | grep -i perl

Is there more perl code in upstream Hurd? If not, how about rewrite this code
snippet in C and "remove a should be added" a language dependency!



Re: PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread James Clarke
On 4 Jan 2016, at 22:13, Samuel Thibault  wrote:
> Svante Signell, on Mon 04 Jan 2016 23:09:00 +0100, wrote:
>> Obviously the !defined(@val) is
>> no longer allowed, and I don't know how to rewrite that condition.
> 
> Perhaps juste !@val?
> I have no idea, I don't know perl. But probably worth trying and
> investigating, and I believe you can do it.

It is indeed just !@val (this use of defined was deprecated in 5.6.1 and raised 
warnings since 5.16[1]). Here's the simplified patch (untested):

> Index: hurd-0.7/libdde-linux26/lib/src/kernel/timeconst.pl
> ===
> --- hurd-0.7.orig/libdde-linux26/lib/src/kernel/timeconst.pl
> +++ hurd-0.7/libdde-linux26/lib/src/kernel/timeconst.pl
> @@ -369,10 +369,10 @@ if ($hz eq '--can') {
>   die "Usage: $0 HZ\n";
>   }
> 
>   @val = @{$canned_values{$hz}};
> - if (!defined(@val)) {
> + if (!@val) {
>   @val = compute_values($hz);
>   }
>   output($hz, @val);
>  }
>  exit 0;


James

[1] 
https://metacpan.org/pod/release/RJBS/perl-5.22.0/pod/perldelta.pod#defined-array-and-defined-hash-are-now-fatal-errors



signature.asc
Description: Message signed with OpenPGP using GPGMail