From owner-man-jp@jp.freebsd.org  Wed Jun 16 22:13:59 1999
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id WAA10355;
	Wed, 16 Jun 1999 22:13:59 +0900 (JST)
	(envelope-from owner-man-jp@jp.FreeBSD.org)
Received: from april.on.rim.or.jp (root@april.on.rim.or.jp [202.247.131.85])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id WAA10350
	for <man-jp@jp.freebsd.org>; Wed, 16 Jun 1999 22:13:58 +0900 (JST)
	(envelope-from ryo2@on.rim.or.jp)
Received: from quill.on.rim.or.jp (pl058.nas112.nagaoka.nttpc.ne.jp [210.165.143.58])
	by april.on.rim.or.jp (8.8.8/3.6W-RIMNET-98-06-09) with ESMTP id WAA29660
	for <man-jp@jp.freebsd.org>; Wed, 16 Jun 1999 22:13:57 +0900 (JST)
Message-Id: <199906161313.WAA29660@april.on.rim.or.jp>
Received: from localhost by quill.on.rim.or.jp (8.8.8/3.5Wpl5-97111919)
	id WAA00669; Wed, 16 Jun 1999 22:05:03 +0900 (JST)
To: man-jp@jp.freebsd.org
From: Yoshishige ARAI <ryo2@on.rim.or.jp>
In-Reply-To: Your message of "Mon, 07 Jun 1999 02:27:34 +0900"
	<19990607022734F.k-horik@yk.rim.or.jp>
References: <19990607022734F.k-horik@yk.rim.or.jp>
X-Mailer: Mew version 1.93 on XEmacs 20.4 (Emerald)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
	boundary="--Next_Part(Wed_Jun_16_22:04:50_1999_518)--"
Content-Transfer-Encoding: 7bit
Date: Wed, 16 Jun 1999 22:05:03 +0900 (JST)
X-Dispatcher: imput version 990425(IM115)
Lines: 137
Reply-To: man-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990610
X-Sequence: man-jp 1571
Subject: [man-jp 1571] Re: (demi) syncstat.pl
Errors-To: owner-man-jp@jp.freebsd.org
Sender: owner-man-jp@jp.freebsd.org
X-Originator: ryo2@on.rim.or.jp

----Next_Part(Wed_Jun_16_22:04:50_1999_518)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

$B$"$i$$$G$9!#(B

On Mon, 07 Jun 1999 02:27:34 +0900 ([man-jp 1564] (demi) syncstat.pl)
Kazuo Horikawa <k-horik@yk.rim.or.jp> wrote:

