summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2017-11-21 12:59:00 +0100
committerAlexander Couzens <lynxis@fe80.eu>2017-11-21 14:36:38 +0100
commit83ccbfe87b001beaf0659a1ff6eda0cc5c9af915 (patch)
tree5b3726a7d939786ce842413906fa01ca314bd667 /scripts
parent1b293e89b22bdf8751c76ceb84da21cac7793bc3 (diff)
osmocom-latest-packages: only publish source tar balls if a new tag was created
OBS should only be updated if there is a new tag. Change-Id: Ife10c9819e5971b001c5be9d313781eb3fd19e23
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/osmocom-latest-packages.sh36
1 files changed, 27 insertions, 9 deletions
diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh
index 23ee3dd..6933baa 100755
--- a/scripts/osmocom-latest-packages.sh
+++ b/scripts/osmocom-latest-packages.sh
@@ -16,21 +16,36 @@ else
fi
build() {
+ project=$1
+ output=$2
echo
- echo "====> Building $1"
+ echo "====> Building $project"
cd "$TOP"
- rm -rf data
[ -d "$1" ] || git clone "git://git.osmocom.org/$1"
cd "$1"
git fetch
VER=$(git describe --abbrev=0 --tags --match "*.*.*" origin/master)
git checkout -f -B "$VER" "refs/tags/$VER"
- gbp buildpackage -d -S -uc -us "--git-export-dir=$TOP/data" "--git-debian-branch=$VER"
- cd "$TOP/$PROJ/$1"
- osc rm ./* || true
- mv $TOP/data/*.dsc .
- mv $TOP/data/*.tar* .
- osc add ./*
+ gbp buildpackage -d -S -uc -us "--git-export-dir=$output" "--git-debian-branch=$VER"
+
+ if [ ! -d "$TOP/$PROJ/$1" ] ; then
+ # creating a new package is different from using old ones
+ mkdir "$TOP/$PROJ/$1"
+ mv "$output/"*.dsc "$TOP/$PROJ/$1/"
+ cd "$TOP/$PROJ"
+ osc add "$1"
+ else
+ cd "$TOP/$PROJ/$1"
+
+ # update OBS only if the filename doesn't match
+ file=$(cd "$output/" ; ls ./*.dsc)
+ if [ ! -e "$file" ] ; then
+ osc rm ./* || true
+ mv "$output/"*.dsc .
+ mv "$output/"*.tar* .
+ osc add ./*
+ fi
+ fi
cd "$TOP"
}
@@ -56,8 +71,11 @@ PACKAGES="
osmo-bsc
"
+[ -d "$TOP/debsrc" ] && rm -rf "$TOP/debsrc"
+mkdir "$TOP/debsrc"
+
for p in $PACKAGES; do
- build "$p"
+ build "$p" "$TOP/debsrc/$p"
done
cd "$TOP/$PROJ"