Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jan 2005 09:53:12 +0100
From:      "R.Brouwer" <fbsd@corine-robert.nl>
To:        ports@FreeBSD.org
Subject:   Fix for port-Makefiles
Message-ID:  <41E636F8.5020806@corine-robert.nl>

next in thread | raw e-mail | index | archive | help
Dear ,

I regularly receive the error "warning: String comparison operator 
should be either == or !=" when I rebuild the ports-index.
Or the error: Malformed conditional ((${OSVERSION} < 503001 && 
${OSVERSION} >= 500000) || (${OSVERSION} < 492000))

To prevent these errors I correct all errounious information in port 
Makefiles with the following script:
======== fix_makefiles.sh ====
#!/usr/local/bin/bash
FILES=`find /usr/ports/ -name Makefile* -exec egrep -l " [0-9]+[)]"  {} \;`
for i in ${FILES}
do
    # Process all files with an number and connected )
    mv $i $i.old
    # Add a space after the number
    if [ -f $i.old ] ; then
        sed -E "s/( [0-9]+)[)]/\\1 )/g" <$i.old >$i
    fi
done
==========================

This script is placed in the daily cron line as follows:
/usr/local/bin/cvsup -g -L 2 /usr/local/etc/ports-supfile -l 
/var/run/ports-update.lock >/var/log/ports-update.log ; 
/usr/local/bin/fix_makefiles.sh; /usr/local/sbin/portsdb -Uu

I don't know if it is useful to have this functionallity somewhere in 
the freebsd software. For me this works just fine.

Kind regards,
  Robert Brouwer



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41E636F8.5020806>