$BKY@n(B>  doc-jp $B$N(B syncstat $B$K?(H/$5$l$F!"86J8$HLuJ8$N%j%S%8%g%s$rI=<($9$k$?$a(B
$BKY@n(B> $B$N(B perl script $B$r;n:n$7$F$_$^$7$?!#(B

$B$46lO+$5$^$G$9!#(B

On Mon, 07 Jun 1999 02:27:34 +0900 ([man-jp 1564] (demi) syncstat.pl)
Kazuo Horikawa <k-horik@yk.rim.or.jp> wrote:

$BKY@n(B>  o $B8!::%U%!%$%k0lMw(B (list.txt) $B$D$/$k$N$,<j4V$J$N$G(B (src $B$+$i86J8$rC5(B
$BKY@n(B>    $B$9$N$,$A$g$C$HLLE](B)$B!"=q$$$F$b$i$($k$H$&$l$7$$!#(B

$BLLE]$J$s$G!"8!::%U%!%$%k0lMw$r:n$k%9%/%j%W%H$r=q$$$F$7$^$&$+!"$=$NItJ,(B
$B$r(B syncstat.pl $B$KAH$_9~$s$G$7$^$C$F$bNI$$$+$b$7$l$^$;$s$M!#(B
$B$H;W$C$F!"(B
doc/ja/man/man1/sh.1		src/bin/sh/sh.1
doc/ja/man/man8/boot_i386.8	src/sbin/reboot/boot_i386.8
  :
$B$N$h$&$J(B list.txt $B$r:n@.$9$kJd=u%9%/%j%W%H$r:n$C$F$_$^$7$?!#(B

$B;H$$J}$O!"(B
  % cd /usr
  % mklist /usr/doc/ja/man /usr/src > list.txt

$B$b$7!"Bh0l0z?t$NJ}$,(B doc/ja/man/man1/sh.1.gz $B$N$h$&$K(B gzip$B$5$l$F$*$j!"(B
/usr/src $B$NJ}$,(B gzip $B$5$l$F$$$J$$>l9g$O!"(B
  % mklist -g /usr/doc/ja/man /usr/src > list.txt
$B$G$9!#(B

doc/ja/man/man1/sh.1
doc/ja/man/man8/boot_i386.8
$B$N$h$&$J%U%!%$%k$N%j%9%H$,(B doc_list.txt $B$H$7$FJ]B8$7$F$"$k>l9g$O!"(B
  % mklist doc_list.txt /usr/src > list.txt

$BF1$8$/(B src $BB&$,(B src_list.txt $B$H$7$FJ]B8$7$F$"$l$P!"(B
  % mklist doc_list.txt src_list.txt > list.txt

$B$b$G$-$^$9!#(B
--------
$B9S0fNI=E(B(Yoshishige Arai)
ryo2@on.rim.or.jp


----Next_Part(Wed_Jun_16_22:04:50_1999_518)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Description: mklist.pl
Content-Disposition: attachment; filename=mklist.pl

#! /usr/local/bin/perl
# $Id: mklist.pl,v 1.1 1999/06/16 13:04:04 ryo2 Exp ryo2 $

if ($#ARGV == -1) {
  warn "usage: mklist\n\t(1) mklist DOC_DIR  SRC_DIR\n".
    "\t(2) mklist DOC_LIST SRC_LIST\n";
  exit(0);
}

$destpath = shift;
if ($destpath eq '-g') {
  $opt_g = 1;
  $destpath = shift;
}
$srcpath = shift;

if (-f $destpath) {
  %DOC = &read_filelist($destpath);
} else {
  if ($opt_g) {
    print STDERR "--- executing\n  find $destpath -path '$destpath/man*' -name '*.[1-9n].gz'\n";
    $buf = `find $destpath -path '$destpath/man*' -name \*.[1-9n].gz`;
    $buf =~ s/\.gz//g;
  } else {
    print STDERR "--- executing\n  find $destpath -path '$destpath/man*' -name '*.[1-9n]''\n";
    $buf = `find $destpath -path '$destpath/man*' -name \*.[1-9n]`;
  }
  %DOC = &read_buf($buf);
  @tmp = keys %DOC; print STDERR "=== $#tmp manuals were found in $destpath\n";
}

if (-f $srcpath) {
  %SRC = &read_filelist($srcpath);
} else {
  print STDERR "--- executing find $srcpath -name '*.[1-9n]'\n";
  $buf = `find $srcpath -name \*.[1-9n]`;
  %SRC = &read_buf($buf);
  @tmp = keys %SRC; print STDERR "=== $#tmp manuals were found in $srcpath\n";
}

foreach (sort ByDOC keys %DOC) {
  if (defined($SRC{$_})) {
    print "$DOC{$_}\t$SRC{$_}\n";
  } else {
    warn "WARNING: $find_result doesn't have $_\n";
  }
}
exit(0);

sub read_filelist {
  local($file) = @_;
  local(%assoc);
  open(F, $file) || die "cannot open \"$file\".";
  while (<F>) {
    chop;
    ($man) = (/([^\/]+)$/);
    $assoc{$man} = $_;
  }
  close(F);
  %assoc;
}

sub read_buf {
  local($tmp) = @_;
  local(%assoc, @work) = ();
  @work = split(/\n+/,$tmp);
  foreach (@work) {
    ($man) = (/([^\/]+)$/);
    $assoc{$man} = $_;
  }
  %assoc;
}

sub ByDOC {
    $an = $DOC{$a};
    $bn = $DOC{$b};
    $an cmp $bn;
}

----Next_Part(Wed_Jun_16_22:04:50_1999_518)----
