[med-svn] r24971 - trunk/helper-scripts

Andreas Tille tille at moszumanska.debian.org
Wed Jan 10 12:51:01 UTC 2018


Author: tille
Date: 2018-01-10 12:51:01 +0000 (Wed, 10 Jan 2018)
New Revision: 24971

Added:
   trunk/helper-scripts/inject-into-salsa-git
Log:
Take over idea of inject-into-alioth-git for salsa.  This whole dir needs to be moved to Git ...


Added: trunk/helper-scripts/inject-into-salsa-git
===================================================================
--- trunk/helper-scripts/inject-into-salsa-git	                        (rev 0)
+++ trunk/helper-scripts/inject-into-salsa-git	2018-01-10 12:51:01 UTC (rev 24971)
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -eu
+
+SCRDIR=`dirname $0`
+
+if [ ! -f ${SCRDIR}/salsarc ] ; then
+  echo "Missing ${SCRDIR}/salsarc"
+  exit 1
+fi
+
+. ${SCRDIR}/salsarc
+
+DEBPKGNAME=`dpkg-parsechangelog | awk '/^Source:/ {print $2}'`
+SHORTDESC=`grep "^Description: " debian/control | head -n 1 | sed 's/^Description: //'`
+VCSGIT=`grep "^Vcs-Git: " debian/control | sed -e 's/^Vcs-Git: //' -e 's#[githps]\+://anonscm.debian.org/#ssh://git.debian.org/#'`
+SALSA_GROUP=`echo $VCSGIT | sed -e 's#.*://salsa.debian.org/\([^/]\+\)/.*#\1#'`
+
+#echo $VCSGIT
+#echo $SALSA_GROUP
+
+SALSA_GROUP_ID=$(curl --silent -f -XGET --header "PRIVATE-TOKEN: $SALSA_TOKEN" "$SALSA_URL/groups?all_available=false" | jq ".[] | select(.path == \"$SALSA_GROUP\") | .id")
+
+set -x
+curl "$SALSA_URL/projects?private_token=$SALSA_TOKEN" \
+     --data "path=${DEBPKGNAME}&namespace_id=${SALSA_GROUP_ID}&description=${SHORTDESC}&visibility=public"
+
+  git remote add origin git at salsa.debian.org:${SALSA_GROUP}/${DEBPKGNAME}.git
+  git push origin master
+  git push --all --set-upstream
+  git push --tags


Property changes on: trunk/helper-scripts/inject-into-salsa-git
___________________________________________________________________
Added: svn:executable
   + *




More information about the debian-med-commit mailing list