-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimport
More file actions
executable file
·41 lines (33 loc) · 998 Bytes
/
import
File metadata and controls
executable file
·41 lines (33 loc) · 998 Bytes
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
#!/bin/sh
set -e
mydir="$(cd "$(dirname "$0")" && pwd)"
cd "$mydir"
SQLSRC='http://sqlite.org/src'
for util in ./fossil ./git-export-filter git; do
if ! command -v $util > /dev/null; then
echo Missing $util '(did you run the build script?)' >&2
exit 1
fi
done
if ! [ -e sqlite.fsl ]; then
echo "Cloning $SQLSRC into sqlite.fsl" >&2
./fossil clone "$SQLSRC" sqlite.fsl
else
echo "Updating sqlite.fsl from $SQLSRC" >&2
./fossil pull -R sqlite.fsl
fi
created=
if ! [ -r sqlite.git/HEAD ]; then
echo "Creating initial sqlite.git repository" >&2
git --git-dir=sqlite.git init --bare
created=1
fi
echo "Exporting from sqlite.fsl into sqlite.git" >&2
./fossil export --git sqlite.fsl | \
./git-export-filter --authors-file sqlite_authors --require-authors \
--trunk-is-master --convert-tagger tagger | \
git --git-dir=sqlite.git fast-import --force
if [ -n "$created" ]; then
echo "Compacting sqlite.git" >&2
git --git-dir=sqlite.git gc --aggressive --prune=now
fi