android_kernel_samsung_sm8650/scripts/split-man.pl
Lee Jones 3d5cbd4cbf Revert "Revert "tweewide: Fix most Shebang lines""
This reverts commit ab9895b78e.

From Greg's reversion:

 "Looks like some of the Android build systems do NOT have /usr/bin/env so
  revert this change until that happens.

  Specifically the following builds fail without this change reverted:
          kernel_kasan_aarch64 on aosp_kernel-common-android-mainline
          kernel_virt_kasan_aarch64 on aosp_kernel-common-android-mainline
          kernel_virt_kasan_x86_64 on aosp_kernel-common-android-mainline
          kernel_kasan_x86_64 on aosp_kernel-common-android-mainline"

'env' should not fail.  Let's have another go at applying this.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I8f56ed40e8bb24474d6c454ff6d1982c86d9adc3
2021-05-18 19:47:38 +00:00

29 lines
604 B
Perl
Executable File

#!/usr/bin/env perl
# SPDX-License-Identifier: GPL-2.0
#
# Author: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
#
# Produce manpages from kernel-doc.
# See Documentation/doc-guide/kernel-doc.rst for instructions
if ($#ARGV < 0) {
die "where do I put the results?\n";
}
mkdir $ARGV[0],0777;
$state = 0;
while (<STDIN>) {
if (/^\.TH \"[^\"]*\" 9 \"([^\"]*)\"/) {
if ($state == 1) { close OUT }
$state = 1;
$fn = "$ARGV[0]/$1.9";
print STDERR "Creating $fn\n";
open OUT, ">$fn" or die "can't open $fn: $!\n";
print OUT $_;
} elsif ($state != 0) {
print OUT $_;
}
}
close OUT;