source: npl/syncupdates @ 105afb5

Last change on this file since 105afb5 was c5d681f, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

zarafa clean fixes and free diskspace checks

  • Property mode set to 100755
File size: 1.3 KB
Line 
1#!/bin/bash
2
3rm -rf .tmp 2>/dev/null
4HOST="updates@www.syn-3.nl";
5
6OPTS="" ./sshkeyfix $HOST || exit 1
7
8ssh  $HOST "ls" > /tmp/updates.txt || exit 1
9
10
11export FILTER
12if [ "$1" ]; then
13        FILTER="$1.pkg";
14else
15        FILTER="*.pkg";
16fi
17
18
19echo "Searching packages..."
20for PKG in `find . -name "$FILTER"`; do
21
22        #dont upload _dev stuff, we dont use it and it wastes space and time :)
23        if echo $PKG | egrep "(_dev|_src)" >/dev/null; then
24                continue;
25        fi
26   
27        #echo -n "Verifying update $PKG...";
28        TGZ=`./pkgname $PKG` || exit 1
29
30        MOD=
31        if egrep 'mod.tgz$'<<<$TGZ >/dev/null || egrep 'new.tgz$'<<<$TGZ >/dev/null; then
32            MOD=1
33        fi
34
35        #dont upload mods by default
36        if [ "$MOD" ] && ! [ "$MODS" ]; then
37                echo "NOT uploading uncommitted version. (use 'MODS=1 $0 .... ' to upload anyway): $PKG"
38                continue
39        fi
40
41
42        #skip already uploaded stuff, but always upload mods, when enabled
43        if [ "$MOD" ] || ! grep -x "$TGZ" /tmp/updates.txt >/dev/null
44        then
45                if [ -f `dirname $PKG`/dontupdate ]; then
46                        echo "Skipping $TGZ"
47                else
48                        echo "Uploading $TGZ..."
49                        chmod 755 $PKG
50                        rsync -a  $PKG $HOST:$TGZ || exit 1
51                        git log --summary `dirname $PKG`|ssh  $HOST "cat > $TGZ.log" || exit 1
52                fi
53        else
54                echo -e -n "\r                                                                               \r"
55        fi
56done
57echo "DONE";
Note: See TracBrowser for help on using the repository browser.