#!/bin/sh # #-*- mode: Fundamental; tab-width: 4; -*- # ex:ts=4 # # Copyright (c) 2006 FreeBSD GNOME Team # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $MCom: portstools/cports.sh,v 1.4 2006/06/12 16:15:44 mezz Exp $ # ### BEGIN changeable variables log=~/check_prefix.log #---- # Anything below shouldn't be edit unless you know what you are doing. #---- scriptname=`basename $0` ### END of changeable variables ### Command line options usage_exit () { echo echo "Usage: ${scriptname} [-l ]" | /usr/bin/fmt 75 75 exit 15 } args=`getopt l: $*` if [ $? -ne 0 ]; then usage_exit fi set -- $args for i; do case "$i" in -l) log="$2"; shift; shift;; --) shift; break;; esac done ### END of command line options ### Start the real actions if [ -f ${log} ]; then rm -f ${log} fi for blah in `find /usr/ports -maxdepth 3 -name Makefile | \ sed -e 's|/Makefile||g'`; do cd ${blah}; PREFIX=`make -V PREFIX` USE_X_PREFIX=`make -V USE_X_PREFIX` gnomeprefix=`make -V USE_GNOME | grep gnomeprefix` center="" if [ ! -z "${gnomeprefix}" ]; then if [ "$onoff" = "yes" ]; then rcolour="" unset onoff else rcolour="" export onoff=yes fi if [ "${PREFIX}" = "/usr/local" ]; then pcolour="" else pcolour="" fi if [ "${USE_X_PREFIX}" = "yes" ]; then xprefix="{X}" else xprefix="" fi if grep -Eq "X11BASE" ${blah}/* ${blah}/files/* 2>/dev/null; then x11base="{X}" else x11base="" fi echo "||${rcolour} ${blah} ||${pcolour} ${PREFIX} ||${center} ${xprefix} ||${center} ${x11base} ||" >> ${log} fi done ### End of the real actions