aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrpm-local/import-fedora.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/rpm-local/import-fedora.sh b/rpm-local/import-fedora.sh
new file mode 100755
index 0000000..1add7c9
--- /dev/null
+++ b/rpm-local/import-fedora.sh
@@ -0,0 +1,27 @@
+#!/bin/sh -e
+DIR="$(cd "$(dirname "$0")" && pwd -P)"
+FEDORASRC=~/code/fedora
+BRANCH=f31
+PKGNAME="$1"
+
+if [ -z "$PKGNAME" ]; then
+ echo "usage: $(basename $0) PKGNAME"
+ exit 1
+fi
+
+set -x
+cd "$FEDORASRC"
+if ! [ -e "$PKGNAME" ]; then
+ git clone "https://src.fedoraproject.org/rpms/$PKGNAME"
+fi
+cd "$PKGNAME"
+git checkout "$BRANCH"
+
+cd "$DIR/spec"
+if [ -d "$PKGNAME" ]; then
+ rm -r "$PKGNAME"
+fi
+
+mkdir "$PKGNAME"
+cd "$PKGNAME"
+cp -v "$FEDORASRC/$PKGNAME/"* .