source: packages/net/git/patches/110-convert_builtin.patch @ 26976

Last change on this file since 26976 was 26976, checked in by luka, 6 years ago

git package; cleaning up my mess

File size: 9.4 KB
  • new file uiltin/daemon.c

    - +  
     1#include "../daemon.c" 
  • new file uiltin/fast-import.c

    - +  
     1#include "../fast-import.c" 
  • new file uiltin/http-backend.c

    - +  
     1#include "../http-backend.c" 
  • new file uiltin/imap-send.c

    - +  
     1#include "../imap-send.c" 
  • new file uiltin/shell.c

    - +  
     1#include "../shell.c" 
  • new file uiltin/upload-pack.c

    - +  
     1#include "../upload-pack.c" 
  • builtin.h

    a b extern int cmd_verify_pack(int argc, con 
    143143extern int cmd_show_ref(int argc, const char **argv, const char *prefix); 
    144144extern int cmd_pack_refs(int argc, const char **argv, const char *prefix); 
    145145extern int cmd_replace(int argc, const char **argv, const char *prefix); 
     146extern int cmd_shell(int argc, char **argv, const char *prefix); 
     147extern int cmd_upload_pack(int argc, char **argv, const char *prefix); 
     148extern int cmd_http_backend(int argc, char **argv, const char *prefix); 
     149extern int cmd_daemon(int argc, char **argv, const char *prefix); 
     150extern int cmd_imap_send(int argc, char **argv, const char *prefix); 
     151extern int cmd_fast_import(int argc, const char **argv, const char *prefix); 
    146152 
    147153#endif 
  • daemon.c

    a b static int serve(struct string_list *lis 
    10431043        return service_loop(&socklist); 
    10441044} 
    10451045 
    1046 int main(int argc, char **argv) 
     1046int cmd_daemon(int argc, char **argv, const char *prefix) 
    10471047{ 
    10481048        int listen_port = 0; 
    10491049        struct string_list listen_addr = STRING_LIST_INIT_NODUP; 
  • fast-import.c

    a b static void parse_argv(void) 
    32423242                read_marks(); 
    32433243} 
    32443244 
    3245 int main(int argc, const char **argv) 
     3245int cmd_fast_import(int argc, const char **argv, const char *prefix) 
    32463246{ 
    32473247        unsigned int i; 
    32483248 
  • git.c

    a b const char git_version_string[] = GIT_VE 
    251251 
    252252struct cmd_struct { 
    253253        const char *cmd; 
    254         int (*fn)(int, const char **, const char *); 
     254        int (*fn)(int, char **, const char *); 
    255255        int option; 
    256256}; 
    257257 
    258 static int run_builtin(struct cmd_struct *p, int argc, const char **argv) 
     258static int run_builtin(struct cmd_struct *p, int argc, char **argv) 
    259259{ 
    260260        int status, help; 
    261261        struct stat st; 
    static int run_builtin(struct cmd_struct 
    308308        return 0; 
    309309} 
    310310 
    311 static void handle_internal_command(int argc, const char **argv) 
     311static void handle_internal_command(int argc, char **argv) 
    312312{ 
    313313        const char *cmd = argv[0]; 
    314314        static struct cmd_struct commands[] = { 
    static void handle_internal_command(int 
    322322                { "bundle", cmd_bundle, RUN_SETUP_GENTLY }, 
    323323                { "cat-file", cmd_cat_file, RUN_SETUP }, 
    324324                { "check-attr", cmd_check_attr, RUN_SETUP }, 
    325                 { "check-ref-format", cmd_check_ref_format }, 
    326325                { "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE }, 
    327                 { "checkout-index", cmd_checkout_index, 
    328                         RUN_SETUP | NEED_WORK_TREE}, 
     326                { "checkout-index", cmd_checkout_index, RUN_SETUP | NEED_WORK_TREE}, 
     327                { "check-ref-format", cmd_check_ref_format }, 
    329328                { "cherry", cmd_cherry, RUN_SETUP }, 
    330329                { "cherry-pick", cmd_cherry_pick, RUN_SETUP | NEED_WORK_TREE }, 
    331330                { "clean", cmd_clean, RUN_SETUP | NEED_WORK_TREE }, 
    static void handle_internal_command(int 
    334333                { "commit-tree", cmd_commit_tree, RUN_SETUP }, 
    335334                { "config", cmd_config, RUN_SETUP_GENTLY }, 
    336335                { "count-objects", cmd_count_objects, RUN_SETUP }, 
     336                { "daemon", cmd_daemon }, 
    337337                { "describe", cmd_describe, RUN_SETUP }, 
    338338                { "diff", cmd_diff }, 
    339339                { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE }, 
    340340                { "diff-index", cmd_diff_index, RUN_SETUP }, 
    341341                { "diff-tree", cmd_diff_tree, RUN_SETUP }, 
    342342                { "fast-export", cmd_fast_export, RUN_SETUP }, 
     343                { "fast-import", cmd_fast_import }, 
    343344                { "fetch", cmd_fetch, RUN_SETUP }, 
    344345                { "fetch-pack", cmd_fetch_pack, RUN_SETUP }, 
    345346                { "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP }, 
    static void handle_internal_command(int 
    352353                { "grep", cmd_grep, RUN_SETUP_GENTLY }, 
    353354                { "hash-object", cmd_hash_object }, 
    354355                { "help", cmd_help }, 
     356                { "http-backend", cmd_http_backend }, 
     357                { "imap-send", cmd_imap_send }, 
    355358                { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY }, 
    356359                { "init", cmd_init_db }, 
    357360                { "init-db", cmd_init_db }, 
    static void handle_internal_command(int 
    361364                { "ls-tree", cmd_ls_tree, RUN_SETUP }, 
    362365                { "mailinfo", cmd_mailinfo }, 
    363366                { "mailsplit", cmd_mailsplit }, 
    364                 { "merge", cmd_merge, RUN_SETUP | NEED_WORK_TREE }, 
    365367                { "merge-base", cmd_merge_base, RUN_SETUP }, 
     368                { "merge", cmd_merge, RUN_SETUP | NEED_WORK_TREE }, 
    366369                { "merge-file", cmd_merge_file, RUN_SETUP_GENTLY }, 
    367370                { "merge-index", cmd_merge_index, RUN_SETUP }, 
    368371                { "merge-ours", cmd_merge_ours, RUN_SETUP }, 
    static void handle_internal_command(int 
    395398                { "repo-config", cmd_repo_config, RUN_SETUP_GENTLY }, 
    396399                { "rerere", cmd_rerere, RUN_SETUP }, 
    397400                { "reset", cmd_reset, RUN_SETUP }, 
     401                { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE }, 
    398402                { "rev-list", cmd_rev_list, RUN_SETUP }, 
    399403                { "rev-parse", cmd_rev_parse }, 
    400                 { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE }, 
    401404                { "rm", cmd_rm, RUN_SETUP }, 
    402405                { "send-pack", cmd_send_pack, RUN_SETUP }, 
     406                { "shell", cmd_shell }, 
    403407                { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER }, 
    404                 { "show", cmd_show, RUN_SETUP }, 
    405408                { "show-branch", cmd_show_branch, RUN_SETUP }, 
     409                { "show", cmd_show, RUN_SETUP }, 
    406410                { "show-ref", cmd_show_ref, RUN_SETUP }, 
    407411                { "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE }, 
    408412                { "status", cmd_status, RUN_SETUP | NEED_WORK_TREE }, 
    static void handle_internal_command(int 
    416420                { "update-ref", cmd_update_ref, RUN_SETUP }, 
    417421                { "update-server-info", cmd_update_server_info, RUN_SETUP }, 
    418422                { "upload-archive", cmd_upload_archive }, 
     423                { "upload-pack", cmd_upload_pack }, 
    419424                { "var", cmd_var, RUN_SETUP_GENTLY }, 
    420425                { "verify-pack", cmd_verify_pack }, 
    421426                { "verify-tag", cmd_verify_tag, RUN_SETUP }, 
  • http-backend.c

    a b static struct service_cmd { 
    540540        {"POST", "/git-receive-pack$", service_rpc} 
    541541}; 
    542542 
    543 int main(int argc, char **argv) 
     543int cmd_http_backend(int argc, char **argv, const char *prefix) 
    544544{ 
    545545        char *method = getenv("REQUEST_METHOD"); 
    546546        char *dir; 
  • imap-send.c

    a b static int git_imap_config(const char *k 
    15281528        return 0; 
    15291529} 
    15301530 
    1531 int main(int argc, char **argv) 
     1531int cmd_imap_send(int argc, char **argv, const char *prefix) 
    15321532{ 
    15331533        struct msg_data all_msgs, msg; 
    15341534        struct store *ctx = NULL; 
  • Makefile

    a b EXTRA_PROGRAMS = 
    407407# ... and all the rest that could be moved out of bindir to gitexecdir 
    408408PROGRAMS += $(EXTRA_PROGRAMS) 
    409409 
    410 PROGRAM_OBJS += daemon.o 
    411 PROGRAM_OBJS += fast-import.o 
    412 PROGRAM_OBJS += imap-send.o 
    413 PROGRAM_OBJS += shell.o 
    414410PROGRAM_OBJS += show-index.o 
    415 PROGRAM_OBJS += upload-pack.o 
    416 PROGRAM_OBJS += http-backend.o 
    417411 
    418412PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS)) 
    419413 
    BUILTIN_OBJS += builtin/var.o 
    771765BUILTIN_OBJS += builtin/verify-pack.o 
    772766BUILTIN_OBJS += builtin/verify-tag.o 
    773767BUILTIN_OBJS += builtin/write-tree.o 
     768BUILTIN_OBJS += builtin/shell.o 
     769BUILTIN_OBJS += builtin/upload-pack.o 
     770BUILTIN_OBJS += builtin/http-backend.o 
     771BUILTIN_OBJS += builtin/daemon.o 
     772BUILTIN_OBJS += builtin/imap-send.o 
     773BUILTIN_OBJS += builtin/fast-import.o 
    774774 
    775775GITLIBS = $(LIB_FILE) $(XDIFF_LIB) 
    776776EXTLIBS = 
    endif 
    12891289EXTLIBS += -lz 
    12901290 
    12911291ifndef NO_OPENSSL 
    1292         OPENSSL_LIBSSL = -lssl 
     1292        EXTLIBS += -lssl 
    12931293        ifdef OPENSSLDIR 
    12941294                BASIC_CFLAGS += -I$(OPENSSLDIR)/include 
    12951295                OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib) 
    endif 
    19751975git-%$X: %.o $(GITLIBS) 
    19761976        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) 
    19771977 
    1978 git-imap-send$X: imap-send.o $(GITLIBS) 
    1979         $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ 
    1980                 $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO) 
    1981  
    19821978git-http-fetch$X: revision.o http.o http-walker.o http-fetch.o $(GITLIBS) 
    19831979        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ 
    19841980                $(LIBS) $(CURL_LIBCURL) 
    endif 
    21932189        bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \ 
    21942190        execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \ 
    21952191        { test "$$bindir/" = "$$execdir/" || \ 
    2196           for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \ 
     2192          for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \ 
    21972193                $(RM) "$$execdir/$$p" && \ 
    21982194                test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \ 
    2199                 ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \ 
     2195                ln -s git "$$execdir/$$p" 2>/dev/null || \ 
    22002196                cp "$$bindir/$$p" "$$execdir/$$p" || exit; \ 
    22012197          done; \ 
    22022198        } && \ 
    22032199        for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \ 
    22042200                $(RM) "$$bindir/$$p" && \ 
    2205                 ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \ 
    22062201                ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \ 
    22072202                cp "$$bindir/git$X" "$$bindir/$$p" || exit; \ 
    22082203        done && \ 
    22092204        for p in $(BUILT_INS); do \ 
    22102205                $(RM) "$$execdir/$$p" && \ 
    2211                 ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \ 
    22122206                ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \ 
    22132207                cp "$$execdir/git$X" "$$execdir/$$p" || exit; \ 
    22142208        done && \ 
  • shell.c

    a b static struct commands { 
    129129        { NULL }, 
    130130}; 
    131131 
    132 int main(int argc, char **argv) 
     132int cmd_shell(int argc, char **argv, const char *prefix) 
    133133{ 
    134134        char *prog; 
    135135        const char **user_argv; 
  • upload-pack.c

    a b static void upload_pack(void) 
    697697        } 
    698698} 
    699699 
    700 int main(int argc, char **argv) 
     700int cmd_upload_pack(int argc, char **argv, const char *prefix) 
    701701{ 
    702702        char *dir; 
    703703        int i; 
Note: See TracBrowser for help on using the repository browser.