\n"; while (!feof ($fh)) { $buffer = fgets($fh, 1048576); if (preg_match('/(^#|^\n+|^\n\r+)/', $buffer, $matches)) continue; if (preg_match('/%([-a-z]+)$/', $buffer, $matches)) { if ($action == 2 && strcmp($matches[1], "post")) continue; if (strcmp($matches[1], $stage)){ if (!($action == 2 && !strcmp($matches[1], "post"))){ add_stage_data($stage,"post"); } if ($action == 1 && !strcmp($matches[1], "post")) break; add_stage_data($matches[1],"pre"); } $stage = $matches[1]; continue; } $me = selfURL(); if ($action == 1) { if (!strcmp("sysinstall", $stage)) { preg_match("/^([^\=]+)=([a-z]+)[[:space:]]+([0-9kMGTPE]+[[:space:]]+(.+))/", $buffer, $matches); if (empty($matches[4])) { print "$buffer"; } else { print "$matches[1]=$matches[2] " . convert_to_sector_size($matches[3]) . " $matches[4]\n"; } } if (!strcmp("packages", $stage)) { print "package=".$buffer; print "addPackage\n"; } } elseif ($action == 2) { if (!strcmp("post", $stage)) print "$buffer"; } } print "# Generated by pflsa ($config_file)\n"; if (!preg_match('/fetch libfetch/', $user_agent, $matches)) print ""; fclose($fh); ?>