2015-09-05 16:01:43 +02:00
|
|
|
void uninstall()
|
|
|
|
{
|
|
|
|
string key;
|
|
|
|
int idx;
|
|
|
|
int nDirs;
|
|
|
|
list entry;
|
|
|
|
list dirs;
|
|
|
|
string dir;
|
|
|
|
|
|
|
|
if (g_logPath == "") // do not store uninstall info
|
|
|
|
{
|
|
|
|
printf(LOGENV " environment variable not available\n");
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
readlog();
|
|
|
|
|
2015-12-08 20:26:10 +01:00
|
|
|
for (idx = listlen(g_log); idx--; )
|
2015-09-05 16:01:43 +02:00
|
|
|
{
|
|
|
|
entry = strtok(g_log[idx], " ");
|
|
|
|
|
|
|
|
if (entry[1] == "dir")
|
|
|
|
{
|
|
|
|
dir = entry[2];
|
|
|
|
dirs += (list)dir;
|
|
|
|
chdir(dir);
|
|
|
|
}
|
|
|
|
else if (entry[1] == "file")
|
|
|
|
remove(entry);
|
|
|
|
else if (entry[1] == "link")
|
|
|
|
run("rm " + entry[2]);
|
|
|
|
}
|
|
|
|
|
2015-12-08 20:26:10 +01:00
|
|
|
for (idx = 0, nDirs = listlen(dirs); idx != nDirs; ++idx)
|
2015-09-05 16:01:43 +02:00
|
|
|
removeDir(dirs[idx]);
|
|
|
|
|
|
|
|
run("rm " + g_logPath);
|
|
|
|
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|