patchchecker for FreeBSD ?

Hans Petter Selasky hps at selasky.org
Fri Sep 5 14:32:25 UTC 2014


On 09/05/14 16:17, Glen Barber wrote:
> On Fri, Sep 05, 2014 at 04:12:45PM +0200, Hans Petter Selasky wrote:
>> The attached script does the trick for me at least. Might be useful to
>> others too :-)
>>
>
> I think mailman ate it.
>
> Glen
>

#!/bin/sh

#
# This script should be run on every USB C- and H- file before
# commit to enforce correct style.
#

[ -z "$1" ] && (echo "Please specify a filename.") && exit

#
# The "-ta" option is an extension to indent.
# Contact hselasky at freebsd.org to receive a
# patch that adds support for this option to
# indent !
#

#
# sed -E 's/&\(([^, \)]*)\)/\&\1/' |
#

for F in $*
do

echo "Now styling $F"

(cat $F | indent -Toss_mixerinfo -TFILE -Tu_char -Tu_int -Tu_long \
  -TTAILQ_HEAD -TLIST_HEAD -TTAILQ_ENTRY -TLIST_ENTRY \
  -TSTAILQ_HEAD -TSTAILQ_ENTRY \
  -Tu_short -Tfd_set -ta -st -bad -bap -nbbb -nbc -br -nbs \
  -c41 -cd41 -cdb -ce -ci4 -cli0 -d0 -di8 -ndj -ei -nfc1 \
  -nfcb -i8 -ip8 -l79 -lc77 -ldi0 -nlp -npcs -psl -sc \
  -nsob -nv |
  sed -e "s/_HEAD [(]/_HEAD(/g" |
  sed -e "s/_ENTRY [(]/_ENTRY(/g" |
  sed -e "s/	__packed/ __packed/g" |
  sed -e "s/	__aligned/ __aligned/g" |
  sed -e "s/^#define /#define	/g") > temp

(diff temp $F > /dev/null) || (cp temp $F)

done



More information about the freebsd-hackers mailing list