[packages] git: update to 1.9.1
[openwrt/svn-archive/archive.git] / net / git / patches / 100-convert_builtin.patch
1 --- a/Makefile
2 +++ b/Makefile
3 @@ -533,16 +533,7 @@ EXTRA_PROGRAMS =
4 # ... and all the rest that could be moved out of bindir to gitexecdir
5 PROGRAMS += $(EXTRA_PROGRAMS)
6
7 -PROGRAM_OBJS += credential-store.o
8 -PROGRAM_OBJS += daemon.o
9 -PROGRAM_OBJS += fast-import.o
10 -PROGRAM_OBJS += http-backend.o
11 -PROGRAM_OBJS += imap-send.o
12 -PROGRAM_OBJS += sh-i18n--envsubst.o
13 -PROGRAM_OBJS += shell.o
14 -PROGRAM_OBJS += show-index.o
15 -PROGRAM_OBJS += upload-pack.o
16 -PROGRAM_OBJS += remote-testsvn.o
17 +PROGRAM_OBJS =
18
19 # Binary suffix, set to .exe for Windows builds
20 X =
21 @@ -990,6 +981,12 @@ BUILTIN_OBJS += builtin/var.o
22 BUILTIN_OBJS += builtin/verify-pack.o
23 BUILTIN_OBJS += builtin/verify-tag.o
24 BUILTIN_OBJS += builtin/write-tree.o
25 +BUILTIN_OBJS += builtin/daemon.o
26 +BUILTIN_OBJS += builtin/fast-import.o
27 +BUILTIN_OBJS += builtin/http-backend.o
28 +BUILTIN_OBJS += builtin/imap-send.o
29 +BUILTIN_OBJS += builtin/shell.o
30 +BUILTIN_OBJS += builtin/upload-pack.o
31
32 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
33 EXTLIBS =
34 @@ -1153,7 +1150,7 @@ endif
35 EXTLIBS += -lz
36
37 ifndef NO_OPENSSL
38 - OPENSSL_LIBSSL = -lssl
39 + EXTLIBS += -lssl
40 ifdef OPENSSLDIR
41 BASIC_CFLAGS += -I$(OPENSSLDIR)/include
42 OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
43 @@ -2046,10 +2043,6 @@ endif
44 git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
45 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
46
47 -git-imap-send$X: imap-send.o GIT-LDFLAGS $(GITLIBS)
48 - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
49 - $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
50 -
51 git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
52 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
53 $(LIBS) $(CURL_LIBCURL)
54 @@ -2358,24 +2351,22 @@ endif
55 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
56 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
57 { test "$$bindir/" = "$$execdir/" || \
58 - for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
59 + for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
60 $(RM) "$$execdir/$$p" && \
61 test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
62 - ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
63 + ln -s git "$$execdir/$$p" 2>/dev/null || \
64 cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
65 done; \
66 } && \
67 for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
68 $(RM) "$$bindir/$$p" && \
69 test -z "$(NO_INSTALL_HARDLINKS)" && \
70 - ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
71 ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
72 cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
73 done && \
74 for p in $(BUILT_INS); do \
75 $(RM) "$$execdir/$$p" && \
76 test -z "$(NO_INSTALL_HARDLINKS)" && \
77 - ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
78 ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
79 cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
80 done && \
81 --- a/builtin.h
82 +++ b/builtin.h
83 @@ -136,5 +136,11 @@ extern int cmd_verify_pack(int argc, con
84 extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
85 extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
86 extern int cmd_replace(int argc, const char **argv, const char *prefix);
87 +extern int cmd_daemon(int argc, char **argv, const char *prefix);
88 +extern int cmd_fast_import(int argc, char **argv, const char *prefix);
89 +extern int cmd_http_backend(int argc, char **argv, const char *prefix);
90 +extern int cmd_imap_send(int argc, char **argv, const char *prefix);
91 +extern int cmd_shell(int argc, char **argv, const char *prefix);
92 +extern int cmd_upload_pack(int argc, char **argv, const char *prefix);
93
94 #endif
95 --- /dev/null
96 +++ b/builtin/daemon.c
97 @@ -0,0 +1 @@
98 +#include "../daemon.c"
99 --- /dev/null
100 +++ b/builtin/fast-import.c
101 @@ -0,0 +1 @@
102 +#include "../fast-import.c"
103 --- /dev/null
104 +++ b/builtin/http-backend.c
105 @@ -0,0 +1 @@
106 +#include "../http-backend.c"
107 --- /dev/null
108 +++ b/builtin/imap-send.c
109 @@ -0,0 +1 @@
110 +#include "../imap-send.c"
111 --- /dev/null
112 +++ b/builtin/shell.c
113 @@ -0,0 +1 @@
114 +#include "../shell.c"
115 --- /dev/null
116 +++ b/builtin/upload-pack.c
117 @@ -0,0 +1 @@
118 +#include "../upload-pack.c"
119 --- a/daemon.c
120 +++ b/daemon.c
121 @@ -1148,7 +1148,7 @@ static int serve(struct string_list *lis
122 return service_loop(&socklist);
123 }
124
125 -int main(int argc, char **argv)
126 +int cmd_daemon(int argc, char **argv, const char *prefix)
127 {
128 int listen_port = 0;
129 struct string_list listen_addr = STRING_LIST_INIT_NODUP;
130 --- a/fast-import.c
131 +++ b/fast-import.c
132 @@ -3365,7 +3365,7 @@ static void parse_argv(void)
133 read_marks();
134 }
135
136 -int main(int argc, char **argv)
137 +int cmd_fast_import(int argc, char **argv, const char *prefix)
138 {
139 unsigned int i;
140
141 --- a/git.c
142 +++ b/git.c
143 @@ -275,11 +275,11 @@ static int handle_alias(int *argcp, cons
144
145 struct cmd_struct {
146 const char *cmd;
147 - int (*fn)(int, const char **, const char *);
148 + int (*fn)(int, char **, const char *);
149 int option;
150 };
151
152 -static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
153 +static int run_builtin(struct cmd_struct *p, int argc, char **argv)
154 {
155 int status, help;
156 struct stat st;
157 @@ -359,6 +359,7 @@ static struct cmd_struct commands[] = {
158 { "config", cmd_config, RUN_SETUP_GENTLY },
159 { "count-objects", cmd_count_objects, RUN_SETUP },
160 { "credential", cmd_credential, RUN_SETUP_GENTLY },
161 + { "daemon", cmd_daemon },
162 { "describe", cmd_describe, RUN_SETUP },
163 { "diff", cmd_diff },
164 { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE },
165 @@ -377,6 +378,8 @@ static struct cmd_struct commands[] = {
166 { "grep", cmd_grep, RUN_SETUP_GENTLY },
167 { "hash-object", cmd_hash_object },
168 { "help", cmd_help },
169 + { "http-backend", cmd_http_backend },
170 + { "imap-send", cmd_imap_send },
171 { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
172 { "init", cmd_init_db },
173 { "init-db", cmd_init_db },
174 @@ -424,6 +427,7 @@ static struct cmd_struct commands[] = {
175 { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
176 { "rm", cmd_rm, RUN_SETUP },
177 { "send-pack", cmd_send_pack, RUN_SETUP },
178 + { "shell", cmd_shell },
179 { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
180 { "show", cmd_show, RUN_SETUP },
181 { "show-branch", cmd_show_branch, RUN_SETUP },
182 @@ -440,6 +444,7 @@ static struct cmd_struct commands[] = {
183 { "update-server-info", cmd_update_server_info, RUN_SETUP },
184 { "upload-archive", cmd_upload_archive },
185 { "upload-archive--writer", cmd_upload_archive_writer },
186 + { "upload-pack", cmd_upload_pack },
187 { "var", cmd_var, RUN_SETUP_GENTLY },
188 { "verify-pack", cmd_verify_pack },
189 { "verify-tag", cmd_verify_tag, RUN_SETUP },
190 --- a/http-backend.c
191 +++ b/http-backend.c
192 @@ -563,7 +563,7 @@ static struct service_cmd {
193 {"POST", "/git-receive-pack$", service_rpc}
194 };
195
196 -int main(int argc, char **argv)
197 +int cmd_http_backend(int argc, char **argv, const char *prefix)
198 {
199 char *method = getenv("REQUEST_METHOD");
200 char *dir;
201 --- a/imap-send.c
202 +++ b/imap-send.c
203 @@ -1362,7 +1362,7 @@ static int git_imap_config(const char *k
204 return 0;
205 }
206
207 -int main(int argc, char **argv)
208 +int cmd_imap_send(int argc, char **argv, const char *prefix)
209 {
210 struct strbuf all_msgs = STRBUF_INIT;
211 struct strbuf msg = STRBUF_INIT;
212 --- a/shell.c
213 +++ b/shell.c
214 @@ -142,7 +142,7 @@ static struct commands {
215 { NULL },
216 };
217
218 -int main(int argc, char **argv)
219 +int cmd_shell(int argc, char **argv, const char *prefix)
220 {
221 char *prog;
222 const char **user_argv;
223 --- a/upload-pack.c
224 +++ b/upload-pack.c
225 @@ -786,7 +786,7 @@ static int upload_pack_config(const char
226 return parse_hide_refs_config(var, value, "uploadpack");
227 }
228
229 -int main(int argc, char **argv)
230 +int cmd_upload_pack(int argc, char **argv, const char *prefix)
231 {
232 char *dir;
233 int i;