annotate sources/patches/linux-noperl-headers.patch @ 1584:75e291fafacc

linux 3.8.
author Rob Landley <rob@landley.net>
date Mon, 25 Feb 2013 11:45:44 -0600
parents bee6b26a006d
children 3cbf1abde44a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 Subject: [PATCH] Replace scripts/headers_install.pl with a shell script.
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
1415
9fcb35fbdbd7 Linux kernel 3.0.
Rob Landley <rob@landley.net>
parents: 1337
diff changeset
3 From: Rob Landley <rob@landley.net>
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 Remove perl from make headers_install by replacing a perl script (doing
1463
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
6 a simple regex search and replace) with a smaller, faster, simpler,
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
7 POSIX-2008 shell script implementation. The new shell script is a single
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
8 for loop calling sed and piping its output through unifdef to produce the
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
9 target file.
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
10
1463
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
11 Previous submission: Tuesday Jan 18, 2011
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
12 Message-ID: <4D359E5C.1070002@parallels.com>
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
13
1463
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
14 Signed-off-by: Rob Landley <rob@landley.net>
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 ---
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
16
1463
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
17 scripts/Makefile.headersinst | 6 +--
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
18 scripts/headers_install.pl | 58 ---------------------------------
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
19 scripts/headers_install.sh | 43 ++++++++++++++++++++++++
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
20 3 files changed, 46 insertions(+), 61 deletions(-)
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
21
1463
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
22 diff -ruN linux-3.1/scripts/headers_install.sh linux-2.6.30/scripts/headers_install.sh
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
23 --- linux-3.1/scripts/headers_install.sh
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
24 +++ linux/scripts/headers_install.sh
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
25 @@ -0,0 +1,43 @@
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 +#!/bin/sh
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
27 +
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
28 +if [ $# -lt 1 ]
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
29 +then
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
30 + echo "Usage: headers_install.sh OUTDIR [FILES...]
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
31 + echo
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
32 + echo "Prepares kernel header files for use by user space, by removing"
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
33 + echo "all compiler.h definitions and #includes, removing any"
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
34 + echo "#ifdef __KERNEL__ sections, and putting __underscores__ around"
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
35 + echo "asm/inline/volatile keywords."
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
36 + echo
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
37 + echo "OUTDIR: directory to write each userspace header FILE to."
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
38 + echo "FILES: list of header files to operate on."
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
39 +
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
40 + exit 1
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
41 +fi
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
42 +
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
43 +# Grab arguments
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
44 +
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
45 +OUTDIR="$1"
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
46 +shift
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
47 +
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
48 +# Iterate through files listed on command line
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
49 +
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
50 +FILE=
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
51 +trap 'rm -f "$OUTDIR/$FILE" "$OUTDIR/$FILE.sed"' EXIT
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
52 +for i in "$@"
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
53 +do
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
54 + FILE="$(basename "$i")"
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
55 + sed -r \
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
56 + -e 's/([ \t(])(__user|__force|__iomem)[ \t]/\1/g' \
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
57 + -e 's/__attribute_const__([ \t]|$)/\1/g' \
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
58 + -e 's@^#include <linux/compiler.h>@@' \
1463
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
59 + -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
60 + -e 's/(^|[ \t])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \
1584
75e291fafacc linux 3.8.
Rob Landley <rob@landley.net>
parents: 1570
diff changeset
61 + -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
62 + "$i" > "$OUTDIR/$FILE.sed" || exit 1
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
63 + scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
64 + > "$OUTDIR/$FILE"
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
65 + [ $? -gt 1 ] && exit 1
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
66 + rm -f "$OUTDIR/$FILE.sed"
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
67 +done
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
68 +trap - EXIT
1463
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
69 diff -ruN linux-3.1/scripts/Makefile.headersinst
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
70 --- linux-3.1/scripts/Makefile.headersinst
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
71 +++ linux/scripts/Makefile.headersinst
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
72 @@ -55,7 +55,7 @@
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
73 quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
74 file$(if $(word 2, $(all-files)),s))
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
75 cmd_install = \
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
76 - $(PERL) $< $(installdir) $(SRCARCH) $(input-files); \
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
77 + $(CONFIG_SHELL) $< $(installdir) $(input-files); \
1415
9fcb35fbdbd7 Linux kernel 3.0.
Rob Landley <rob@landley.net>
parents: 1337
diff changeset
78 for F in $(wrapper-files); do \
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
79 echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \
1415
9fcb35fbdbd7 Linux kernel 3.0.
Rob Landley <rob@landley.net>
parents: 1337
diff changeset
80 done; \
1508
9f8fb7a20166 Linux 3.3.
Rob Landley <rob@landley.net>
parents: 1463
diff changeset
81 @@ -83,7 +83,7 @@
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
82 @:
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
83
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
84 targets += $(install-file)
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
85 -$(install-file): scripts/headers_install.pl $(input-files) FORCE
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
86 +$(install-file): scripts/headers_install.sh $(input-files) FORCE
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
87 $(if $(unwanted),$(call cmd,remove),)
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
88 $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
89 $(call if_changed,install)
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
90 --- a/scripts/headers_install.pl
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
91 +++ /dev/null
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
92 @@ -1,63 +0,0 @@
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
93 -#!/usr/bin/perl -w
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
94 -#
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
95 -# headers_install prepare the listed header files for use in
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
96 -# user space and copy the files to their destination.
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
97 -#
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
98 -# Usage: headers_install.pl readdir installdir arch [files...]
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
99 -# installdir: dir to install the files to
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
100 -# arch: current architecture
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
101 -# arch is used to force a reinstallation when the arch
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
102 -# changes because kbuild then detect a command line change.
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
103 -# files: list of files to check
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
104 -#
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
105 -# Step in preparation for users space:
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
106 -# 1) Drop all use of compiler.h definitions
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
107 -# 2) Drop include of compiler.h
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
108 -# 3) Drop all sections defined out by __KERNEL__ (using unifdef)
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
109 -
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
110 -use strict;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
111 -
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
112 -my ($installdir, $arch, @files) = @ARGV;
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
113 -
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
114 -my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__";
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
115 -
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
116 -foreach my $filename (@files) {
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
117 - my $file = $filename;
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
118 - $file =~ s!^.*/!!;
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
119 -
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
120 - my $tmpfile = "$installdir/$file.tmp";
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
121 -
1570
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
122 - open(my $in, '<', $filename)
bee6b26a006d Linux 3.7.
Rob Landley <rob@landley.net>
parents: 1508
diff changeset
123 - or die "$filename: $!\n";
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
124 - open(my $out, '>', $tmpfile)
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
125 - or die "$tmpfile: $!\n";
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
126 - while (my $line = <$in>) {
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
127 - $line =~ s/([\s(])__user\s/$1/g;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
128 - $line =~ s/([\s(])__force\s/$1/g;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
129 - $line =~ s/([\s(])__iomem\s/$1/g;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
130 - $line =~ s/\s__attribute_const__\s/ /g;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
131 - $line =~ s/\s__attribute_const__$//g;
1463
b499073fe1b2 Update to 3.1 kernel.
Rob Landley <rob@landley.net>
parents: 1415
diff changeset
132 - $line =~ s/\b__packed\b/__attribute__((packed))/g;
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
133 - $line =~ s/^#include <linux\/compiler.h>//;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
134 - $line =~ s/(^|\s)(inline)\b/$1__$2__/g;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
135 - $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
136 - $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
1584
75e291fafacc linux 3.8.
Rob Landley <rob@landley.net>
parents: 1570
diff changeset
137 - $line =~ s/#ifndef\s+_UAPI/#ifndef /;
75e291fafacc linux 3.8.
Rob Landley <rob@landley.net>
parents: 1570
diff changeset
138 - $line =~ s/#define\s+_UAPI/#define /;
75e291fafacc linux 3.8.
Rob Landley <rob@landley.net>
parents: 1570
diff changeset
139 - $line =~ s!#endif\s+/[*]\s*_UAPI!#endif /* !;
1337
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
140 - printf {$out} "%s", $line;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
141 - }
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
142 - close $out;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
143 - close $in;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
144 -
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
145 - system $unifdef . " $tmpfile > $installdir/$file";
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
146 - # unifdef will exit 0 on success, and will exit 1 when the
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
147 - # file was processed successfully but no changes were made,
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
148 - # so abort only when it's higher than that.
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
149 - my $e = $? >> 8;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
150 - if ($e > 1) {
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
151 - die "$tmpfile: $!\n";
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
152 - }
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
153 - unlink $tmpfile;
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
154 -}
1bc0c01950ca Switch to the noperl patches for 2.6.38.
Rob Landley <rob@landley.net>
parents:
diff changeset
155 -exit 0;