summaryrefslogtreecommitdiffstats
path: root/bin/git-new.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-05-09 04:21:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-05-09 04:21:55 +0000
commit453cc058d9ee6d7cb47529d99061216e72149a5f (patch)
tree38e3683d9cb52c2f181d65ba513554a5e1387f20 /bin/git-new.sh
parentInitial commit. (diff)
downloadprogress-linux-tools-453cc058d9ee6d7cb47529d99061216e72149a5f.tar.xz
progress-linux-tools-453cc058d9ee6d7cb47529d99061216e72149a5f.zip
Adding bin.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/git-new.sh')
-rwxr-xr-xbin/git-new.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/bin/git-new.sh b/bin/git-new.sh
new file mode 100755
index 0000000..e5fe8ef
--- /dev/null
+++ b/bin/git-new.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+set -e
+
+if [ -z "${1}" ] || [ -z "${2}" ]
+then
+ echo "Usage: ${0} DISTRIBUTION PACKAGE"
+ exit 1
+fi
+
+CATEGORY="packages"
+
+DISTRIBUTION="${1}"
+shift 1
+
+PACKAGES="${@}"
+
+case "${DISTRIBUTION}" in
+ *-extras)
+ ORIGIN="progress-linux"
+ BRANCH="progress-linux"
+ ;;
+
+ *-backports)
+ ORIGIN="debian-backports"
+ BRANCH="progress-linux"
+ ;;
+
+ daniel*)
+ CATEGORY="users/daniel.baumann/debian/packages"
+ DISTRIBUTION=""
+ ORIGIN="debian"
+ BRANCH="debian"
+ ;;
+
+ *)
+ ORIGIN="debian"
+ BRANCH="progress-linux"
+ ;;
+esac
+
+for PACKAGE in ${PACKAGES}
+do
+ REPOSITORY="$(echo ${CATEGORY}/${DISTRIBUTION}/${PACKAGE} | sed -e 's|//|/|g')"
+
+ ssh git@git.progress-linux.org create ${REPOSITORY}
+ ssh git@git.progress-linux.org desc ${REPOSITORY} ${ORIGIN}: ${PACKAGE}
+ ssh git@git.progress-linux.org symbolic-ref ${REPOSITORY} HEAD refs/heads/${BRANCH}
+done