~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to build/unix/print-depth-path.sh

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
#
3
 
# This Source Code Form is subject to the terms of the Mozilla Public
4
 
# License, v. 2.0. If a copy of the MPL was not distributed with this
5
 
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
 
 
7
 
#
8
 
# This script will print the depth path for a mozilla directory based
9
 
# on the info in Makefile
10
 
#
11
 
# It's a hack.  It's brute force.  It's horrible.  
12
 
# It don't use Artificial Intelligence.  It don't use Virtual Reality.
13
 
# It's not perl.  It's not python.   But it works.
14
 
#
15
 
# Usage: print-depth-path.sh
16
 
#
17
 
# Send comments, improvements, bugs to jim_nance@yahoo.com
18
 
19
 
 
20
 
# Make sure a Makefile exists
21
 
if [ ! -f Makefile ]
22
 
then
23
 
        echo
24
 
        echo "There ain't no 'Makefile' over here: $pwd, dude."
25
 
        echo
26
 
 
27
 
        exit
28
 
fi
29
 
 
30
 
# awk can be quite primitave.  Try enhanced versions first
31
 
for AWK in gawk nawk awk; do
32
 
    if type $AWK 2>/dev/null 1>/dev/null; then
33
 
        break;
34
 
    fi
35
 
done
36
 
 
37
 
$AWK -v PWD=`pwd` '
38
 
{
39
 
    if($1 == "DEPTH") {
40
 
        DEPTH=$0
41
 
    }
42
 
}
43
 
 
44
 
END {
45
 
    sub("^.*DEPTH.*=[ \t]*", "", DEPTH)
46
 
    dlen = split(DEPTH, darray, "/")
47
 
    plen = split(PWD,   parray, "/")
48
 
 
49
 
    fsep=""
50
 
    for(i=plen-dlen; i<=plen; i++) {
51
 
        printf("%s%s", fsep, parray[i])
52
 
        fsep="/"
53
 
    }
54
 
    printf("\n")
55
 
}' Makefile
56