From owner-freebsd-doc@FreeBSD.ORG Sat May 3 08:48:04 2008 Return-Path: Delivered-To: doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F4441065672 for ; Sat, 3 May 2008 08:48:04 +0000 (UTC) (envelope-from pali.gabor@googlemail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id 22A408FC12 for ; Sat, 3 May 2008 08:48:03 +0000 (UTC) (envelope-from pali.gabor@googlemail.com) Received: by fg-out-1718.google.com with SMTP id 13so3561096fge.35 for ; Sat, 03 May 2008 01:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:sender; bh=zJtoMJIzyEEiy5wKEqlTjzjEznHli/h3IcKM9I7wAIc=; b=XF3wJUW+2oy4Ui6xhJSOrm/NCeoM57x/+laZqkFS14p8KgKmcoqUXFBKXPlFqVXBcaZi3x0446Qa/QMjcESa8B6DgKu2qv5DOg21K6KhneGd2VNklPV8xR6uZsaP3uD9dkvujO+3NujGUCj5Nk7fL+a7afdnvlZ1W9ZJwqm8jU8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:sender; b=i5GL0lNiDbykkcnz4iZy3LHWVCpYCqLk4s/+9691gn/CaqqdddZJjy6CCfwKmUb8vZrSEWr/KhoelFBWH1T+6lBxS/2wPhMyrdAtB1Usk+FI46GxCUSmT0ch43ukCVaGmqntM5+ybt+LZVfVZUsXtMFTbVpiJ2+D0PQCA44jmAw= Received: by 10.86.60.14 with SMTP id i14mr5938071fga.75.1209804482894; Sat, 03 May 2008 01:48:02 -0700 (PDT) Received: from ?192.168.0.1? ( [80.98.116.90]) by mx.google.com with ESMTPS id k29sm6958664fkk.7.2008.05.03.01.48.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 03 May 2008 01:48:01 -0700 (PDT) Message-ID: <481C26BC.2090701@FreeBSD.org> Date: Sat, 03 May 2008 10:47:56 +0200 From: Gabor PALI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.12 (X11/20080331) MIME-Version: 1.0 To: doc@FreeBSD.org References: <20080429225143.GA74318@dshield.infosecurityresearch.org> In-Reply-To: <20080429225143.GA74318@dshield.infosecurityresearch.org> X-Enigmail-Version: 0.95.1 Content-Type: multipart/mixed; boundary="------------050308060705000209090302" Sender: =?UTF-8?B?UMOBTEkgR8OhYm9yIErDoW5vcw==?= Cc: Subject: A Script for Translators: mfen X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2008 08:48:04 -0000 This is a multi-part message in MIME format. --------------050308060705000209090302 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I wrote a small shell script to check which files should be merged from English or to check incorrect revision references in the translations. I found it very useful in my work, so I think it should be shared with the members of the FreeBSD Documentation Project. I did not see anything like this in the repositories, but you can throw me rocks if somebody has already done this before :) I generalized and prepared it a bit and it should work for any language in the doc/www tree. The format of the output is tuned to be comfortable for generating commit messages, however this feature should be enhanced in the future. It contains a few "awk(1)ward" tricks, so your suggestions and comments are more then welcome. Best regards, -pgj --------------050308060705000209090302 Content-Type: text/plain; name="mfen" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mfen" #!/bin/sh # mfen # Compare revisions of documentation of different languages. # It is mainly used to check which files should be merged from # or have incorrent revision information. # Here is how to use this: # # $ mfen en_US.ISO8859-1 hu_HU.ISO8859-2 # Copyright 2008 The FreeBSD Hungarian Documentation Project # Created by: PALI, Gabor PATH=/bin:/usr/bin:/usr/sbin CVS_ID_TAG=FreeBSD traverse() { for j in `ls $2`; do if [ -d $2/$j ]; then traverse $1/$j $2/$j $3$j/ else TR=`grep Original\ Revision $2/$j` if [ -n "$TR" ]; then if [ -f "$1/$j" ]; then LG=`grep "[$]$CVS_ID_TAG:" $1/$j` if [ -n "$LG" ]; then FROM=`echo $TR | awk '{print substr($0, index($0, "1.") + 2, 6)}' | awk '{print $1}'` TO=`echo $LG | awk '{print substr($0, index($0, "1.") + 2, 6)}' | awk '{print $1}'` if [ $FROM -lt $TO ]; then printf "1.%-4d --> 1.%-4d %s\n" $FROM $TO $3$j elif [ $FROM -gt $TO ]; then printf "REVISION ERROR %s\n" $3$j fi fi else printf "NOT FOUND %s\n" $3$j fi fi fi done } if [ -n "$1" ] && [ -n "$2" ]; then traverse $1 $2 "" else echo USAGE: $0 "directory1" "directory2" fi --------------050308060705000209090302--