4
PPA="ppa" # "testing" or "ppa" (for stable)
7
PACKAGE=`echo $1 | sed 's/\///'`
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
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://`
19
for dist in karmic lucid; do
20
echo "> Uploading ${dist}"
22
APPEND_VERSION=+r${REV}~${PPA}${TRY}~${dist}${TRY}
23
SOURCE_FILE=${PACKAGE}_${SHORT_VERSION}${APPEND_VERSION}_source
25
if [ -e "../${SOURCE_FILE}.stoq-${dist}.upload" ]
27
echo " > Package already uploaded"
31
# TODO: remove old source
35
echo ' > Checking for changes'
36
bzr revert debian/changelog 2>> ../upload-${PACKAGE}.log
37
mv .bzr ../bzr-${PACKAGE}
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})
45
echo " > Building source"
46
debuild -S -k${SIGNKEY} >> ../upload-${PACKAGE}.log
47
mv ../bzr-${PACKAGE} .bzr
49
echo " > Uploading do ppa"
50
dput stoq-${dist} ../${SOURCE_FILE}.changes
55
ls ${PACKAGE}_* | grep -v upload | xargs rm