Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Aug 2003 05:31:52 +0200
From:      Clement Laforet <sheepkiller@cultdeadsheep.org>
To:        Clement Laforet <sheepkiller@cultdeadsheep.org>
Cc:        ports@FreeBSD.org
Subject:   Re: possible missing entries in CVSROOT-ports/modules
Message-ID:  <20030812053152.224e15fe.sheepkiller@cultdeadsheep.org>
In-Reply-To: <20030812001651.5ea59ce8.sheepkiller@cultdeadsheep.org>
References:  <20030812001651.5ea59ce8.sheepkiller@cultdeadsheep.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I wrote a little script to find missing and orphaned entries in 
CVSROOT-ports/modules with simplistic error type detection.

This is the last full report (I won't spam this list anymore ;)).
The script is below :)

Kris, maybe you can and some of these simple lines to your index checker.

Regards,

clem

--------
Missing entries in CVSROOT-port/modules:
ports/databases/p5-DBIx-SQLEngine
ports/devel/libexecinfo
ports/devel/libidn
ports/devel/mpatrol
ports/emulators/linux_base-8
ports/games/lgeneral-data
ports/graphics/gqview-devel
ports/java/jakarta-struts
ports/java/simplicity
ports/lang/python22
ports/mail/aileron
ports/mail/smtpmail
ports/math/fbm
ports/net/prtunnel
ports/net/uplog
ports/news/noffle
ports/security/hostsentry
ports/security/hydra
ports/security/libwhisker
ports/security/nikto
ports/sysutils/jdiskreport
ports/sysutils/linuxfdisk
ports/www/axis
ports/www/caudium12
ports/www/cybercalendar
ports/www/linux-mozillafirebird
ports/www/mod_log_sql
ports/www/p5-CGI-Untaint
ports/www/php5-cgi


Orphaned entries in CVSROOT-port/modules:
Orphaned entry:    p5-DBIx-SQLEngine ports/databaes/p5-DBIx-SQLEngine
Orphaned entry:    ko-netdic ports/korean/netdic
Misfiled Makefile: gcc34  ports/lang/gcc34
Orphaned entry:    php5-cgi ports/lang/php5-cgi
Misfiled Makefile: chemtool-devel ports/science/chemtool-devel
Orphaned entry:    krb5-beta ports/security/krb5-beta
Misfiled Makefile: djvuplugin ports/www/djvuplugin
Orphaned entry:    linux-phoenix ports/www/linux-phoenix
Orphaned entry:    mod_log_mysql ports/www/mod_log_mysql
Orphaned entry:    mod_webapp-apache2 ports/www/mod_webapp-apache2
Misfiled Makefile: XFree86-4-Server-snap   ports/x11-servers/XFree86-4-Server-snap


-------------------------
#!/bin/sh
#
# Quick sanity check for CVSROOT-ports/modules
#
# Usage:  
#	./check-module
# if you want to generate INDEX within check-module
#	GEN_INDEX=1 ./check-module

# your cvs root
#CVS=/home/ncvs
CVS=/WORK/CVS

# your port dir
#BASE=/usr/
BASE=/WORK/FreeBSD
#a cvsup'ed ports tree is useful for error detection
#CVSUPED_BASE=${BASE}
CVSUPED_BASE=/usr
#index name
#INDEX=INDEX
INDEX=INDEX-5

# Theorically you have nothing to change from now
PORTSDIR=${BASE}/ports
TMP_MODULES=`mktemp -t modules.sorted`
TMP_PORTS=`mktemp -t ports.sorted`
TMP_DIFF_MISSING=`mktemp -t diff-missing`
TMP_DIFF_ORPHAN=`mktemp -t diff-orphan`
MODULES_FILE=${CVS}/CVSROOT-ports/modules
UPTODATE_INDEX=${PORTSDIR}/${INDEX}

#
# We generate INDEX file.
#
[ $GEN_INDEX ] && (
 cd ${BASE} 
 cvs -d ${CVS} update . 2> /dev/null
 cd ${PORTSDIR}
 make index)

#
# Get known ports from CVSROOT-ports/modules
awk '$2 ~ /ports\/[a-z].*\/[a-zA-Z0-9].*/ {print  $2};' \
			${MODULES_FILE} | sort -n > ${TMP_MODULES}
#
# Get known ports from INDEX
awk -F\| '$2 ~ /usr\/ports\/[a-z].*\/.*/ { sub("/usr/","",$2); print $2 };' \
			${UPTODATE_INDEX} | sort -n > ${TMP_PORTS}

# missing ports in CVSROOT-ports/modules
diff -Nru ${TMP_MODULES} ${TMP_PORTS} | egrep '^\+ports' | sed 's/^+\(.*\)/\1/' > ${TMP_DIFF_MISSING}

# ports who appear ONLY in CVSROOT-ports/modules
diff -Nru ${TMP_MODULES} ${TMP_PORTS} | egrep '^\-ports' | sed 's/^-\(.*\)/\1/' > ${TMP_DIFF_ORPHAN}

# And now the report

echo -e "\n"
echo "Missing entries in CVSROOT-port/modules:"
for ports in $(cat ${TMP_DIFF_MISSING})
do 
	grep ${ports} ${MODULES_FILE} > /dev/null || echo ${ports}
done

echo -e "\n"
echo -e "Orphaned entries in CVSROOT-port/modules:"

for ports in $(cat ${TMP_DIFF_ORPHAN})
do 
	grep ${ports} ${UPTODATE_INDEX} > /dev/null 
	RETVAL=$?
	if [ "$RETVAL" -ne "0" ]
	then
		if [ -d ${CVSUPED_BASE}/${ports} ]
			then
				echo -n "Misfiled Makefile: "
			else
				echo -n "Orphaned entry:    "
		fi
		grep ${ports} ${MODULES_FILE} | tr "\t" " "
	fi	

done

# Cleanup
#rm -f ${TMP_MODULES} ${TMP_PORTS} ${TMP_DIFF_MISSING} ${TMP_DIFF_ORPHAN}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030812053152.224e15fe.sheepkiller>