int sbcl_version_bin(struct install_options* param) { char* home=configdir(); char* platforms_html=cat(home,"tmp",SLASH,"sbcl-bin.html",NULL); cond_printf(1,"sbcl_version_bin\n"); ensure_directories_exist(platforms_html); param->version_not_specified=param->version?0:1; if(param->version_not_specified) { int ret; printf("No SBCL version specified. Downloading platform-table.html to see the available versions...\n"); char* uri=get_opt("sbcl-bin-version-uri",0); ret=download_simple(uri?uri:PLATFORM_HTML_URI,platforms_html,0); if(ret!=0) { printf("Something wrong! Check the connection or sbcl.org is down. Download failed (Code=%d), tring the backup URL.\n",ret); ret=download_simple(PLATFORM_HTML_BACKUP_URI,platforms_html,0); } if(ret!=0) { printf("Download failed (Code=%d)\n",ret); return 0; } sbcl_bin_check_file(platforms_html); param->version=sbcl_bin(platforms_html,param->version_not_specified++); }else param->version=q(param->version); printf("Installing sbcl-bin/%s...\n",param->version); param->arch_in_archive_name=1; s(platforms_html),s(home); return 1; }
int cmd_download (int argc,char **argv,struct sub_command* cmd) { if(argc>=2) { fprintf(stderr,"Downloading %s\n",argv[1]); return download_simple(argv[1],argv[2],0); } return 0; }
int download(struct install_options* param) { char* home=configdir(); char* url=install_impl->uri; char* archive_name=download_archive_name(param); char* impl_archive=cat(home,"archives",SLASH,archive_name,NULL); if(!file_exist_p(impl_archive) || get_opt("download.force",1)) { printf("Downloading %s\n",url); /*TBD proxy support... etc*/ if(url) { ensure_directories_exist(impl_archive); int status = download_simple(url,impl_archive,0); if(status) { printf("Download Failed with status %d. See download_simple in src/download.c\n", status); return 0; /* fail */ } s(url); } } else printf("Skip downloading %s\n",url); s(impl_archive),s(home); return 1; }
int cmd_download (int argc,char **argv,struct sub_command* cmd) { int opt=argc>3?atoi(argv[3]):0; return argc>=3?(1&opt?0:fprintf(opt?stdout:stderr,"Downloading %s\n",argv[1])),download_simple(argv[1],argv[2],opt>2?0:opt):0; }