annotate configure @ 357:2f379a0b6461 draft

Revert "Added git path (Atiti)" This reverts commit c964d8bbde489b54db02be6e399d9ab364265765. Setting configure to force bash is inappropriate. configure can use any shell with korn or compatible features, and on most systems /bin/sh points to such a shell. Ubutnu breaks compatibility by changing /bin/sh to dash. The solution is to fix Ubuntu, not to break the configure script.
author Nick <nick@somerandomnick.ano>
date Wed, 12 Jan 2011 07:20:11 +0000
parents 36e5f17d180c
children fd1945470e54
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
357
2f379a0b6461 Revert "Added git path (Atiti)"
Nick <nick@somerandomnick.ano>
parents: 356
diff changeset
1 #!/bin/sh
9
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
2
287
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
3 vars="gitd_ip gitd_basepath git_name git_email tinydns_config tinydns__tldsrvrname tinydns__tldsrvrip"
9
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
4
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
5 echo "Welcome to the resdb configurator!" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
6 echo >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
7
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
8 for var in $vars ; do
12
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
9 export "$var"="$(cat conf/$var 2>/dev/null)"
9
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
10 done
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
11 if [ x"$gitd_basepath" = x ]; then
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
12 gitd_basepath="$(pwd)/"
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
13 fi
287
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
14 if [ x"$git_name" = x ]; then
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
15 git_name="Anonymous Coward"
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
16 fi
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
17 if [ x"$git_email" = x ]; then
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
18 git_email="nobody@nowhere"
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
19 fi
12
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
20 if [ x"$tinydns_config" = x ]; then
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
21 tinydns_config=n
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
22 fi
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
23 if [ x"$tinydns__tldsrvrname" = x ]; then
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
24 tinydns__tldsrvrname="uz5fvb7zdqyuz4q8ysjdfuf04kzd2lrt0l6fp4uyguxdg5tfut06ck.anons.somerandomnick.ano"
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
25 fi
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
26 if [ x"$tinydns__tldsrvrip" = x ]; then
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
27 tinydns__tldsrvrip="1.0.27.37"
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
28 fi
9
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
29
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
30 echo "Please enter the IP address you'd like gitd to listen on." >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
31 echo "(Default: $gitd_ip)" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
32 echo -n "IP? " >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
33 read new_gitd_ip
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
34 if [ x"$new_gitd_ip" != x ]; then
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
35 gitd_ip="$new_gitd_ip"
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
36 fi
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
37
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
38 echo "Please enter the full path to resdb." >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
39 echo "(Default: $gitd_basepath)" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
40 echo -n "BasePath? " >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
41 read new_gitd_basepath
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
42 if [ x"$new_gitd_basepath" != x ]; then
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
43 gitd_basepath="$new_gitd_basepath"
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
44 fi
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
45
287
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
46 echo "Please enter your name." >&2
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
47 echo "(Default: $git_name)" >&2
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
48 echo -n "Name? " >&2
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
49 read new_git_name
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
50 if [ x"$new_git_name" != x ]; then
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
51 git_name="$new_git_name"
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
52 fi
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
53
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
54 echo "Please enter your email." >&2
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
55 echo "(Default: $git_email)" >&2
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
56 echo -n "Email? " >&2
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
57 read new_git_email
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
58 if [ x"$new_git_email" != x ]; then
288
2e7d34122df5 fixed a bug preventing the previous commit from working right
Nick <nick@somerandomnick.ano>
parents: 287
diff changeset
59 git_email="$new_git_email"
287
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
60 fi
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
61
12
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
62 echo -n "Would you like to configure the tinydns datafile generator? " >&2
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
63 read new_tinydns_config
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
64 if [ x"$new_tinydns_config" != x ]; then
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
65 tinydns_config="$new_tinydns_config"
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
66 fi
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
67 if [ x"$tinydns_config" = xy ]; then
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
68 echo "Please enter the hostname of your .ano TLD server." >&2
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
69 echo "(Default: $tinydns__tldsrvrname)" >&2
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
70 echo -n "TLDSrvName? " >&2
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
71 read new_tinydns__tldsrvrname
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
72 if [ x"$new_tinydns__tldsrvrname" != x ]; then
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
73 tinydns__tldsrvrname="$new_tinydns__tldsrvrname"
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
74 fi
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
75
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
76 echo "Please enter the IP address of your .ano TLD server." >&2
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
77 echo "(Default: $tinydns__tldsrvrip)" >&2
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
78 echo -n "TLDSrvIP? " >&2
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
79 read new_tinydns__tldsrvrip
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
80 if [ x"$new_tinydns__tldsrvrip" != x ]; then
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
81 tinydns__tldsrvrip="$new_tinydns__tldsrvrip"
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
82 fi
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
83 fi
41b330b11a33 coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents: 9
diff changeset
84
9
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
85 echo "Proposed configuration:" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
86 for var in $vars ; do
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
87 echo "$var=${!var}" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
88 done
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
89 echo -n "To write the configuration, hit RETURN. To abort, hit ^C: " >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
90 read write_config
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
91
287
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
92 echo -n "Writing configuration... " >&2
9
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
93 mkdir -p conf || exit 1
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
94 for var in $vars ; do
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
95 echo "${!var}" > conf/"$var" || exit 1
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
96 done
287
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
97 echo "Done" >&2
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
98
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
99 echo -n "Updating git configuration... " >&2
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
100 cd "$(cat ./conf/gitd_basepath)" || exit 1
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
101 git config user.name "$(cat ./conf/git_name)" || exit 1
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
102 git config user.email "$(cat ./conf/git_email)" || exit 1
b295bc1fe853 updated configure script to help hide identity
Nick <nick@somerandomnick.ano>
parents: 12
diff changeset
103 echo "Done" >&2