[packages] git: update to 1.8.4.2
[openwrt/svn-archive/archive.git] / net / git / patches / 100-convert_builtin.patch
1 --- a/Makefile
2 +++ b/Makefile
3 @@ -537,16 +537,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 @@ -993,6 +984,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 @@ -1156,7 +1153,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 @@ -2040,10 +2037,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: revision.o 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 @@ -2355,24 +2348,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 @@ -134,5 +134,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 @@ -3347,7 +3347,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 @@ -252,11 +252,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 @@ -309,7 +309,7 @@ static int run_builtin(struct cmd_struct
158 return 0;
159 }
160
161 -static void handle_internal_command(int argc, const char **argv)
162 +static void handle_internal_command(int argc, char **argv)
163 {
164 const char *cmd = argv[0];
165 static struct cmd_struct commands[] = {
166 @@ -338,6 +338,7 @@ static void handle_internal_command(int
167 { "commit-tree", cmd_commit_tree, RUN_SETUP },
168 { "config", cmd_config, RUN_SETUP_GENTLY },
169 { "count-objects", cmd_count_objects, RUN_SETUP },
170 + { "daemon", cmd_daemon },
171 { "credential", cmd_credential, RUN_SETUP_GENTLY },
172 { "describe", cmd_describe, RUN_SETUP },
173 { "diff", cmd_diff },
174 @@ -345,6 +346,7 @@ static void handle_internal_command(int
175 { "diff-index", cmd_diff_index, RUN_SETUP },
176 { "diff-tree", cmd_diff_tree, RUN_SETUP },
177 { "fast-export", cmd_fast_export, RUN_SETUP },
178 + { "fast-import", cmd_fast_import },
179 { "fetch", cmd_fetch, RUN_SETUP },
180 { "fetch-pack", cmd_fetch_pack, RUN_SETUP },
181 { "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP },
182 @@ -357,6 +359,8 @@ static void handle_internal_command(int
183 { "grep", cmd_grep, RUN_SETUP_GENTLY },
184 { "hash-object", cmd_hash_object },
185 { "help", cmd_help },
186 + { "http-backend", cmd_http_backend },
187 + { "imap-send", cmd_imap_send },
188 { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
189 { "init", cmd_init_db },
190 { "init-db", cmd_init_db },
191 @@ -405,6 +409,7 @@ static void handle_internal_command(int
192 { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
193 { "rm", cmd_rm, RUN_SETUP },
194 { "send-pack", cmd_send_pack, RUN_SETUP },
195 + { "shell", cmd_shell },
196 { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
197 { "show", cmd_show, RUN_SETUP },
198 { "show-branch", cmd_show_branch, RUN_SETUP },
199 @@ -422,6 +427,7 @@ static void handle_internal_command(int
200 { "update-server-info", cmd_update_server_info, RUN_SETUP },
201 { "upload-archive", cmd_upload_archive },
202 { "upload-archive--writer", cmd_upload_archive_writer },
203 + { "upload-pack", cmd_upload_pack },
204 { "var", cmd_var, RUN_SETUP_GENTLY },
205 { "verify-pack", cmd_verify_pack },
206 { "verify-tag", cmd_verify_tag, RUN_SETUP },
207 --- a/http-backend.c
208 +++ b/http-backend.c
209 @@ -563,7 +563,7 @@ static struct service_cmd {
210 {"POST", "/git-receive-pack$", service_rpc}
211 };
212
213 -int main(int argc, char **argv)
214 +int cmd_http_backend(int argc, char **argv, const char *prefix)
215 {
216 char *method = getenv("REQUEST_METHOD");
217 char *dir;
218 --- a/imap-send.c
219 +++ b/imap-send.c
220 @@ -1376,7 +1376,7 @@ static int git_imap_config(const char *k
221 return 0;
222 }
223
224 -int main(int argc, char **argv)
225 +int cmd_imap_send(int argc, char **argv, const char *prefix)
226 {
227 struct strbuf all_msgs = STRBUF_INIT;
228 struct strbuf msg = STRBUF_INIT;
229 --- a/shell.c
230 +++ b/shell.c
231 @@ -142,7 +142,7 @@ static struct commands {
232 { NULL },
233 };
234
235 -int main(int argc, char **argv)
236 +int cmd_shell(int argc, char **argv, const char *prefix)
237 {
238 char *prog;
239 const char **user_argv;
240 --- a/upload-pack.c
241 +++ b/upload-pack.c
242 @@ -747,7 +747,7 @@ static int upload_pack_config(const char
243 return parse_hide_refs_config(var, value, "uploadpack");
244 }
245
246 -int main(int argc, char **argv)
247 +int cmd_upload_pack(int argc, char **argv, const char *prefix)
248 {
249 char *dir;
250 int i;