aboutsummaryrefslogtreecommitdiffstats
path: root/rpm-local/import-obs.sh
blob: d1d0e8cbdc24515b1163ec9521652acdb3dbcad1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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