瀏覽代碼

Update include sync file to handle c style comments

Antialize 15 年之前
父節點
當前提交
16fe842101
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      scripts/syncwkhtmltpdf.sh

+ 6 - 2
scripts/syncwkhtmltpdf.sh

@@ -22,7 +22,11 @@ find src -iname '*.pro' -or -iname '*.pri' | while read name; do
 	cat "$name" | sed -nre 's/PUBLIC_HEADERS \+=[ \t]*(.*[^\t ])[^\t ]*/\1/p' | sed -re 's/[\t ]+/\n/g' | sort -u | while read file; do
 		path="$(dirname $name)/$file"
 		[ -f "$path" ] || continue
-		echo $path
-		cat $path | sed -n '4,$p' > "include/wkhtmltox/$(basename $path)"
+		cat $path | sed -n '4,$p' | sed -e '1s/ \*/\/\*\n \*/'> tmpheader
+		dst="include/wkhtmltox/$(basename $path)"
+
+		[ -f "${dst}" ] && cmp -s "$dst" tmpheader && rm tmpheader && continue
+		echo "$dst"
+		mv tmpheader "$dst"
 	done
 done