summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSalvatore Bonaccorso <carnil@debian.org>2015-01-16 16:44:17 +0000
committerSalvatore Bonaccorso <carnil@debian.org>2015-01-16 16:44:17 +0000
commita6a81f56dbe02906f331d4b6b83754acd686435c (patch)
tree9f7a40a76cd1485d569779922eb39850b252cc0b /tools
parenta6bb24c258e45ab266597c0a35046944734a4337 (diff)
Add two example scripts to be used for svn to git conversion to generate AUTHORS.txt file
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@31387 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'tools')
-rwxr-xr-xtools/git-migration/AUTHOR54
-rwxr-xr-xtools/git-migration/fetch-authors10
2 files changed, 64 insertions, 0 deletions
diff --git a/tools/git-migration/AUTHOR b/tools/git-migration/AUTHOR
new file mode 100755
index 0000000000..08a5a8169f
--- /dev/null
+++ b/tools/git-migration/AUTHOR
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+set -u
+
+usage() {
+ echo "Syntax: $0 <author>"
+}
+[ -n "${1:-}" ] && [ -z "${2:-}" ] || usage
+
+author="$1"
+real_author=$author
+full_name=`getent passwd $author | cut -d: -f5 | sed 's/,.\+//'`;
+
+if [ -z "$full_name" ]; then
+ echo "Unable to get account information for $author" >& 2
+ if echo $author | grep -q -E -- '-guest$'; then
+ echo " trying without -guest suffix" >& 2
+ author=`echo $author | sed 's/-guest$//'`
+ full_name=`getent passwd $author | cut -d: -f5 | sed 's/,.\+//'`;
+ if [ -z "$full_name" ]; then
+ echo "Unable to get account information for $author" >& 2
+ echo " trying a hard-coded list of DDs" >& 2
+ author=`echo $author | sed 's/xaviero/xoswald/; s/hanska/dapal/; s/kitterma/kitterman/; s/ra28145/jjr/; s/ryan52/ryan/; s/thialme/franck/'`
+ full_name=`getent passwd $author | cut -d: -f5 | sed 's/,.\+//'`;
+ if [ -z "$full_name" ]; then
+ echo "NO MORE WORKAROUNDS: Unable to get account information for $author" >& 2
+ exit 0
+ fi
+ fi
+ else
+ exit 0
+ fi
+fi
+
+if which curl > /dev/null; then
+ CURL='curl -s'
+else
+ CURL='wget -q -O -'
+fi
+
+if echo $author | grep -E -q -e '-guest$'; then
+ email=`$CURL https://alioth.debian.org/users/$author/ | grep sendmessage|grep touser|grep nospam|sed 's,.*<strong>.*<a href[^>]\+>,,; s/<.*//; s/ @nospam@ /@/'`;
+
+ if [ -z "$email" ]; then
+ email="$author@users.alioth.debian.org";
+ fi;
+else
+ email="$author@debian.org";
+fi;
+
+echo "$real_author = $full_name <$email>"
+
+# vim: set et sw=4 sts=4 ts=8 tw=78 ai :
diff --git a/tools/git-migration/fetch-authors b/tools/git-migration/fetch-authors
new file mode 100755
index 0000000000..111497b1a1
--- /dev/null
+++ b/tools/git-migration/fetch-authors
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+svn log --xml svn://svn.debian.org/svn/secure-testing \
+ | sed '/<author>/! d; s,<author>,,; s,</author>,,' > authors
+sort authors | uniq > authors.uniq
+cat authors.uniq | \
+ while read a; do
+ /srv/home/users/carnil/scripts/AUTHOR $a >> AUTHORS.txt
+ done

© 2014-2024 Faster IT GmbH | imprint | privacy policy