Merge pull request #2126 from lynxis/libmicrohttpd
[feed/packages.git] / net / git / patches / 100-convert_builtin.patch
1 --- a/Makefile
2 +++ b/Makefile
3 @@ -559,16 +559,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
18 # Binary suffix, set to .exe for Windows builds
19 X =
20 @@ -929,6 +920,11 @@ BUILTIN_OBJS += builtin/verify-pack.o
21 BUILTIN_OBJS += builtin/verify-tag.o
22 BUILTIN_OBJS += builtin/worktree.o
23 BUILTIN_OBJS += builtin/write-tree.o
24 +BUILTIN_OBJS += builtin/daemon.o
25 +BUILTIN_OBJS += builtin/fast-import.o
26 +BUILTIN_OBJS += builtin/imap-send.o
27 +BUILTIN_OBJS += builtin/shell.o
28 +BUILTIN_OBJS += builtin/upload-pack.o
29
30 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
31 EXTLIBS =
32 @@ -1112,7 +1108,7 @@ endif
33 EXTLIBS += -lz
34
35 ifndef NO_OPENSSL
36 - OPENSSL_LIBSSL = -lssl
37 + EXTLIBS += -lssl
38 ifdef OPENSSLDIR
39 BASIC_CFLAGS += -I$(OPENSSLDIR)/include
40 OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
41 @@ -1989,10 +1985,6 @@ endif
42 git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
43 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
44
45 -git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
46 - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
47 - $(LIBS) $(IMAP_SEND_LDFLAGS)
48 -
49 git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
50 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
51 $(CURL_LIBCURL) $(LIBS)
52 @@ -2312,10 +2304,11 @@ endif
53 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
54 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
55 { test "$$bindir/" = "$$execdir/" || \
56 - for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
57 + for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
58 $(RM) "$$execdir/$$p" && \
59 test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
60 ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
61 + ln -s git "$$execdir/$$p" 2>/dev/null || \
62 cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
63 done; \
64 } && \
65 --- a/builtin.h
66 +++ b/builtin.h
67 @@ -142,5 +142,10 @@ extern int cmd_verify_pack(int argc, con
68 extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
69 extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
70 extern int cmd_replace(int argc, const char **argv, const char *prefix);
71 +extern int cmd_daemon(int argc, char **argv, const char *prefix);
72 +extern int cmd_fast_import(int argc, char **argv, const char *prefix);
73 +extern int cmd_imap_send(int argc, char **argv, const char *prefix);
74 +extern int cmd_shell(int argc, char **argv, const char *prefix);
75 +extern int cmd_upload_pack(int argc, char **argv, const char *prefix);
76
77 #endif
78 --- /dev/null
79 +++ b/builtin/daemon.c
80 @@ -0,0 +1 @@
81 +#include "../daemon.c"
82 --- /dev/null
83 +++ b/builtin/fast-import.c
84 @@ -0,0 +1 @@
85 +#include "../fast-import.c"
86 --- /dev/null
87 +++ b/builtin/imap-send.c
88 @@ -0,0 +1 @@
89 +#include "../imap-send.c"
90 --- /dev/null
91 +++ b/builtin/shell.c
92 @@ -0,0 +1 @@
93 +#include "../shell.c"
94 --- /dev/null
95 +++ b/builtin/upload-pack.c
96 @@ -0,0 +1 @@
97 +#include "../upload-pack.c"
98 --- a/daemon.c
99 +++ b/daemon.c
100 @@ -1178,7 +1178,7 @@ static int serve(struct string_list *lis
101 return service_loop(&socklist);
102 }
103
104 -int main(int argc, char **argv)
105 +int cmd_daemon(int argc, char **argv, const char *prefix)
106 {
107 int listen_port = 0;
108 struct string_list listen_addr = STRING_LIST_INIT_NODUP;
109 @@ -1374,6 +1374,7 @@ int main(int argc, char **argv)
110 write_file(pid_file, "%"PRIuMAX, (uintmax_t) getpid());
111
112 /* prepare argv for serving-processes */
113 + argv_array_push(&cld_argv, "git"); /* git-daemon */
114 argv_array_push(&cld_argv, argv[0]); /* git-daemon */
115 argv_array_push(&cld_argv, "--serve");
116 for (i = 1; i < argc; ++i)
117 --- a/fast-import.c
118 +++ b/fast-import.c
119 @@ -3381,7 +3381,7 @@ static void parse_argv(void)
120 read_marks();
121 }
122
123 -int main(int argc, char **argv)
124 +int cmd_fast_import(int argc, char **argv, const char *prefix)
125 {
126 unsigned int i;
127
128 --- a/git.c
129 +++ b/git.c
130 @@ -307,11 +307,11 @@ static int handle_alias(int *argcp, cons
131
132 struct cmd_struct {
133 const char *cmd;
134 - int (*fn)(int, const char **, const char *);
135 + int (*fn)(int, char **, const char *);
136 int option;
137 };
138
139 -static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
140 +static int run_builtin(struct cmd_struct *p, int argc, char **argv)
141 {
142 int status, help;
143 struct stat st;
144 @@ -392,6 +392,7 @@ static struct cmd_struct commands[] = {
145 { "config", cmd_config, RUN_SETUP_GENTLY },
146 { "count-objects", cmd_count_objects, RUN_SETUP },
147 { "credential", cmd_credential, RUN_SETUP_GENTLY },
148 + { "daemon", cmd_daemon },
149 { "describe", cmd_describe, RUN_SETUP },
150 { "diff", cmd_diff },
151 { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE },
152 @@ -410,6 +411,7 @@ static struct cmd_struct commands[] = {
153 { "grep", cmd_grep, RUN_SETUP_GENTLY },
154 { "hash-object", cmd_hash_object },
155 { "help", cmd_help },
156 + { "imap-send", cmd_imap_send },
157 { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
158 { "init", cmd_init_db, NO_SETUP },
159 { "init-db", cmd_init_db, NO_SETUP },
160 @@ -459,6 +461,7 @@ static struct cmd_struct commands[] = {
161 { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
162 { "rm", cmd_rm, RUN_SETUP },
163 { "send-pack", cmd_send_pack, RUN_SETUP },
164 + { "shell", cmd_shell },
165 { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
166 { "show", cmd_show, RUN_SETUP },
167 { "show-branch", cmd_show_branch, RUN_SETUP },
168 @@ -476,6 +479,7 @@ static struct cmd_struct commands[] = {
169 { "update-server-info", cmd_update_server_info, RUN_SETUP },
170 { "upload-archive", cmd_upload_archive },
171 { "upload-archive--writer", cmd_upload_archive_writer },
172 + { "upload-pack", cmd_upload_pack },
173 { "var", cmd_var, RUN_SETUP_GENTLY },
174 { "verify-commit", cmd_verify_commit, RUN_SETUP },
175 { "verify-pack", cmd_verify_pack },
176 --- a/imap-send.c
177 +++ b/imap-send.c
178 @@ -1494,7 +1494,7 @@ static int curl_append_msgs_to_imap(stru
179 }
180 #endif
181
182 -int main(int argc, char **argv)
183 +int cmd_imap_send(int argc, char **argv, const char *prefix)
184 {
185 struct strbuf all_msgs = STRBUF_INIT;
186 int total;
187 --- a/shell.c
188 +++ b/shell.c
189 @@ -138,7 +138,7 @@ static struct commands {
190 { NULL },
191 };
192
193 -int main(int argc, char **argv)
194 +int cmd_shell(int argc, char **argv, const char *prefix)
195 {
196 char *prog;
197 const char **user_argv;
198 --- a/upload-pack.c
199 +++ b/upload-pack.c
200 @@ -820,7 +820,7 @@ static int upload_pack_config(const char
201 return parse_hide_refs_config(var, value, "uploadpack");
202 }
203
204 -int main(int argc, char **argv)
205 +int cmd_upload_pack(int argc, char **argv, const char *prefix)
206 {
207 char *dir;
208 int i;