Dash:
[t2.git] / package / develop / clip / getpatch.sh
blob250dba77283e77ed5b67b8ba9bf872f5baa283c9
1 #!/bin/sh
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 #
5 # T2 SDE: package/.../clip/getpatch.sh
6 # Copyright (C) 2004 - 2006 The T2 SDE Project
7 #
8 # More information can be found in the files COPYING and README.
9 #
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 tempfile=clip-patch.tar.gz.$$
17 #location=ftp://ftp.linux.ru.net/mirrors/clip
18 location=ftp://www.cis.by/pub/clip/pub/clip
19 #location=ftp://ftp.itk.ru/pub/clip
21 echo "get: $location/patch.tgz"
22 if [ -f patch.tgz ]; then
23 mv patch.tgz $tempfile
24 else
25 # wget $location/patch.tgz -O $tempfile
26 curl $location/patch.tgz -o $tempfile
27 if [ $? -ne 0 ]; then
28 rm -f $tempfile
29 exit
33 release=$( tar zOxf $tempfile ./clip-prg/clip/release_version 2> /dev/null )
34 [ -z "$release" ] && release=$( grep -e '^\[V\]' clip.desc | cut -d' ' -f2- | cut -d'-' -f1)
35 seqno=$( tar zOxf $tempfile ./clip-prg/clip/seq_no.txt 2> /dev/null )
37 echo "$release-$seqno"
39 if [ -n "$release" -a -n "$seqno" ]; then
40 archdir=../../../download/mirror/c/
41 filename=clip-patch-$release-$seqno.tbz2
43 if [ -f $archdir/$filename ]; then
44 echo "INFO: $filename already grabbed"
45 else
46 zcat ./$tempfile | bzip2 - > $archdir/$filename
47 echo "INFO: $filename catched!"
49 rm -f ./$tempfile
50 ( cd ../../..; sh misc/archive/Update.sh clip $release-$seqno )
51 else
52 echo "ERROR: take a look into ./$tempfile"