summaryrefslogtreecommitdiff
path: root/scripts/updateipks
blob: 83d945b1ef55e9d4134cddb4a05458145abf7fea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh

case "$1" in
-oz)
    RHOST=openzaurus.sf.net
    RDIR=/home/groups/o/op/openzaurus/htdocs/feeds/3.0
    INDEXER="~/ipkg-make-index ."
    shift
    ;;
-hh.org)
    RHOST=opie.handhelds.org
    RDIR=/home/opie/website/html/feed/ipaq
    INDEXER="/home/opie/ipkg-make-index ."
    shift
    ;;
-qpe)
    RHOST=qpe.sf.net
    RDIR=/home/groups/q/qp/qpe/htdocs/packages/ipaq/unstable
    shift
    ;;
esac

if [ -z "$RHOST" -o -z "$RDIR" ]
then
    echo Error: RHOST and RDIR not set! Aborting.
    exit
fi 

[ -z "$INDEXER" ] && INDEXER="./mkPackages"

NEW=""
rm -f *.ipk
ssh $RHOST -C "cd $RDIR; ls *.ipk" >currentipks &
./mkipks "$@"
wait # for ssh

for i in *.ipk
do
    if grep -q $i currentipks
    then
	rm $i
    else
	NEW="$NEW $i";
    fi
done

if [ -n "$NEW" ]
then
    scp $NEW $RHOST:$RDIR
    rm $NEW
    ssh $RHOST -C "cd $RDIR; chmod g+w *.ipk; $INDEXER"
fi

rm currentipks