aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-05-11 12:18:50 +0200
committerOliver Smith <osmith@sysmocom.de>2020-05-11 12:18:50 +0200
commitf3511cce5a4970cc1f94bc9ce1067b1a77f2eb09 (patch)
tree5673bdf0a3a3c2fae042d2350220c3a3278ec19b
parent5d009ac7e5d937f05a3113b67c1267390bd431bf (diff)
import-obs.sh: new file
-rwxr-xr-xrpm-local/import-obs.sh28
-rwxr-xr-xrpm-local/obs-clean.sh4
2 files changed, 30 insertions, 2 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
diff --git a/rpm-local/obs-clean.sh b/rpm-local/obs-clean.sh
index 5fec22a..e78ee62 100755
--- a/rpm-local/obs-clean.sh
+++ b/rpm-local/obs-clean.sh
@@ -1,4 +1,4 @@
#!/bin/sh -x
# After osc checkout, clean out all tarballs and .osc dirs
-rm $(find -name '*.tar.*') $(find -name '*.zip')
-rm -r $(find -name '.osc')
+rm -f $(find -name '*.tar.*') $(find -name '*.zip')
+rm -rf $(find -name '.osc')