~romaia/+junk/ppa-script

« back to all changes in this revision

Viewing changes to upload.sh

  • Committer: Ronaldo Maia
  • Date: 2011-02-04 14:13:35 UTC
  • Revision ID: romaia@async.com.br-20110204141335-xbkdg5982ow132lh
initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
SIGNKEY=990F90AE
 
4
PPA="ppa" # "testing" or "ppa" (for stable)
 
5
TRY="1"
 
6
 
 
7
PACKAGE=`echo $1 | sed 's/\///'`
 
8
cd $PACKAGE
 
9
 
 
10
echo "> Updating the code"
 
11
bzr revert debian/changelog > ../upload-${PACKAGE}.log 2> /dev/null
 
12
bzr pull >> ../upload-${PACKAGE}.log 2> /dev/null
 
13
 
 
14
REV=`bzr revno`
 
15
VERSION=`head debian/changelog -n 1 | cut -d' ' -f 2 | sed s/[\(\)]//g`
 
16
# This is to workaround an issue with stodriver versioning
 
17
SHORT_VERSION=`echo $VERSION | sed s/1://`
 
18
 
 
19
for dist in karmic lucid; do
 
20
    echo "> Uploading ${dist}"
 
21
 
 
22
    APPEND_VERSION=+r${REV}~${PPA}${TRY}~${dist}${TRY}
 
23
    SOURCE_FILE=${PACKAGE}_${SHORT_VERSION}${APPEND_VERSION}_source
 
24
 
 
25
    if [ -e "../${SOURCE_FILE}.stoq-${dist}.upload" ]
 
26
    then
 
27
        echo "  > Package already uploaded"
 
28
        continue
 
29
    fi
 
30
 
 
31
    # TODO: remove old source
 
32
 
 
33
 
 
34
 
 
35
    echo '  > Checking for changes'
 
36
    bzr revert debian/changelog 2>> ../upload-${PACKAGE}.log
 
37
    mv .bzr ../bzr-${PACKAGE}
 
38
 
 
39
 
 
40
    echo "  > Creating new version: ${VERSION}${APPEND_VERSION}"
 
41
    (cd debian && debchange --force-bad-version --preserve --newversion \
 
42
            "${VERSION}${APPEND_VERSION}" \
 
43
            testing ppa, dist ${dist}, try ${TRY}, bzr revision ${REV})
 
44
 
 
45
    echo "  > Building source"
 
46
    debuild -S -k${SIGNKEY} >> ../upload-${PACKAGE}.log
 
47
    mv ../bzr-${PACKAGE} .bzr
 
48
 
 
49
    echo "  > Uploading do ppa"
 
50
    dput stoq-${dist} ../${SOURCE_FILE}.changes
 
51
done
 
52
 
 
53
cd ..
 
54
 
 
55
ls ${PACKAGE}_* | grep -v upload | xargs rm