annotate make/bsd/adlc_updater @ 9295:05be144c3f45

8135209: Avoid abutting string literals and identifiers Summary: Add spaces between string literals and identifiers. Reviewed-by: brutisso, pliden
author kbarrett
date Wed, 09 Sep 2015 14:31:12 -0400
parents
children 0d58ee2030ae
rev   line source
never@2721 1 #! /bin/sh
never@2721 2 #
never@2721 3 # This file is used by adlc.make to selectively update generated
never@2721 4 # adlc files. Because source and target diretories are relative
never@2721 5 # paths, this file is copied to the target build directory before
never@2721 6 # use.
never@2721 7 #
never@2721 8 # adlc-updater <file> <source-dir> <target-dir>
never@2721 9 #
never@2721 10 fix_lines() {
never@2721 11 # repair bare #line directives in $1 to refer to $2
never@2721 12 awk < $1 > $1+ '
never@2721 13 /^#line 999999$/ {print "#line " (NR+1) " \"" F2 "\""; next}
never@2721 14 {print}
never@2721 15 ' F2=$2
never@2721 16 mv $1+ $1
never@2721 17 }
never@2721 18 fix_lines $2/$1 $3/$1
never@2721 19 [ -f $3/$1 ] && cmp -s $2/$1 $3/$1 || \
never@2721 20 ( [ -f $3/$1 ] && echo Updating $3/$1 ; touch $2/made-change ; mv $2/$1 $3/$1 )