-rwxr-xr-x | scripts/updateipks | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/scripts/updateipks b/scripts/updateipks index 83d945b..1c9c9b8 100755 --- a/scripts/updateipks +++ b/scripts/updateipks | |||
@@ -1,51 +1,69 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | while [ $# -ne 0 ] | ||
4 | do | ||
3 | case "$1" in | 5 | case "$1" in |
4 | -oz) | 6 | -oz) |
5 | RHOST=openzaurus.sf.net | 7 | RHOST=openzaurus.sf.net |
6 | RDIR=/home/groups/o/op/openzaurus/htdocs/feeds/3.0 | 8 | RDIR=/home/groups/o/op/openzaurus/htdocs/feeds/3.0 |
7 | INDEXER="~/ipkg-make-index ." | 9 | INDEXER="~/ipkg-make-index ." |
8 | shift | 10 | ;; |
11 | -oz-test) | ||
12 | RHOST=openzaurus.sf.net | ||
13 | RDIR=/home/groups/o/op/openzaurus/htdocs/feeds/3.0/test | ||
14 | INDEXER="~/ipkg-make-index ." | ||
9 | ;; | 15 | ;; |
10 | -hh.org) | 16 | -hh.org) |
11 | RHOST=opie.handhelds.org | 17 | RHOST=opie.handhelds.org |
12 | RDIR=/home/opie/website/html/feed/ipaq | 18 | RDIR=/home/opie/website/html/feed/ipaq |
13 | INDEXER="/home/opie/ipkg-make-index ." | 19 | INDEXER="/home/opie/ipkg-make-index ." |
14 | shift | ||
15 | ;; | 20 | ;; |
16 | -qpe) | 21 | -qpe) |
17 | RHOST=qpe.sf.net | 22 | RHOST=qpe.sf.net |
18 | RDIR=/home/groups/q/qp/qpe/htdocs/packages/ipaq/unstable | 23 | RDIR=/home/groups/q/qp/qpe/htdocs/packages/ipaq/unstable |
19 | shift | 24 | ;; |
25 | -force) | ||
26 | FORCE=1 | ||
27 | ;; | ||
28 | *) | ||
29 | MKIPKSOPTS="$MKIPKSOPTS $1" | ||
20 | ;; | 30 | ;; |
21 | esac | 31 | esac |
32 | shift | ||
33 | done | ||
22 | 34 | ||
23 | if [ -z "$RHOST" -o -z "$RDIR" ] | 35 | if [ -z "$RHOST" -o -z "$RDIR" ] |
24 | then | 36 | then |
25 | echo Error: RHOST and RDIR not set! Aborting. | 37 | echo Error: RHOST and RDIR not set! Aborting. |
26 | exit | 38 | exit |
27 | fi | 39 | fi |
28 | 40 | ||
29 | [ -z "$INDEXER" ] && INDEXER="./mkPackages" | 41 | [ -z "$INDEXER" ] && INDEXER="./mkPackages" |
30 | 42 | ||
31 | NEW="" | 43 | NEW="" |
32 | rm -f *.ipk | 44 | rm -f *.ipk |
45 | |||
33 | ssh $RHOST -C "cd $RDIR; ls *.ipk" >currentipks & | 46 | ssh $RHOST -C "cd $RDIR; ls *.ipk" >currentipks & |
34 | ./mkipks "$@" | ||
35 | wait # for ssh | 47 | wait # for ssh |
48 | ./mkipks $MKIPKSOPTS | ||
36 | 49 | ||
37 | for i in *.ipk | 50 | for i in *.ipk |
38 | do | 51 | do |
39 | if grep -q $i currentipks | 52 | if [ -z "$FORCE" ] |
40 | then | 53 | then |
41 | rm $i | 54 | if grep -q $i currentipks |
55 | then | ||
56 | rm $i | ||
57 | else | ||
58 | NEW="$NEW $i"; | ||
59 | fi | ||
42 | else | 60 | else |
43 | NEW="$NEW $i"; | 61 | NEW="$NEW $i"; |
44 | fi | 62 | fi |
45 | done | 63 | done |
46 | 64 | ||
47 | if [ -n "$NEW" ] | 65 | if [ -n "$NEW" ] |
48 | then | 66 | then |
49 | scp $NEW $RHOST:$RDIR | 67 | scp $NEW $RHOST:$RDIR |
50 | rm $NEW | 68 | rm $NEW |
51 | ssh $RHOST -C "cd $RDIR; chmod g+w *.ipk; $INDEXER" | 69 | ssh $RHOST -C "cd $RDIR; chmod g+w *.ipk; $INDEXER" |