LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* headers_install broken on early versions of perl
@ 2008-10-17 3:36 Jeremy Huntwork
2008-10-17 4:13 ` Alexander E. Patrakov
0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Huntwork @ 2008-10-17 3:36 UTC (permalink / raw)
To: linux-kernel
Hello,
This may not be a very large concern, but the new headers_install.pl
and headers_check.pl scripts do not work with versions of Perl <
5.6.0. This is largely to do with syntax changes in that version.
Previously, open() only allowed two arguments. The following patch
(against 2.6.27.1) alters the syntax to be backwards compatible with
earlier versions. It has been tested on 5.005_03, and 5.8.8.
Please CC me on any comments as I am not subscribed to this list.
Thanks,
Jeremy Huntwork
diff -Naur linux-2.6.27.1.orig/scripts/headers_check.pl linux-2.6.27.1/
scripts/headers_check.pl
--- linux-2.6.27.1.orig/scripts/headers_check.pl Wed Oct 15
19:02:53 2008
+++ linux-2.6.27.1/scripts/headers_check.pl Thu Oct 16 19:10:37 2008
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
#
# headers_check.pl execute a number of trivial consistency checks
#
@@ -17,7 +17,6 @@
# 2) TODO: check for leaked CONFIG_ symbols
use strict;
-use warnings;
my ($dir, $arch, @files) = @ARGV;
@@ -27,14 +26,15 @@
my $filename;
foreach my $file (@files) {
+ local *FH;
$filename = $file;
- open(my $fh, '<', "$filename") or die "$filename: $!\n";
+ open(FH, "<$filename") or die "$filename: $!\n";
$lineno = 0;
- while ($line = <$fh>) {
+ while ($line = <FH>) {
$lineno++;
check_include();
}
- close $fh;
+ close FH;
}
exit $ret;
diff -Naur linux-2.6.27.1.orig/scripts/headers_install.pl
linux-2.6.27.1/scripts/headers_install.pl
--- linux-2.6.27.1.orig/scripts/headers_install.pl Wed Oct 15
19:02:53 2008
+++ linux-2.6.27.1/scripts/headers_install.pl Thu Oct 16 19:10:48 2008
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
#
# headers_install prepare the listed header files for use in
# user space and copy the files to their destination.
@@ -17,28 +17,29 @@
# 3) Drop all sections defined out by __KERNEL__ (using unifdef)
use strict;
-use warnings;
my ($readdir, $installdir, $arch, @files) = @ARGV;
my $unifdef = "scripts/unifdef -U__KERNEL__";
foreach my $file (@files) {
+ local *INFILE;
+ local *OUTFILE;
my $tmpfile = "$installdir/$file.tmp";
- open(my $infile, '<', "$readdir/$file")
+ open(INFILE, "<$readdir/$file")
or die "$readdir/$file: $!\n";
- open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n";
- while (my $line = <$infile>) {
+ open(OUTFILE, ">$tmpfile") or die "$tmpfile: $!\n";
+ while (my $line = <INFILE>) {
$line =~ s/([\s(])__user\s/$1/g;
$line =~ s/([\s(])__force\s/$1/g;
$line =~ s/([\s(])__iomem\s/$1/g;
$line =~ s/\s__attribute_const__\s/ /g;
$line =~ s/\s__attribute_const__$//g;
$line =~ s/^#include <linux\/compiler.h>//;
- printf $outfile "%s", $line;
+ printf OUTFILE "%s", $line;
}
- close $outfile;
- close $infile;
+ close OUTFILE;
+ close INFILE;
system $unifdef . " $tmpfile > $installdir/$file";
unlink $tmpfile;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: headers_install broken on early versions of perl
2008-10-17 3:36 headers_install broken on early versions of perl Jeremy Huntwork
@ 2008-10-17 4:13 ` Alexander E. Patrakov
0 siblings, 0 replies; 2+ messages in thread
From: Alexander E. Patrakov @ 2008-10-17 4:13 UTC (permalink / raw)
To: Jeremy Huntwork; +Cc: linux-kernel
Jeremy Huntwork wrote:
> Hello,
>
> This may not be a very large concern, but the new headers_install.pl and
> headers_check.pl scripts do not work with versions of Perl < 5.6.0. This
> is largely to do with syntax changes in that version. Previously, open()
> only allowed two arguments. The following patch (against 2.6.27.1)
> alters the syntax to be backwards compatible with earlier versions. It
> has been tested on 5.005_03, and 5.8.8.
>
> Please CC me on any comments as I am not subscribed to this list.
>
> Thanks,
>
> Jeremy Huntwork
>
>
> diff -Naur linux-2.6.27.1.orig/scripts/headers_check.pl
> linux-2.6.27.1/scripts/headers_check.pl
> --- linux-2.6.27.1.orig/scripts/headers_check.pl Wed Oct 15
> 19:02:53 2008
> +++ linux-2.6.27.1/scripts/headers_check.pl Thu Oct 16 19:10:37 2008
There is no Signed-off-by: header in your mail, this is a formal reason
for rejection. Please read Documentation/SubmittingPatches and retry.
--
Alexander E. Patrakov
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-17 4:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-17 3:36 headers_install broken on early versions of perl Jeremy Huntwork
2008-10-17 4:13 ` Alexander E. Patrakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).