]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - debian/scripts/link-headers
UBUNTU: [Debian] config-check -- accumulate multi-line annotations correctly
[mirror_ubuntu-zesty-kernel.git] / debian / scripts / link-headers
CommitLineData
356bd1e1
LO
1#!/bin/bash -e
2
3. debian/debian.env
4
5hdrdir="$1"
6symdir="$2"
7flavour="$3"
8
9echo "Symlinking and copying headers for $flavour..."
10
11excludes="( -path ./debian -prune -o -path ./${DEBIAN} -prune -o -path ./.git ) -prune -o"
12
13(
14find . $excludes -type f \
15 \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
16 -name '*.sh' -o -name '*.pl' -o -name '*.lds' \) -print
17find ./include ./scripts -name .gitignore -prune -o -type f -print
18find ./include -mindepth 1 -maxdepth 1 $excludes -type d -print
19) | (
20while read file; do
21 dir=$file
22 lastdir=$file
23
24 if [ -e "$hdrdir/$file" -o -L "$hdrdir/$file" ]; then
25 continue
26 fi
27
28 while [ ! -e "$hdrdir/$dir" -a ! -L "$hdrdir/$dir" ]; do
29 lastdir=$dir
30 dir=`dirname $dir`
31 done
32 # If the last item to exist is a symlink we assume all is good
33 if [ ! -L "$hdrdir/$dir" ]; then
34 # Turns things like "./foo" into "../"
35 deref="`echo -n $lastdir | sed -e 's/^\.//' -e's,/[^/]*,../,g'`"
36 item="`echo -n $lastdir | sed -e 's/^\.\///'`"
37 ln -s $deref$symdir/$item $hdrdir/$item
38 fi
39done
40)
41
42exit