source: wkhtmltox/trunk/fuentes/scripts/sync-headers.sh @ 51

Last change on this file since 51 was 51, checked in by mabarracus, 4 years ago

wip

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/bash
2#
3# Copyright 2010, 2011 wkhtmltopdf authors
4#
5# This file is part of wkhtmltopdf.
6#
7# wkhtmltopdf is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Lesser General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# wkhtmltopdf is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU Lesser General Public License
18# along with wkhtmltopdf.  If not, see <http:#www.gnu.org/licenses/>.
19
20mkdir -p include/wkhtmltox
21find src -iname '*.pro' -or -iname '*.pri' | while read name; do
22        cat "$name" | sed -nre 's/PUBLIC_HEADERS \+=[ \t]*(.*[^\t ])[^\t ]*/\1/p' | sed -re 's/[\t ]+/\n/g' | sort -u | while read file; do
23                path="$(dirname $name)/$file"
24                [ -f "$path" ] || continue
25                cat $path | sed -n '4,$p' | sed -e '1s/ \*/\/\*\n \*/'> tmpheader
26                dst="include/wkhtmltox/$(basename $path)"
27
28                [ -f "${dst}" ] && cmp -s "$dst" tmpheader && rm tmpheader && continue
29                echo "$dst"
30                mv tmpheader "$dst"
31        done
32done
Note: See TracBrowser for help on using the repository browser.