- 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:
hubertf 1999-10-11 01:41:10 +00:00
parent 1f45477db9
commit b1c5b7e2c5
1 changed files with 29 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#!/usr/pkg/bin/perl #!/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 # Copyright (c) 1999
# Hubert Feyrer <hubert@feyrer.de>. All rights reserved. # Hubert Feyrer <hubert@feyrer.de>. All rights reserved.
@ -178,6 +178,16 @@ sub doarch
rename("man8.${arch}/MAKEDEV.8", "man8.${arch}/MAKEDEV.8.old"); 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; open(MANPAGE, ">man8.${arch}/MAKEDEV.8") or die;
print MANPAGE ".\\\" *** ------------------------------------------------------------------\n"; print MANPAGE ".\\\" *** ------------------------------------------------------------------\n";
print MANPAGE ".\\\" *** This file was generated automatically\n"; print MANPAGE ".\\\" *** This file was generated automatically\n";
@ -199,6 +209,11 @@ sub doarch
} elsif (/^\@\@\@DEVICES\@\@\@$/) { } elsif (/^\@\@\@DEVICES\@\@\@$/) {
do_devices(); do_devices();
} }
} elsif (/(\$NetBSD.*\$)/) {
$id=$1;
$id=~s/\$/\\\$/g;
s/$id/$RCSID/;
print MANPAGE "$_";
} else { } else {
print MANPAGE "$_"; print MANPAGE "$_";
} }
@ -228,19 +243,25 @@ chomp($pwd=`pwd`);
die "Run this in .../src/share/man/man8 !\n" die "Run this in .../src/share/man/man8 !\n"
if ($pwd !~ m:share/man/man8: ); if ($pwd !~ m:share/man/man8: );
# Determine available archs by looking for man8.* if ($#ARGV >= 0) {
opendir(D, ".") || die; @archs = @ARGV;
while ($d=readdir(D)) {
if ($d =~ /man8\.(.*)$/) { } else {
push(@archs, $1);
# 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"); #DEBUG ONLY# @archs=("alpha");
# Handle each arch's manpage # Handle each arch's manpage
foreach $arch ( sort @archs ) { foreach $arch ( sort @archs ) {
$rc = doarch($arch); $rc = doarch($arch);
print "$arch:\t $rc\n"; printf("%-20s $rc\n", "$arch:");
} }