Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 78 of file cache.c.
Referenced by main().
{ char Line[LINESIZE]; char freeldr_path[MAX_PATH]; char iso_path[MAX_PATH]; char compressed_7z_path[MAX_PATH]; char *check_iso; char *check_dir; check_iso = strrchr(opt_dir, '.'); l2l_dbg(1, "Checking directory: %s\n", opt_dir); if (check_iso && PATHCMP(check_iso, ".7z") == 0) { l2l_dbg(1, "Checking 7z image: %s\n", opt_dir); // First attempt to decompress to an .iso image strcpy(compressed_7z_path, opt_dir); if ((check_dir = strrchr(compressed_7z_path, PATH_CHAR))) *check_dir = '\0'; else strcpy(compressed_7z_path, "."); // default to current dir sprintf(Line, UNZIP_FMT_7Z, opt_7z, opt_dir, compressed_7z_path); /* This of course only works if the .7z and .iso basenames are identical * which is normally true for ReactOS trunk builds: */ strcpy(check_iso, ".iso"); if (!file_exists(opt_dir) || force) { l2l_dbg(1, "Decompressing 7z image: %s\n", opt_dir); if (system(Line) < 0) { l2l_dbg(0, "\nCannot decompress to iso image %s\n", opt_dir); l2l_dbg(1, "Failed to execute: '%s'\n", Line); return 2; } } else l2l_dbg(2, "%s already decompressed\n", opt_dir); } if (check_iso && PATHCMP(check_iso, ".iso") == 0) { l2l_dbg(1, "Checking ISO image: %s\n", opt_dir); if (file_exists(opt_dir)) { l2l_dbg(2, "ISO image exists: %s\n", opt_dir); strcpy(iso_path, opt_dir); *check_iso = '\0'; sprintf(freeldr_path, "%s" PATH_STR "freeldr.ini", opt_dir); if (!file_exists(freeldr_path) || force) { l2l_dbg(0, "Unpacking %s to: %s ...", iso_path, opt_dir); unpack_iso(opt_dir, iso_path); l2l_dbg(0, "... done\n"); } else l2l_dbg(2, "%s already unpacked in: %s\n", iso_path, opt_dir); } else { l2l_dbg(0, "ISO image not found: %s\n", opt_dir); return 1; } } cache_name = malloc(MAX_PATH); tmp_name = malloc(MAX_PATH); strcpy(cache_name, opt_dir); if (cleanable(opt_dir)) strcat(cache_name, ALT_PATH_STR CACHEFILE); else strcat(cache_name, PATH_STR CACHEFILE); strcpy(tmp_name, cache_name); strcat(tmp_name, "~"); return 0; }