#!/bin/bash

# Update SWIG tarball on openSUSE Build Service to contain the latest from master
# Requires the openSUSE Build Service command-line tool (osc)
# See http://openbuildservice.org/download/
# And these packages: obs-service-tar_scm obs-service-recompress obs-service-set_version

# Results appear at https://build.opensuse.org/package/show/home:kwk:swig/swig-raw

set -e
set -x

rm -rf home-kwk-swig/swig-raw
mkdir -p home-kwk-swig
cd home-kwk-swig
# check out 'swig-raw'
osc co -o swig-raw home:kwk:swig swig-raw
cd swig-raw
# remove existing tarball
osc rm swig*tar.bz2
# fetch latest master branch from git and create tarball
osc service disabledrun
# add new tarball
osc addremove
# check changes into build service, triggers build
osc ci
