On Dec 7, 2010, at 00:26, Adam Mercer wrote: > For checking if there are any updates to the ports I maintain I use > the following: > > port echo maintainer:ram | xargs -n 1 port livecheck > > however this returns ports that I don't maintain but the maintainer > field starts with ram, e.g. atf and perforce. How can I match ram as a > complete string? I've tried ending the match string with $ to signify > the end, but then this doesn't match any ports where there are two > maintainers, e.g. openmaintainer.
See: http://lists.macosforge.org/pipermail/macports-dev/2010-October/013131.html And: http://lists.macosforge.org/pipermail/macports-dev/2010-October/013133.html So you want: #!/bin/bash HANDLE=ram port livecheck '(' \ 'maintainer:(\W|^)'$HANDLE'(\W|$)' or \ 'maintainer:(\W|^)'$HANDLE'@macports.org(\W|$)' or \ 'maintainer:(\W|^)macports.org:'$HANDLE'(\W|$)' ')' In fact there is a much more fun script that I use -- more fun because it starts several livechecks in parallel, so you're not waiting on slow servers: #!/bin/bash HANDLE=ryandesign JOBS=8 TMPFILE=$(mktemp -t /tmp) PORTS=$(port echo '(' \ 'maintainer:(\W|^)'$HANDLE'(\W|$)' or \ 'maintainer:(\W|^)'$HANDLE'@macports.org(\W|$)' or \ 'maintainer:(\W|^)macports.org:'$HANDLE'(\W|$)' ')' \ | sed -E 's/ +//g' \ | tr '\n' ' ') echo "all: $PORTS" > $TMPFILE echo >> $TMPFILE echo ".PHONY: $PORTS" >> $TMPFILE for PORT in $PORTS; do echo >> $TMPFILE echo "$PORT:" >> $TMPFILE echo $'\t'"port livecheck $PORT" >> $TMPFILE done make -f $TMPFILE -j $JOBS -s || exit $? rm -f $TMPFILE _______________________________________________ macports-users mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
