Date: Mon, 21 Nov 2005 19:40:09 +0200 From: Jonathan <afarsec@012.net.il> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/89385: Utility: A tool to identify similar pkg-descr files Message-ID: <0IQB00E1GG7063G0@i_mtaout2.012.net.il> Resent-Message-ID: <200511211750.jALHoFg6055619@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0IQB00E1GG7063G0>