1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
void install(string request, string dest)
{
string target;
int components = 0;
list pathsplit;
string localInstall = "tmp/install/"; // this is the LOCAL tmp/install dir
md(localInstall);
if (request == "x")
components = 63;
else
{
if (strfind(request, "b") != -1)
components |= 2;
if (strfind(request, "d") != -1)
components |= 4;
if (strfind(request, "m") != -1)
components |= 8;
}
if (components & 2)
{
target = localInstall + BINARY;
pathsplit = path_file(target);
printf(" installing the executable `", target, "'\n");
logFile("tmp/bin", "binary", pathsplit[0], pathsplit[1]);
}
if (components & (4 | 8))
{
target = localInstall + DOC "/";
if (components & 4)
{
printf(" installing the changelog at `", target, "\n");
logZip("", "changelog", target);
printf(" installing stdconfig/simrisc at `", target, "\n");
logZip("stdconfig", "simrisc", target);
// printf(" installing the pdf-manual at `", target, "\n");
// logInstall("tmp/pdf", "simrisc.pdf", target);
//
// printf(" installing the html-manual at `", target, "\n");
// logInstall("tmp/manual/html", "", target + "manual");
// logInstall("tmp/manual/html/analysis", "",
// target + "manual/analysis");
}
if (components & 8)
{
printf(" installing the html man pages at `", target, "\n");
logInstall("tmp/manhtml", "", target);
}
}
if (components & 8)
{
target = localInstall + MAN;
printf(" installing the man pages below `", target, "'\n");
logZip("tmp/man", "simrisc.1", target + "/man1/");
logZip("tmp/man", "simriscparams.7", target + "/man7/");
}
chdir(g_cwd);
if (dest == "")
dest = "/";
else
md(dest);
dest = cutEoln(backtick("readlink -f " + dest)[0]);
if (g_logPath != "")
backtick("icmake/log " + dest + " " + g_logPath);
chdir(localInstall);
run("../../icmake/installer " + dest + "/");
printf("\n Installation completed\n");
exit(0);
}
|