-
Notifications
You must be signed in to change notification settings - Fork 1
/
convert.sh
executable file
·74 lines (60 loc) · 2.83 KB
/
convert.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
# Migrate a Volute document repository to github
#
# Call with wg/project as argument, e.g. dal/ADQL
#
# Requirements:
# - git
# - git-svn
#
set -e
#PROJECT=dal/ADQL
#PROJECT=ivoapub/ivoatex
PROJECT=$1
# Subversion base URL (volute), to be completed with the project
SVNBASE=https://volute.g-vo.org/svn/trunk/projects
# List <author> = <email> to match svn users to email addresses
AUTHORSFILE=volute-users.txt
# File is scrambled a bit (rot13, gzip, base64)
if [ ! -e ${AUTHORSFILE} ] ; then
(base64 -d | gzip -d | tr 'A-Za-z@#<>{}' 'N-ZA-Mn-za-m#@{}<>') > ${AUTHORSFILE} <<EOF
H4sIAPZyB10CA51WS27jOBDd5xQCtA4XvZ+FJ0gC9KITI2lkkh0pkJQ9mRJZlmhTRM4zB5mLTfGj
RHbbgN0rsV7VI6li/Z4kcLNjr3iD2um6H8F5ZsRY/VE9JVVVVFV4OmH6cQUelAUnWS/hnZg/ilw9
RzlAhGtrFOs9MDCs3RFHCq2ireTC2+o2SiGB9YBgr80G2AByBdIytG0h1AfwJRt00GinNBLnYVo+
ojGCuypMSmYyUotONSPbSOKJVvaomIdWItdEfy2rh6wh9r7J3DcnVRfuYwizTrB+QO9REvsxI9Vz
QYKZlLVxHA0wpz+uLKycpQ1537qeC07EZYTo8E8oHBrNDz6tu3wrsU43vx9QooJqmeSQ4FppZVx+
KSvHLcXMAOPeYW+g9YDrGFWkIt4Rs4+rTQxT4VSJ4P/+jesHwTlI9FWY1KwrUA1KS8FaTs8vIb14
jzJGjcdRJYc9J5kyIclhT12PDbKx6ZlFIrrWO4iMtOC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A=
EOF
fi
# Github target user or organization. You need write access there.
GITHUB_USER=ivoa-std
# We use the last part of the project path as github repository name,
# since github does not do hierarchical repositories
REPO=$(echo $1 | sed s:.*/::)
git svn clone ${SVNBASE}/${PROJECT} --authors-file=${AUTHORSFILE} --no-metadata
cd ${REPO}
curl https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt > LICENSE
git add LICENSE
git commit -m "Include CC-BY-SA-4.0 license"
cat <<EOF
Now create a repository ${REPO} on https://github.com/${GITHUB_USER}/.
Then, push the converted directory:
cd ${REPO}
git remote add origin git@github.com:${GITHUB_USER}/${REPO}
git push --set-upstream origin master
EOF