#!/bin/bash
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
# $Id: XXXreport 26446 2004-07-13 16:11:36Z philikon $

# This script assumes it is located in the utilities directory of Zope3


PYTHON=`which python2.3`

PATTERN='# ?(XXX|TODO)'
TMPFILE=`mktemp` 
TARGET=${1:-XXXreport.html}
ZOPEBASE=`dirname $0`/../
BASE=`dirname $0`

# find also finds hidden files
rm $TARGET
find $ZOPEBASE -! -name "*.pyc" -print0  | \
    xargs -0 grep -niIs -A 3 -E "$PATTERN" | \
    $PYTHON $BASE/XXXreport2html.py /dev/stdin $TARGET >/dev/null
    
rm -f $TMPFILE

