This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 {}"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]