From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Nov 21 17:50:17 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B24716A421 for ; Mon, 21 Nov 2005 17:50:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C26A43D45 for ; Mon, 21 Nov 2005 17:50:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jALHoFRv055620 for ; Mon, 21 Nov 2005 17:50:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jALHoFg6055619; Mon, 21 Nov 2005 17:50:15 GMT (envelope-from gnats) Resent-Date: Mon, 21 Nov 2005 17:50:15 GMT Resent-Message-Id: <200511211750.jALHoFg6055619@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, onatan@gmail.com Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4A4416A41F for ; Mon, 21 Nov 2005 17:49:07 +0000 (GMT) (envelope-from afarsec@012.net.il) Received: from mtaout2.012.net.il (mtaout2.012.net.il [84.95.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FAE743D49 for ; Mon, 21 Nov 2005 17:49:06 +0000 (GMT) (envelope-from afarsec@012.net.il) Received: from afarsec.com ([80.178.148.201]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with SMTP id <0IQB00E1FG7063G0@i_mtaout2.012.net.il> for FreeBSD-gnats-submit@freebsd.org; Mon, 21 Nov 2005 19:49:48 +0200 (IST) Received: by afarsec.com (sSMTP sendmail emulation); Mon, 21 Nov 2005 19:40:09 +0200 Message-Id: <0IQB00E1GG7063G0@i_mtaout2.012.net.il> Date: Mon, 21 Nov 2005 19:40:09 +0200 From: Jonathan To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/89385: Utility: A tool to identify similar pkg-descr files X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: onatan@gmail.com List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2005 17:50:17 -0000 >Number: 89385 >Category: ports >Synopsis: Utility: A tool to identify similar pkg-descr files >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Nov 21 17:50:15 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Jonathan >Release: FreeBSD 6.0-BETA4 i386 >Organization: Mmmmm, yeah >Environment: System: FreeBSD though.they.go 6.0-BETA4 FreeBSD 6.0-BETA4 #4: Fri Sep 9 00:07:43 IDT 2005 root@they.shall.be:/usr/obj/usr/src/sys/GENERIC i386 >Description: The ports tree contains many tools with almost-similar names and no helpful pkg-descr difference. The goal of pkg-descr would be to aid the user in his choice of port version. Ergo, similar pkg-descr files are bad. >How-To-Repeat: Observe, for example, security/gpgme/pkg-descr and security/gpgme03/pkg-descr and ponder which is the right one for you. >Fix: Add this to the automatic reviews. Auto-bug porters till blissful feeling settles. Depends on bash. --- badpd.sh begins here --- #!/usr/local/bin/bash # This script is licences as "public domain", for any given public, # of any type of domain. # onatan@gmail.com usage(){ echo "$0 [/usr/ports]" echo reports all duplicate pkg-descr files. exit 1 } DIR="/usr/ports" [ -z "$1" ] || DIR=$1; [ -d $DIR ] || usage # Phase 1: find pkg-descr files, md5 them, sort them in an array ARR=(`find $DIR -name pkg-descr -exec md5 -r {} \; 2>/dev/null | sort`) # Phase 2: Match md5s, report if equal. A=0 while [ $A -lt ${#ARR[@]} ]; do if [ "${ARR[$A]}" == "${ARR[$A+2]}" ]; then echo ${ARR[$A+1]} == ${ARR[$A+3]} fi A=`expr $A + 2` done --- badpd.sh ends here --- >Release-Note: >Audit-Trail: >Unformatted: