update-package.sh

Cesar Martinez Izquierdo, 12/10/2015 02:20 PM

Download (1.22 KB)

 
1
#!/bin/sh
2

    
3

    
4
usage () {
5
    echo "Usage: update-package.sh gvsig-install-dir"
6
    echo "  It must be run from the base of the osgeo package."
7
    echo "  Example:"
8
    echo "    $ cd gvsig-osgeo-package"
9
    echo "    $ ../update-package.sh /media/$USER/windows/Program\ Files\ \(x86\)/gvSIG\ desktop\ 2.2.0" ;
10
}
11

    
12
if [ $# -ne 1 ]; then
13
    echo "Parameter gvsig-install-dir is missing"
14
    usage
15
    return 1 ;
16
fi
17

    
18
if [ ! -d "$1" ] ; then
19
    echo "Provided gvsig-install-dir does not exist or is not a directory"
20
    echo "$1"
21
    usage
22
    return 1 ;
23
fi
24

    
25
if [ -d "apps/gvsig" ] && [ -d "etc" ] ; then
26
    echo "Removing old gvSIG version"
27
    rm -rf apps/gvsig/* ;
28
else
29
    echo "Current working directory does not appear to be an osgeo gvsig package"
30
    usage
31
    return 1 ;
32
fi
33

    
34
echo "Copying new gvSIG version from: " "$1"
35
cp -r "$1"/* "apps/gvsig/"
36

    
37
echo "Removing unnecessary files"
38
#rm -f apps/gvsig/msv*
39
#find apps/gvsig -name "install" -exec rm -rf {} ';'
40
find apps/gvsig -name "install" | xargs rm -rf
41
mkdir "apps/gvsig/install"
42

    
43
# tools block. It may be worthy to keep it (but we must then include busybox license and a link to the source code)
44
rm -rf apps/gvsig/tools
45
rm -f apps/gvsig/gvsig-desktop.cmd
46
rm -f apps/gvsig/gvSIG.sh
47
echo "Done"