From f3511cce5a4970cc1f94bc9ce1067b1a77f2eb09 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 11 May 2020 12:18:50 +0200 Subject: import-obs.sh: new file Change-Id: Iadf192eeda1350fbb7659b702bbffd7f839eef91 --- rpm-local/import-obs.sh | 28 ++++++++++++++++++++++++++++ rpm-local/obs-clean.sh | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100755 rpm-local/import-obs.sh 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') -- cgit v1.2.3