gvsig-raster / org.gvsig.raster / tags / v2.2.3 / org.gvsig.raster.mainplugin / unpack-dependencies.sh @ 9386
History | View | Annotate | Download (763 Bytes)
1 | 2488 | nbrodin | #!/bin/bash |
---|---|---|---|
2 | |||
3 | #set -x |
||
4 | |||
5 | dep_dir=$1; |
||
6 | dest_dir=$2; |
||
7 | |||
8 | if [ ! -d $dest_dir ]; then mkdir $dest_dir; fi; |
||
9 | if [ ! -d $dep_dir ]; then exit 0; fi |
||
10 | |||
11 | if [ ! -d $dest_dir/unpacked ]; then |
||
12 | mkdir $dest_dir/unpacked; |
||
13 | fi |
||
14 | |||
15 | # Get all natives sdk bundle files |
||
16 | files=$(find $dep_dir -type f -name *.tar.gz) |
||
17 | |||
18 | for i in $files; do |
||
19 | filename=`basename $i` |
||
20 | filedest="$dest_dir/unpacked/$filename" |
||
21 | |||
22 | #echo FileName: "$filename" |
||
23 | #echo FileDest: "$filedest" |
||
24 | |||
25 | # Overwrite only if the file is newer than the one stored as unpacked |
||
26 | if [ ! -f "$filedest" ] || [ "$i" -nt "$filedest" ]; then |
||
27 | echo "Expanding $i in $dest_dir" |
||
28 | cp "$i" "$dest_dir/unpacked" |
||
29 | tar xzf "$i" -C "$dest_dir" |
||
30 | else |
||
31 | echo "$i not newer than the one available in $dest_dir/unpacked, not expanding it" |
||
32 | fi |
||
33 | done |