~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal

« back to all changes in this revision

Viewing changes to debian/scripts/link-headers

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-04kado7d1u2er2rl
Tags: 3.2.0-16.25
Add new lowlatency kernel flavour

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash -e
 
2
 
 
3
. debian/debian.env
 
4
 
 
5
hdrdir="$1"
 
6
symdir="$2"
 
7
flavour="$3"
 
8
 
 
9
echo "Symlinking and copying headers for $flavour..."
 
10
 
 
11
excludes="( -path ./debian -prune -o -path ./${DEBIAN} -prune -o -path ./.git ) -prune -o"
 
12
 
 
13
(
 
14
find . $excludes  -type f \
 
15
        \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
 
16
        -name '*.sh' -o -name '*.pl' -o -name '*.lds' \) -print
 
17
find ./include ./scripts -name .gitignore -prune -o -type f -print
 
18
find ./include -mindepth 1 -maxdepth 1 $excludes -type d -print
 
19
) | (
 
20
while 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
 
39
done
 
40
)
 
41
 
 
42
exit