- allow specifying archs to process on command line
- align change message - Most Important: read RCS Id from existing file and write it into the newly generated file. That way, no update is announced when nothing was changed. (Before, the RCS ID was reset to "$NetBSD$" which lead to a changed file, but nothing of interrest changed)
This commit is contained in:
parent
1f45477db9
commit
b1c5b7e2c5
|
@ -1,6 +1,6 @@
|
|||
#!/usr/pkg/bin/perl
|
||||
#
|
||||
# $NetBSD: MAKEDEV2manpage.pl,v 1.1 1999/09/18 00:15:13 hubertf Exp $
|
||||
# $NetBSD: MAKEDEV2manpage.pl,v 1.2 1999/10/11 01:41:10 hubertf Exp $
|
||||
#
|
||||
# Copyright (c) 1999
|
||||
# Hubert Feyrer <hubert@feyrer.de>. All rights reserved.
|
||||
|
@ -178,6 +178,16 @@ sub doarch
|
|||
|
||||
rename("man8.${arch}/MAKEDEV.8", "man8.${arch}/MAKEDEV.8.old");
|
||||
|
||||
# find out current RCS ID
|
||||
$RCSID="\$NetBSD\$";
|
||||
open(OLD, "man8.${arch}/MAKEDEV.8.old") or die;
|
||||
while(<OLD>) {
|
||||
if (/(\$NetBSD.*\$)/) {
|
||||
$RCSID = "$1";
|
||||
}
|
||||
}
|
||||
close(OLD);
|
||||
|
||||
open(MANPAGE, ">man8.${arch}/MAKEDEV.8") or die;
|
||||
print MANPAGE ".\\\" *** ------------------------------------------------------------------\n";
|
||||
print MANPAGE ".\\\" *** This file was generated automatically\n";
|
||||
|
@ -199,6 +209,11 @@ sub doarch
|
|||
} elsif (/^\@\@\@DEVICES\@\@\@$/) {
|
||||
do_devices();
|
||||
}
|
||||
} elsif (/(\$NetBSD.*\$)/) {
|
||||
$id=$1;
|
||||
$id=~s/\$/\\\$/g;
|
||||
s/$id/$RCSID/;
|
||||
print MANPAGE "$_";
|
||||
} else {
|
||||
print MANPAGE "$_";
|
||||
}
|
||||
|
@ -228,19 +243,25 @@ chomp($pwd=`pwd`);
|
|||
die "Run this in .../src/share/man/man8 !\n"
|
||||
if ($pwd !~ m:share/man/man8: );
|
||||
|
||||
# Determine available archs by looking for man8.*
|
||||
opendir(D, ".") || die;
|
||||
while ($d=readdir(D)) {
|
||||
if ($#ARGV >= 0) {
|
||||
@archs = @ARGV;
|
||||
|
||||
} else {
|
||||
|
||||
# Determine available archs by looking for man8.*
|
||||
opendir(D, ".") || die;
|
||||
while ($d=readdir(D)) {
|
||||
if ($d =~ /man8\.(.*)$/) {
|
||||
push(@archs, $1);
|
||||
}
|
||||
}
|
||||
closedir(d);
|
||||
}
|
||||
closedir(d);
|
||||
|
||||
#DEBUG ONLY# @archs=("alpha");
|
||||
|
||||
# Handle each arch's manpage
|
||||
foreach $arch ( sort @archs ) {
|
||||
$rc = doarch($arch);
|
||||
print "$arch:\t $rc\n";
|
||||
printf("%-20s $rc\n", "$arch:");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue