forked from enthought/comtypes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextract-comtypes-repo
More file actions
executable file
·61 lines (50 loc) · 2.14 KB
/
extract-comtypes-repo
File metadata and controls
executable file
·61 lines (50 loc) · 2.14 KB
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
#!/bin/sh
# This script extracts the comtypes repository from the svn.python.org repository.
if test ! -d mirror
then {
svnadmin create mirror
cat <<'EOF' > mirror/hooks/pre-revprop-change
#!/bin/sh
USER="$3"
if [ "$USER" = "svnsync" ]; then exit 0; fi
echo "Only the svnsync user can change revprops" >&2
exit 1
EOF
chmod +x mirror/hooks/pre-revprop-change
svnsync init --username svnsync file://`pwd`/mirror http://svn.python.org/projects/
}
fi
svnsync sync file://`pwd`/mirror
if test ! -f svn.python.org-dumpfile
then {
echo "Dumping svn.python.org SVN repository mirror, this may take an hour or so."
svnadmin dump ./mirror -r 40000:HEAD > svn.python.org-dumpfile
} fi
if test ! -f ctypes-dumpfile
then {
rm -fr comtypes-dumpfile
echo "Filtering ctypes out of the svn.python.org SVN repository dumpfile, this may take some minutes."
# It is important that we use svndumpfilter first to create a smaller dumpfile (5 GB reduced to 120 MB),
# otherwise svndumpfilter2 below will run out of memory.
cat svn.python.org-dumpfile | svndumpfilter include ctypes >ctypes-dumpfile
} fi
if test ! -f comtypes-dumpfile
then {
rm -fr comtypes-repo
echo "Filtering comtypes out of the ctypes dumpfile, this may take some minutes."
# We include ctypes/trunk/comtypes, ctypes/branches/comtypes*, ctypes/tags/comtypes*
# Then we strip off the ctypes/ prefix, and rewrite 'trunk/comtypes' into 'trunk'
cat ctypes-dumpfile | ./svndumpfilter2 --drop-empty-revs --renumber-revs ./mirror ctypes/trunk/comtypes ctypes/branches/comtypes* ctypes/tags/comtypes* | sed "s/-path: ctypes\//-path: /g" | sed "s/-path: trunk\/comtypes/-path: trunk/g" >comtypes-dumpfile
} fi
if test ! -d comtypes-repo
then {
svnadmin create comtypes-repo
svn mkdir file://`pwd`/comtypes-repo/branches -m "Create initial structure"
svn mkdir file://`pwd`/comtypes-repo/tags -m "Create initial structure"
svnadmin load comtypes-repo < comtypes-dumpfile
} fi
# Create the dumpfile
svnadmin dump ./comtypes-repo | bzip2 > sfimportcomtypes.bz2
# and test it.
svnadmin create ./new-comtypes-repo
bzcat sfimportcomtypes.bz2 | svnadmin load ./new-comtypes-repo