This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
tail +2 fix
- From: Jani Monoses <jani at iv dot ro>
- To: ecos-patches at sources dot redhat dot com
- Date: Thu, 22 Apr 2004 17:20:12 +0300
- Subject: tail +2 fix
Hi,
with coreutils 5.2 tail chokes on line counts given without explicit -n
in front of it and ecos libs do not compile.
so could somebody please run the attached script in the packages dir?
The patch would be too long and boring to post here as there are 52 cdl
files using the construct
all changes are like this one
- @tail +2 vectors.tmp >> $(notdir $@).deps
+ @tail -n +2 vectors.tmp >> $(notdir $@).deps
thanks
Jani
#!/bin/sh
export CONTRIBUTOR="Jani Monoses <jani@iv.ro>"
do_it() {
grep "tail +2" $1
#if grep found the pattern change it
if [ $? -eq 0 ] ; then
CHLOGFILE=`dirname $1`/../ChangeLog
CDLFILE="cdl\/`basename $1`"
#change the cdl file
sed -i -e 's/tail +2/tail -n +2/g' $1
#add changelog entry
sed -i "1 s/^/`date +%F` $CONTRIBUTOR\n\n\t * $CDLFILE :\n\t Invoke tail with stricter syntax that works in latest coreutils. \n\n/" $CHLOGFILE
fi
}
export -f do_it
#for every cdl
find . -name "*.cdl" | xargs -n 1 -i sh -c "do_it {}"