~ubuntu-branches/ubuntu/oneiric/javatools/oneiric

« back to all changes in this revision

Viewing changes to jh_linkjars

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Johnson, Niels Thykier, Matthew Johnson
  • Date: 2010-03-30 00:11:37 UTC
  • mfrom: (6.1.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100330001137-ihh6lyi8omhx6dun
Tags: 0.30
[ Niels Thykier ]
* Added myself to uploaders.
* Created debhelper-like scripts for building eclipse features and
  added a dh7 sequence.
* Added Vcs-* fields.
* Replaced references to "dh_clean -k" with "dh_prep" in the tutorial.
  (Closes: #571097)
* Added DM-Upload-Allowed.
* Bumped Standards-Version to 3.8.4 - no changes required.

[ Matthew Johnson ]
* Make it a 3.0 (native) package

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
   echo -e "\t-h --help: show this text"
12
12
   echo -e "\t-V --version: show the version"
13
13
   echo -e "\t-v --verbose: show more information while running"
 
14
        echo -e "\t-t --transitive: transitively link jars"
14
15
   echo -e "\t-n --no-act: don't actually do anything, just print the results"
15
16
   echo -e "\t-u --unlink: remove the links instead of adding them"
16
17
   exit 1
17
18
}
18
19
 
19
 
ARGS="v verbose n no-act u unlink" parseargs "$@"
 
20
ARGS="v verbose n no-act u unlink t transitive" parseargs "$@"
 
21
 
20
22
 
21
23
function findjars()
22
24
{
23
 
        BDS=$(grep-dctrl --no-field-names --show-field Build-Depends -F source $(sed -n '/^Source:/s/.*: //p' < debian/control) debian/control | tr , ' ' | sed 's/([^)]*)//g')
 
25
        pkg="$1"
 
26
        if [ -z "$pkg" ]; then
 
27
                pkg="$(sed -n '/^Source:/s/.*: //p' < debian/control)"
 
28
                BDS=$(grep-dctrl --no-field-names --show-field Build-Depends,Build-Depends-Indep -F source "$pkg" debian/control | tr , ' ' | sed 's/([^)]*)//g')
 
29
        else
 
30
                BDS=$(dpkg -s "$pkg" | sed -n 's/([^)]*)//g;s/,/ /g;/^Depends:/s/.*: //p')
 
31
        fi
24
32
 
25
 
        JARS=
 
33
        JARS=""
26
34
        for d in $BDS; do 
27
 
                JARS="$JARS $(dpkg -L $d | grep "^/usr/share/java/.*\.jar$")"
 
35
                j="$(dpkg -L $d | grep "^/usr/share/java/.*\.jar$")"
 
36
                k=""
 
37
                if [ -n "$j" ] &&  [ `getarg t transitive` ]; then
 
38
                        k=$(findjars "$d")
 
39
                fi
 
40
                JARS="$JARS $j $k"
28
41
        done
29
42
        echo $JARS
30
43
}