mirror of
https://github.com/roswell/roswell.git
synced 2026-09-10 07:16:17 -04:00
renamed macro: SLASH -> DIRSEP
This commit is contained in:
parent
f9580b4ce6
commit
870041371f
|
|
@ -6,7 +6,7 @@ char* extract_command_str(int flags,const char *filename,int do_extract,const ch
|
|||
char* _uname_m=uname_m();
|
||||
char* _uname=uname_s();
|
||||
char* _confdir=configdir();
|
||||
char* exe=s_escape_string(cat(_confdir,"impls",SLASH,_uname_m,SLASH,_uname,SLASH,"7za",SLASH,"9.20",SLASH,"7za.exe",NULL));
|
||||
char* exe=s_escape_string(cat(_confdir,"impls",DIRSEP,_uname_m,DIRSEP,_uname,DIRSEP,"7za",DIRSEP,"9.20",DIRSEP,"7za.exe",NULL));
|
||||
char *outputpath2=q(outputpath);
|
||||
char *filename2=q(filename);
|
||||
substitute_char('\\','/',outputpath2);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ extern int extract(const char *filename, int do_extract, int flags,const char* o
|
|||
int installed_p(struct install_options* param) {
|
||||
int ret;
|
||||
char *i,*impl=q(param->impl);
|
||||
i=s_cat(configdir(),q("impls"),q(SLASH),q(param->arch),q(SLASH),q(param->os),q(SLASH),
|
||||
q(impl),q(param->version?SLASH:""),q(param->version?param->version:""),q(SLASH),NULL);
|
||||
i=s_cat(configdir(),q("impls"),q(DIRSEP),q(param->arch),q(DIRSEP),q(param->os),q(DIRSEP),
|
||||
q(impl),q(param->version?DIRSEP:""),q(param->version?param->version:""),q(DIRSEP),NULL);
|
||||
ret=directory_exist_p(i);
|
||||
cond_printf(1,"directory_exist_p(%s)=%d\n",i,ret);
|
||||
s(i),s(impl);
|
||||
|
|
@ -30,11 +30,11 @@ int start(struct install_options* param) {
|
|||
set_defaultlisp(param->impl,param->version);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
p=cat(home,"tmp",SLASH,param->impl,param->version?"-":"",param->version?param->version:"",SLASH,NULL);
|
||||
p=cat(home,"tmp",DIRSEP,param->impl,param->version?"-":"",param->version?param->version:"",DIRSEP,NULL);
|
||||
ensure_directories_exist(p);
|
||||
s(p);
|
||||
|
||||
p=cat(home,"tmp",SLASH,param->impl,param->version?"-":"",param->version?param->version:"",".lock",NULL);
|
||||
p=cat(home,"tmp",DIRSEP,param->impl,param->version?"-":"",param->version?param->version:"",".lock",NULL);
|
||||
delete_at_exit(p);
|
||||
touch(p);
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ 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);
|
||||
char* impl_archive=cat(home,"archives",DIRSEP,archive_name,NULL);
|
||||
if(!file_exist_p(impl_archive)
|
||||
|| get_opt("download.force",1)) {
|
||||
printf("Downloading %s\n",url);
|
||||
|
|
|
|||
|
|
@ -177,15 +177,15 @@ char* lispdir(void) {
|
|||
s(w);
|
||||
|
||||
/* $(bindir)/lisp/ */
|
||||
LISPDIR_CANDIDATE(cat(ros_bin,"lisp",SLASH,NULL));
|
||||
LISPDIR_CANDIDATE(cat(ros_bin,"lisp",DIRSEP,NULL));
|
||||
|
||||
ros_bin[strlen(ros_bin)-1]='\0';
|
||||
ros_bin=pathname_directory(ros_bin);
|
||||
|
||||
/* $(bindir)/../etc/roswell/ */
|
||||
LISPDIR_CANDIDATE(cat(ros_bin,"etc"SLASH PACKAGE_NAME SLASH,NULL));
|
||||
LISPDIR_CANDIDATE(cat(ros_bin,"etc"DIRSEP PACKAGE_NAME DIRSEP,NULL));
|
||||
/* $(bindir)/../lisp/ */
|
||||
LISPDIR_CANDIDATE(cat(ros_bin,"lisp",SLASH,NULL));
|
||||
LISPDIR_CANDIDATE(cat(ros_bin,"lisp",DIRSEP,NULL));
|
||||
s(ros_bin);
|
||||
result=append_trail_slash(LISP_PATH);
|
||||
return q(result);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ char** cmd_run_abcl(int argc,char** argv,struct sub_command* cmd) {
|
|||
|
||||
s(arch),s(os);
|
||||
|
||||
ret=conss((strcmp("system",version)==0)?truename(which("abcl")):cat(home,impl_path,SLASH,"abcl",EXE_EXTENTION,NULL),ret);
|
||||
ret=conss((strcmp("system",version)==0)?truename(which("abcl")):cat(home,impl_path,DIRSEP,"abcl",EXE_EXTENTION,NULL),ret);
|
||||
/* runtime options from here */
|
||||
ret=conss(q("--noinform"),ret);
|
||||
ret=conss(q("--noinit"),ret);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ char** cmd_run_acl(int argc,char** argv,struct sub_command* cmd) {
|
|||
|
||||
ret=conss((strcmp("system",version)==0)?
|
||||
truename(which(lisp)):
|
||||
cat(home,impl_path,SLASH,lisp,EXE_EXTENTION,NULL),ret);
|
||||
cat(home,impl_path,DIRSEP,lisp,EXE_EXTENTION,NULL),ret);
|
||||
/* runtime options from here */
|
||||
ret=conss(q("-qq"),ret);
|
||||
if(acl_version) {
|
||||
|
|
@ -33,7 +33,7 @@ char** cmd_run_acl(int argc,char** argv,struct sub_command* cmd) {
|
|||
}
|
||||
|
||||
if(image) {
|
||||
char *path=cat(basedir(),impl_path,SLASH,"dump",SLASH,image,".core",NULL);
|
||||
char *path=cat(basedir(),impl_path,DIRSEP,"dump",DIRSEP,image,".core",NULL);
|
||||
if(file_exist_p(path)) {
|
||||
ret=conss(q("-I"),ret);
|
||||
ret=conss(path,ret);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ char** cmd_run_ccl(int argc,char** argv,struct sub_command* cmd) {
|
|||
unsetenv("CCL_DEFAULT_DIRECTORY");
|
||||
|
||||
ret=conss(issystem?truename(which(strcmp(impl,"ccl32")==0?"ccl32":"ccl")):
|
||||
cat(home,impl_path,SLASH,binname,EXE_EXTENTION,NULL),ret);
|
||||
cat(home,impl_path,DIRSEP,binname,EXE_EXTENTION,NULL),ret);
|
||||
if(ccl_version)
|
||||
ret=conss(q("--version"),ret);
|
||||
ret=conss(q("--no-init"),ret);
|
||||
|
|
@ -61,9 +61,9 @@ char** cmd_run_ccl(int argc,char** argv,struct sub_command* cmd) {
|
|||
ret=conss(q("--image-name"),ret);
|
||||
if(!image) {
|
||||
if(!issystem)
|
||||
ret=conss(cat(home,impl_path,SLASH,binname,".image",NULL),ret);
|
||||
ret=conss(cat(home,impl_path,DIRSEP,binname,".image",NULL),ret);
|
||||
}else
|
||||
ret=conss(cat(basedir(),impl_path,SLASH,"dump",SLASH,image,".",binname,NULL),ret);
|
||||
ret=conss(cat(basedir(),impl_path,DIRSEP,"dump",DIRSEP,image,".",binname,NULL),ret);
|
||||
|
||||
ret=conss(q("--eval"),ret);
|
||||
ret=conss(s_cat(q("(progn #-ros.init(cl:load \""),lispdir(),q("init.lisp"),q("\"))"),NULL),ret);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ char** cmd_run_clasp(int argc,char** argv,struct sub_command* cmd) {
|
|||
|
||||
LVal ret=0;
|
||||
|
||||
char *bin=cat(home,impl_path,SLASH,"build/boehm/iclasp-boehm",EXE_EXTENTION,NULL);
|
||||
char *bin=cat(home,impl_path,DIRSEP,"build/boehm/iclasp-boehm",EXE_EXTENTION,NULL);
|
||||
s(arch),s(os);
|
||||
ret=conss(bin,ret);
|
||||
s(impl_path);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ char** cmd_run_clisp(int argc,char** argv,struct sub_command* cmd) {
|
|||
|
||||
ret=conss((strcmp("system",version)==0)?
|
||||
truename(which((strcmp(impl,"clisp32")==0)?"clisp32":"clisp")):
|
||||
cat(home,impl_path,SLASH,"bin",SLASH,"clisp",EXE_EXTENTION,NULL),ret);
|
||||
cat(home,impl_path,DIRSEP,"bin",DIRSEP,"clisp",EXE_EXTENTION,NULL),ret);
|
||||
if(get_opt("version",0)) {
|
||||
ret=conss(q("--version"),ret);
|
||||
simple=1;
|
||||
|
|
@ -37,7 +37,7 @@ char** cmd_run_clisp(int argc,char** argv,struct sub_command* cmd) {
|
|||
ret=conss(q("--help"),ret);
|
||||
|
||||
{
|
||||
char* path=cat(basedir(),impl_path,SLASH,"lib",SLASH,NULL);
|
||||
char* path=cat(basedir(),impl_path,DIRSEP,"lib",DIRSEP,NULL);
|
||||
LVal d=directory(path);
|
||||
if(d) {
|
||||
path=s_cat(path,q(firsts(d)),NULL);
|
||||
|
|
@ -47,7 +47,7 @@ char** cmd_run_clisp(int argc,char** argv,struct sub_command* cmd) {
|
|||
}
|
||||
}
|
||||
{
|
||||
char* path=cat(basedir(),impl_path,SLASH,"share",SLASH,"locale",SLASH,NULL);
|
||||
char* path=cat(basedir(),impl_path,DIRSEP,"share",DIRSEP,"locale",DIRSEP,NULL);
|
||||
cond_printf(1,"localedir=%s\n",path);
|
||||
ret=conss(q("-N"),ret);
|
||||
ret=conss(path,ret);
|
||||
|
|
@ -59,7 +59,7 @@ char** cmd_run_clisp(int argc,char** argv,struct sub_command* cmd) {
|
|||
}
|
||||
|
||||
if(image) {
|
||||
char *path=cat(basedir(),impl_path,SLASH,"dump",SLASH,image,".core",NULL);
|
||||
char *path=cat(basedir(),impl_path,DIRSEP,"dump",DIRSEP,image,".core",NULL);
|
||||
if(file_exist_p(path)) {
|
||||
ret=conss(q("-M"),ret);
|
||||
ret=conss(path,ret);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ char** cmd_run_cmu(int argc,char** argv,struct sub_command* cmd) {
|
|||
char* program=get_opt("program",0);
|
||||
char* dynamic_space_size=get_opt("dynamic-space-size",0);
|
||||
char* control_stack_size=get_opt("control-stack-size",0);
|
||||
char* cmucllib=cat(home,impl_path,SLASH"lib"SLASH"cmucl"SLASH"lib",NULL);
|
||||
char* cmucllib=cat(home,impl_path,DIRSEP"lib"DIRSEP"cmucl"DIRSEP"lib",NULL);
|
||||
char* cmu_version=get_opt("version",0);
|
||||
char *bin;
|
||||
LVal ret=0;
|
||||
|
|
@ -31,7 +31,7 @@ char** cmd_run_cmu(int argc,char** argv,struct sub_command* cmd) {
|
|||
s(bin),bin=which("cmucl");
|
||||
bin=truename(bin);
|
||||
}else
|
||||
bin=cat(home,impl_path,SLASH,"bin",SLASH,"lisp",EXE_EXTENTION,NULL);
|
||||
bin=cat(home,impl_path,DIRSEP,"bin",DIRSEP,"lisp",EXE_EXTENTION,NULL);
|
||||
setenv("CMUCLLIB",cmucllib,1);
|
||||
|
||||
ret=conss(bin,ret);
|
||||
|
|
@ -39,7 +39,7 @@ char** cmd_run_cmu(int argc,char** argv,struct sub_command* cmd) {
|
|||
|
||||
ret=conss(q("-quiet"),ret);
|
||||
if(image) {
|
||||
char *path=cat(basedir(),impl_path,SLASH,"dump",SLASH,image,".core",NULL);
|
||||
char *path=cat(basedir(),impl_path,DIRSEP,"dump",DIRSEP,image,".core",NULL);
|
||||
if(file_exist_p(path)) {
|
||||
ret=conss(q("-core"),ret);
|
||||
ret=conss(q(path),ret);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ char** cmd_run_ecl(int argc,char** argv,struct sub_command* cmd) {
|
|||
setenv("DYLD_FALLBACK_LIBRARY_PATH",path,1);
|
||||
s(path);
|
||||
}
|
||||
ret=conss((strcmp("system",version)==0)?truename(which("ecl")):cat(home,impl_path,SLASH,"bin",SLASH,"ecl",EXE_EXTENTION,NULL),ret);
|
||||
ret=conss((strcmp("system",version)==0)?truename(which("ecl")):cat(home,impl_path,DIRSEP,"bin",DIRSEP,"ecl",EXE_EXTENTION,NULL),ret);
|
||||
s(arch),s(os),s(impl_path);
|
||||
if(get_opt("version",0))
|
||||
ret=conss(q("--version"),ret);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ char** cmd_run_lispworks(int argc,char** argv,struct sub_command* cmd) {
|
|||
char* lw_version=get_opt("version",0);
|
||||
|
||||
LVal ret=0;
|
||||
ret=conss(cat(home,"impls",SLASH,arch,SLASH,os,SLASH,"LispWorks",SLASH,"lw-console",NULL), ret);
|
||||
ret=conss(cat(home,"impls",DIRSEP,arch,DIRSEP,os,DIRSEP,"LispWorks",DIRSEP,"lw-console",NULL), ret);
|
||||
|
||||
if(lw_version) {
|
||||
ret=conss(q("-eval"),ret);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ char** cmd_run_mkcl(int argc,char** argv,struct sub_command* cmd) {
|
|||
char* heap_size_limit=get_opt("heap-size-limit",0);
|
||||
LVal ret=0;
|
||||
|
||||
ret=conss((strcmp("system",version)==0)?truename(which("mkcl")):cat(home,impl_path,SLASH,"bin",SLASH,"mkcl",EXE_EXTENTION,NULL),ret);
|
||||
ret=conss((strcmp("system",version)==0)?truename(which("mkcl")):cat(home,impl_path,DIRSEP,"bin",DIRSEP,"mkcl",EXE_EXTENTION,NULL),ret);
|
||||
|
||||
s(arch),s(os),s(impl_path);
|
||||
if(get_opt("version",0))
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ char** cmd_run_npt(int argc,char** argv,struct sub_command* cmd) {
|
|||
char* image=get_opt("image",0);
|
||||
char* program=get_opt("program",0);
|
||||
LVal ret=0;
|
||||
ret=conss((strcmp("system",version)==0)?truename(which("npt")):cat(home,impl_path,SLASH,"bin",SLASH,"npt",EXE_EXTENTION,NULL),ret)
|
||||
ret=conss((strcmp("system",version)==0)?truename(which("npt")):cat(home,impl_path,DIRSEP,"bin",DIRSEP,"npt",EXE_EXTENTION,NULL),ret)
|
||||
;
|
||||
s(arch),s(os),s(impl_path);
|
||||
if(get_opt("version",0))
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ char** cmd_run_sbcl(int argc,char** argv,struct sub_command* cmd) {
|
|||
int issystem=(strcmp("system",version)==0);
|
||||
char *bin=issystem?
|
||||
strcmp(impl,"sbcl32")==0?truename(which("sbcl32")):truename(which("sbcl")):
|
||||
cat(home,impl_path,SLASH,"bin",SLASH,"sbcl",EXE_EXTENTION,NULL);
|
||||
cat(home,impl_path,DIRSEP,"bin",DIRSEP,"sbcl",EXE_EXTENTION,NULL);
|
||||
|
||||
s(arch),s(os);
|
||||
|
||||
if (!issystem) {
|
||||
char* sbcl_home=cat(home,impl_path,SLASH,"lib",SLASH,"sbcl",NULL);
|
||||
char* sbcl_home=cat(home,impl_path,DIRSEP,"lib",DIRSEP,"sbcl",NULL);
|
||||
setenv("SBCL_HOME",sbcl_home,1);
|
||||
s(sbcl_home);
|
||||
}
|
||||
|
|
@ -41,11 +41,11 @@ char** cmd_run_sbcl(int argc,char** argv,struct sub_command* cmd) {
|
|||
char* core=NULL;
|
||||
char* ld=lispdir();
|
||||
char* base=basedir();
|
||||
char* bindir=cat(base,"bin"SLASH,NULL);
|
||||
char* bindir2=cat(home,"bin"SLASH,NULL);
|
||||
char* bindir=cat(base,"bin"DIRSEP,NULL);
|
||||
char* bindir2=cat(home,"bin"DIRSEP,NULL);
|
||||
char* script2=q(script?script+1:"");
|
||||
int pos= position_char("\"",script2);
|
||||
core=cat(base,impl_path,SLASH,"dump",SLASH,image,".core",NULL);
|
||||
core=cat(base,impl_path,DIRSEP,"dump",DIRSEP,image,".core",NULL);
|
||||
if(pos!=-1)
|
||||
script2[pos]='\0';
|
||||
if(script &&
|
||||
|
|
@ -66,7 +66,7 @@ char** cmd_run_sbcl(int argc,char** argv,struct sub_command* cmd) {
|
|||
}else
|
||||
cond_printf(1,"core not found:%s\n",core);
|
||||
}else if(!issystem)
|
||||
ret=conss(cat(home,impl_path,SLASH,"lib",SLASH,"sbcl",SLASH,"sbcl.core",NULL),
|
||||
ret=conss(cat(home,impl_path,DIRSEP,"lib",DIRSEP,"sbcl",DIRSEP,"sbcl.core",NULL),
|
||||
conss(q("--core"),ret));
|
||||
if(help)
|
||||
ret=conss(q("--help"),ret);
|
||||
|
|
@ -92,7 +92,7 @@ char** cmd_run_sbcl(int argc,char** argv,struct sub_command* cmd) {
|
|||
ret=conss(q("--no-userinit"),ret);
|
||||
if(script && !enable_debugger)
|
||||
ret=conss(q("--disable-debugger"),ret);
|
||||
char* initlisp=cat(home,impl_path,SLASH,"fasl",SLASH,"init.lisp",NULL);
|
||||
char* initlisp=cat(home,impl_path,DIRSEP,"fasl",DIRSEP,"init.lisp",NULL);
|
||||
char* asdf=get_opt("asdf.version",0);
|
||||
if(asdf)
|
||||
initlisp=s_cat(initlisp,q("_"),substitute_char('_','.',q(asdf)),NULL);
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ void set_env_opt(char* path) {
|
|||
case 2:
|
||||
value=subseq(buf,last,i);
|
||||
if(strcmp("quicklisp",name)==0) {
|
||||
set_opt(&local_opt,"quicklisp",s_escape_string(cat(configdir(),"env"SLASH,value,SLASH,"lisp",SLASH,"quicklisp",SLASH,NULL)));
|
||||
set_opt(&local_opt,"quicklisp",s_escape_string(cat(configdir(),"env"DIRSEP,value,DIRSEP,"lisp",DIRSEP,"quicklisp",DIRSEP,NULL)));
|
||||
}else if(strcmp("default.lisp",name)==0) {
|
||||
set_opt(&local_opt,q("lisp"),q(value));
|
||||
}else if(strcmp("dists",name)==0) {
|
||||
|
|
@ -147,13 +147,13 @@ void star_set_opt(void) {
|
|||
if(!get_opt(PACKAGE_NAME"env",0))
|
||||
set_env_opt("."PACKAGE_NAME"env");
|
||||
/*If 'roswellenv' not set the below would endup fail to open cause it will be taken as a directory.*/
|
||||
set_env_opt(s_escape_string(cat(configdir(),"env",SLASH,get_opt(PACKAGE_NAME"env",1),SLASH,"config",NULL)));
|
||||
set_env_opt(s_escape_string(cat(configdir(),"env",DIRSEP,get_opt(PACKAGE_NAME"env",1),DIRSEP,"config",NULL)));
|
||||
lisp= get_opt("lisp",1); /*-L in fourth line of ros script or default.lisp in env file.*/
|
||||
if(!lisp) lisp= get_opt("*lisp",0); /*-L via command line.*/
|
||||
if(!lisp) lisp= get_opt("default.lisp",0);/*default.lisp via default config file.*/
|
||||
set_opt(&local_opt,"impl",determin_impl(lisp));
|
||||
if(!get_opt("quicklisp",0))
|
||||
set_opt(&local_opt,"quicklisp",s_escape_string(cat(config,"lisp",SLASH,"quicklisp",SLASH,NULL)));
|
||||
set_opt(&local_opt,"quicklisp",s_escape_string(cat(config,"lisp",DIRSEP,"quicklisp",DIRSEP,NULL)));
|
||||
set_opt(&local_opt,"argv0",argv_orig[0]);
|
||||
set_opt(&local_opt,"wargv0",which(argv_orig[0]));
|
||||
set_opt(&local_opt,"homedir",q(config));
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ void sbcl_bin_check_file(char* file) {
|
|||
|
||||
int sbcl_version_bin(struct install_options* param) {
|
||||
char* home=configdir();
|
||||
char* platforms_tsv=cat(home,"tmp",SLASH,"sbcl-bin_uri.tsv",NULL);
|
||||
char* platforms_tsv=cat(home,"tmp",DIRSEP,"sbcl-bin_uri.tsv",NULL);
|
||||
char* uri=get_opt("uri",0);
|
||||
cond_printf(1,"sbcl_version_bin\n");
|
||||
ensure_directories_exist(platforms_tsv);
|
||||
|
|
@ -82,7 +82,7 @@ int sbcl_bin_download(struct install_options* param) {
|
|||
cond_printf(1,"sbcl_bin_download\n");
|
||||
int retry=10;
|
||||
do {
|
||||
param->expand_path=cat(home,"src",SLASH,"sbcl","-",param->version,"-",arch,param->variant,SLASH,NULL);
|
||||
param->expand_path=cat(home,"src",DIRSEP,"sbcl","-",param->version,"-",arch,param->variant,DIRSEP,NULL);
|
||||
impls_sbcl_bin.uri=uri?q(uri):cat(SBCL_BIN_URI ,param->version,"/sbcl-",param->version,
|
||||
"-",arch,param->variant,"-binary",sbcl_bin_extention(param),NULL);
|
||||
result = download(param);
|
||||
|
|
@ -123,8 +123,8 @@ int sbcl_bin_expand(struct install_options* param) {
|
|||
printf("Extracting %s to %s\n",archive,dist_path);
|
||||
delete_directory(dist_path,1);
|
||||
ensure_directories_exist(dist_path);
|
||||
argv[2]=cat(home,"archives",SLASH,archive,NULL);
|
||||
argv[4]=cat(home,"src",SLASH,NULL);
|
||||
argv[2]=cat(home,"archives",DIRSEP,archive,NULL);
|
||||
argv[4]=cat(home,"src",DIRSEP,NULL);
|
||||
return !cmd_tar(array_stringlist(5,argv),NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,11 +62,11 @@ int sbcl_bin_expand(struct install_options* param) {
|
|||
char* home=configdir();
|
||||
char* arch= arch_(param);
|
||||
char* archive=cat(impl,"-",version,"-",arch,".msi",NULL);
|
||||
char* log_path=cat(home,"impls",SLASH,"log",SLASH,impl,"-",version,"-",arch,SLASH,"install.log",NULL);
|
||||
char* log_path=cat(home,"impls",DIRSEP,"log",DIRSEP,impl,"-",version,"-",arch,DIRSEP,"install.log",NULL);
|
||||
char* dist_path;
|
||||
int pos=position_char("-",impl);
|
||||
impl=(pos!=-1)?subseq(impl,0,pos):q(impl);
|
||||
dist_path=cat(home,"src",SLASH,impl,"-",version,"-",arch,SLASH,NULL);
|
||||
dist_path=cat(home,"src",DIRSEP,impl,"-",version,"-",arch,DIRSEP,NULL);
|
||||
|
||||
char* msiexec_path=msi_exec_path_from_register();
|
||||
if(msiexec_path==NULL || !file_exist_p(msiexec_path)) {
|
||||
|
|
@ -78,7 +78,7 @@ int sbcl_bin_expand(struct install_options* param) {
|
|||
}
|
||||
|
||||
printf("Extracting the msi archive. %s to %s\n",archive,dist_path);
|
||||
archive=s_cat(q(home),q("archives"),q(SLASH),archive,NULL);
|
||||
archive=s_cat(q(home),q("archives"),q(DIRSEP),archive,NULL);
|
||||
delete_directory(dist_path,1);
|
||||
ensure_directories_exist(dist_path);
|
||||
ensure_directories_exist(log_path);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ int ensure_directories_exist(char* path) {
|
|||
int len = strlen(path);
|
||||
cond_printf(1,"ensure_directories_exist:%s\n",path);
|
||||
if(len) {
|
||||
for(--len;(path[len]!=SLASH[0]||len==-1);--len);
|
||||
for(--len;(path[len]!=DIRSEP[0]||len==-1);--len);
|
||||
path=subseq(path,0,len+1);
|
||||
}else
|
||||
path=q(path);
|
||||
|
|
@ -82,7 +82,7 @@ char* configdir(void) {
|
|||
|
||||
if (env) /* note: env can be a NULL */
|
||||
{
|
||||
if (env[0] != SLASH[0]) /* note: SLASH == \\ on windows, / on unix */
|
||||
if (env[0] != DIRSEP[0]) /* note: DIRSEP == \\ on windows, / on unix */
|
||||
{
|
||||
cond_printf(0,"Error: %s must be absolute. Got: %s \n",c,env);
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ char* configdir(void) {
|
|||
env = homedir(); /* use homedir instead of ROSWELL_DIR */
|
||||
if (env) /* env is not null */
|
||||
{
|
||||
return s_cat2(append_trail_slash(env),q("."PACKAGE SLASH));
|
||||
return s_cat2(append_trail_slash(env),q("."PACKAGE DIRSEP));
|
||||
}
|
||||
{
|
||||
return NULL;
|
||||
|
|
@ -109,7 +109,7 @@ char* subcmddir(void) {
|
|||
char* pathname_directory(char* path) {
|
||||
int i;
|
||||
char* ret;
|
||||
for(i=strlen(path)-1;i>=0&&path[i]!=SLASH[0];--i);
|
||||
for(i=strlen(path)-1;i>=0&&path[i]!=DIRSEP[0];--i);
|
||||
ret=(i>=0)?subseq(path,0,i+1):append_trail_slash(".");
|
||||
s(path);
|
||||
return ret;
|
||||
|
|
@ -125,19 +125,19 @@ char* file_namestring(char* path) {
|
|||
}
|
||||
|
||||
char* impldir(char* arch,char* os,char* impl,char* version) {
|
||||
return cat("impls",SLASH,arch,SLASH,os,SLASH,impl,SLASH,version,NULL);
|
||||
return cat("impls",DIRSEP,arch,DIRSEP,os,DIRSEP,impl,DIRSEP,version,NULL);
|
||||
}
|
||||
|
||||
char* basedir(void) {
|
||||
char* cd_;
|
||||
cond_printf(1,"roswellenv=%s\n",get_opt(PACKAGE_NAME"env",1));
|
||||
if(get_opt(PACKAGE_NAME"env",1)) {
|
||||
cd_ = cat(configdir(),"env",SLASH,get_opt(PACKAGE_NAME"env",1),SLASH,NULL);
|
||||
cd_ = cat(configdir(),"env",DIRSEP,get_opt(PACKAGE_NAME"env",1),DIRSEP,NULL);
|
||||
if(directory_exist_p(cd_))
|
||||
return cd_;
|
||||
s(cd_);
|
||||
}
|
||||
cd_ = s_cat2(currentdir(),q("."PACKAGE SLASH));
|
||||
cd_ = s_cat2(currentdir(),q("."PACKAGE DIRSEP));
|
||||
if(directory_exist_p(cd_))
|
||||
return cd_;
|
||||
s(cd_);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ int ensure_directories_exist (char* path) {
|
|||
int len = strlen(path);
|
||||
cond_printf(1,"ensure_directories_exist:%s\n",path);
|
||||
if(len) {
|
||||
for(--len;(path[len]!=SLASH[0]||len==-1);--len);
|
||||
for(--len;(path[len]!=DIRSEP[0]||len==-1);--len);
|
||||
path=subseq(path,0,len+1);
|
||||
}else path=q(path);
|
||||
if(!directory_exist_p(path)) {
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ char* downcase(char* orig) {
|
|||
}
|
||||
|
||||
char* append_trail_slash(char* str) {
|
||||
return str[strlen(str)-1]!=SLASH[0]?cat2(str,SLASH):q(str);
|
||||
return str[strlen(str)-1]!=DIRSEP[0]?cat2(str,DIRSEP):q(str);
|
||||
}
|
||||
|
||||
char* escape_string(char* str) {
|
||||
|
|
|
|||
|
|
@ -150,10 +150,10 @@ int mklockdir(char* path) {
|
|||
#endif
|
||||
|
||||
int lock_apply(char* symbol,int remove) {
|
||||
char *p=s_cat(configdir(),q("tmp"),q(SLASH),NULL);
|
||||
char *p=s_cat(configdir(),q("tmp"),q(DIRSEP),NULL);
|
||||
int ret=0;
|
||||
ensure_directories_exist(p),s(p);
|
||||
p=s_cat(configdir(),q("tmp"SLASH"lock."PACKAGE"."),q(symbol),NULL);
|
||||
p=s_cat(configdir(),q("tmp"DIRSEP"lock."PACKAGE"."),q(symbol),NULL);
|
||||
if(remove<2) {
|
||||
cond_printf(1,"%slock!:%s\n",remove?"un":"",symbol);
|
||||
while(remove?rmdir(p):mklockdir(p));
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include <dirent.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#define SLASH "/"
|
||||
#define DIRSEP "/"
|
||||
#define PATHSEP ":"
|
||||
#define EXE_EXTENTION ""
|
||||
#define ROSRC "/etc/rosrc"
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#include <wininet.h>
|
||||
#include <direct.h>
|
||||
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
|
||||
#define SLASH "\\"
|
||||
#define DIRSEP "\\"
|
||||
#define PATHSEP ";"
|
||||
#define EXE_EXTENTION ".exe"
|
||||
#define ROSRC ""
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ LVal directory(char* path) {
|
|||
strcmp(fd.cFileName,"..")==0)) {
|
||||
char* str=q(fd.cFileName);
|
||||
if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
|
||||
str=s_cat2(str,q(SLASH));
|
||||
str=s_cat2(str,q(DIRSEP));
|
||||
ret=conss(str,ret);
|
||||
}
|
||||
}while(FindNextFile(dir,&fd)!=0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue