mainqndtest
v1.1.1
Last change
on this file since 42095c5 was
42bd667,
checked in by David Fuertes <dfuertes@…>, 4 years ago
|
Historial Limpio
|
-
Property mode set to
100755
|
File size:
1.3 KB
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | # |
---|
3 | # update-web2py.sh |
---|
4 | # 2009-12-16 |
---|
5 | # |
---|
6 | # install in web2py/.. or web2py/ or web2py/scripts as update-web2py.sh |
---|
7 | # make executable: chmod +x web2py.sh |
---|
8 | # |
---|
9 | # save a snapshot of current web2py/ as web2py/../web2py-version.zip |
---|
10 | # download the current stable version of web2py |
---|
11 | # unzip downloaded version over web2py/ |
---|
12 | # |
---|
13 | TARGET=web2py |
---|
14 | |
---|
15 | if [ ! -d $TARGET ]; then |
---|
16 | # in case we're in web2py/ |
---|
17 | if [ -f ../$TARGET/VERSION ]; then |
---|
18 | cd .. |
---|
19 | # in case we're in web2py/scripts |
---|
20 | elif [ -f ../../$TARGET/VERSION ]; then |
---|
21 | cd ../.. |
---|
22 | fi |
---|
23 | fi |
---|
24 | read a VERSION c < $TARGET/VERSION |
---|
25 | SAVE=$TARGET-$VERSION |
---|
26 | URL=http://www.web2py.com/examples/static/web2py_src.zip |
---|
27 | |
---|
28 | ZIP=`basename $URL` |
---|
29 | SAVED="" |
---|
30 | |
---|
31 | # Save a zip archive of the current version, |
---|
32 | # but don't overwrite a previous save of the same version. |
---|
33 | # |
---|
34 | if [ -f $SAVE.zip ]; then |
---|
35 | echo "Remove or rename $SAVE.zip first" >&2 |
---|
36 | exit 1 |
---|
37 | fi |
---|
38 | if [ -d $TARGET ]; then |
---|
39 | echo -n ">>Save old version: " >&2 |
---|
40 | cat $TARGET/VERSION >&2 |
---|
41 | zip -q -r $SAVE.zip $TARGET |
---|
42 | SAVED=$SAVE.zip |
---|
43 | fi |
---|
44 | # |
---|
45 | # Download the new version. |
---|
46 | # |
---|
47 | echo ">>Download latest web2py release:" >&2 |
---|
48 | curl -O $URL |
---|
49 | # |
---|
50 | # Unzip into web2py/ |
---|
51 | # |
---|
52 | unzip -q -o $ZIP |
---|
53 | rm $ZIP |
---|
54 | echo -n ">>New version: " >&2 |
---|
55 | cat $TARGET/VERSION >&2 |
---|
56 | if [ "$SAVED" != "" ]; then |
---|
57 | echo ">>Old version saved as $SAVED" |
---|
58 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.