aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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')