Emmanuel Bourg pushed to branch master at Debian Java Maintainers / pkg-java-scripts
Commits: 189f07af by Emmanuel Bourg at 2018-04-06T12:48:23+02:00 Update the Vcs-* fields of the packages coming from the pkg-med team - - - - - 088e3bf0 by Emmanuel Bourg at 2018-04-27T22:50:22+02:00 Move the packages migrated to Salsa under the 'pkg-java/migrated' directory - - - - - 97c7811e by Emmanuel Bourg at 2018-05-17T12:55:13+02:00 New script to move the Vcs-* fields to salsa.debian.org in debian/control - - - - - 3 changed files: - migrate-to-salsa - + salsavcs.sh - vcsfields.sh Changes: ===================================== migrate-to-salsa ===================================== --- a/migrate-to-salsa +++ b/migrate-to-salsa @@ -84,3 +84,6 @@ check_return_code echo echo "Migration complete! The new repository is located at ${SALSA_URL%/api*}/$SALSA_GROUP/$PACKAGE" + +echo "Disabling the repository on alioth..." +ssh alioth.debian.org "cd /srv/git.debian.org/git/pkg-java && mv ${PACKAGE}.git migrated/" ===================================== salsavcs.sh ===================================== --- /dev/null +++ b/salsavcs.sh @@ -0,0 +1,99 @@ +#!/bin/bash +# +# Move the Vcs-* fields to salsa.debian.org in debian/control +# + +echo "Updating the Vcs-* fields..." +echo "" + +VCS_UPDATED=0 +grep -q 'anonscm.debian.org' debian/control +if [ $? -eq 0 ]; then + VCS_UPDATED=1 +fi +grep -q 'git.debian.org' debian/control +if [ $? -eq 0 ]; then + VCS_UPDATED=1 +fi + +TEAMS="pkg-java pkg-clojure debian-med collab-maint" + +for TEAM in $TEAMS; do + sed -i "s#git://anonscm.debian.org/$TEAM/\([^/]*\)/\?#https://salsa.debian.org/$TEAM/\1#g" debian/control + sed -i "s#git://git.debian.org/$TEAM/\([^/]*\)/\?#https://salsa.debian.org/$TEAM/\1#g" debian/control + sed -i "s#git://git.debian.org/git/$TEAM/\([^/]*\)/\?#https://salsa.debian.org/$TEAM/\1#g" debian/control + sed -i "s#http\(s\)\?://anonscm.debian.org/git/$TEAM/\([^/]*\)/\?#https://salsa.debian.org/$TEAM/\2#g" debian/control + sed -i "s#http\(s\)\?://anonscm.debian.org/cgit/$TEAM/\([^/]*\)/\?#https://salsa.debian.org/$TEAM/\2#g" debian/control + sed -i "s#http\(s\)\?://anonscm.debian.org/gitweb/?p=$TEAM/\([^/]*\)/\?#https://salsa.debian.org/$TEAM/\2#g" debian/control + sed -i "s#http\(s\)\?://git.debian.org/?p=$TEAM/\([^/]*\)/\?#https://salsa.debian.org/$TEAM/\2#g" debian/control +done + +# Remove the .git suffix from the Vcs-Browser URL +sed -i "s#\(Vcs-Browser: .*\).git#\1#" debian/control + +# Rename the teams +sed -i "s#/pkg-java/#/java-team/#" debian/control +sed -i "s#/pkg-clojure/#/clojure-team/#" debian/control +sed -i "s#/debian-med/#/med-team/#" debian/control +sed -i "s#/collab-maint/#/debian/#" debian/control + +# Add an entry to debian/changelog +if [ $VCS_UPDATED == 1 ]; then + MSG="Use salsa.debian.org Vcs-* URLs" +else + echo "Vcs-* fields are up to date" + exit; +fi + +dch $MSG + +# Prepare to commit and review the changes +git add debian/control debian/changelog +git diff --staged + +echo "" + +while true; do + read -p "Commit changes? [yN] " choice + case $choice in + [Yy]* ) break;; + * ) + # Revert the staged changes + git reset HEAD debian/control debian/changelog + git checkout debian/control debian/changelog + exit + ;; + esac +done + +git commit -m "$MSG" + + +# Update the git remote +REMOTE_URL=$(git remote get-url origin) +REMOTE_REGEX='.*.debian.org/git/(.*)/(.*)' +if [[ $REMOTE_URL =~ $REMOTE_REGEX ]] +then + TEAM=${BASH_REMATCH[1]} + PACKAGE=${BASH_REMATCH[2]} + + TEAM="${TEAM/pkg-java/java-team}" + TEAM="${TEAM/pkg-clojure/clojure-team}" + TEAM="${TEAM/debian-med/med-team}" + TEAM="${TEAM/collab-maint/debian}" + + SALSA_REMOTE_URL="g...@salsa.debian.org:$TEAM/$PACKAGE" + + echo "Changing remote URL to $SALSA_REMOTE_URL" + + git remote remove origin + git remote add origin $SALSA_REMOTE_URL + git fetch + git branch --set-upstream-to=origin/master master + git branch --set-upstream-to=origin/upstream upstream + git branch --set-upstream-to=origin/pristine-tar pristine-tar + + echo "" + + git remote -v +fi ===================================== vcsfields.sh ===================================== --- a/vcsfields.sh +++ b/vcsfields.sh @@ -19,7 +19,7 @@ if [ $? -eq 0 ]; then VCS_BROWSER_UPDATED=1 fi -TEAMS="pkg-java pkg-clojure collab-maint" +TEAMS="pkg-java pkg-clojure debian-med collab-maint" for TEAM in $TEAMS; do sed -i "s#git://anonscm.debian.org/$TEAM/\([^/]*\)/\?#https://anonscm.debian.org/git/$TEAM/\1#g" debian/control View it on GitLab: https://salsa.debian.org/java-team/pkg-java-scripts/compare/dfca409b69751d307dd3ccd8783cac35b458555e...97c7811e8a97f124a8b78e7f64b3566ed01a874e --- View it on GitLab: https://salsa.debian.org/java-team/pkg-java-scripts/compare/dfca409b69751d307dd3ccd8783cac35b458555e...97c7811e8a97f124a8b78e7f64b3566ed01a874e You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ pkg-java-commits mailing list pkg-java-comm...@alioth-lists.debian.net https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-java-commits