aboutsummaryrefslogtreecommitdiffstats
path: root/rpm-local/import-obs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rpm-local/import-obs.sh')
-rwxr-xr-xrpm-local/import-obs.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/rpm-local/import-obs.sh b/rpm-local/import-obs.sh
new file mode 100755
index 0000000..d1d0e8c
--- /dev/null
+++ b/rpm-local/import-obs.sh
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+DIR="$(cd "$(dirname "$0")" && pwd -P)"
+OBSSRC=~/code/obs
+PROJ=openSUSE:Factory
+PKGNAME="$1"
+
+if [ -z "$PKGNAME" ]; then
+ echo "usage: $(basename $0) PKGNAME"
+ exit 1
+fi
+
+set -x
+cd "$OBSSRC"
+if ! [ -e "$PROJ/$PKGNAME" ]; then
+ osc co "$PROJ" "$PKGNAME"
+fi
+
+cd "$DIR/spec"
+if [ -d "$PKGNAME" ]; then
+ rm -r "$PKGNAME"
+fi
+
+mkdir "$PKGNAME"
+cd "$PKGNAME"
+cp -v "$OBSSRC/$PROJ/$PKGNAME/"* .
+
+cd "$DIR"
+./obs-clean.sh