} // differences found, save them up in the files. We only save from // file 1 as that is the newest file. write_hdr($Cxml); while (false != ($f1_line = fgets($F1, 1024))) { $proj1 = array(); if (preg_match('/<project>/', $f1_line)) { $m1 = ftell($F1); $proj1 = get_entry($F1, $m1); //pdbg("DIFFM: P1 Entries:",$proj1); } else { continue; } // we now have a project, is it one of the ones that need updating? // If so, save it, and record the project name and version. $proj_name = xtract($proj1[4]); foreach ($adiffs as $name => $version) { if ($proj_name == $name) { //pdbg("Found $name, saving"); $Yupdate = "{$name} " . "has a new version:" . " {$version}\n"; save_Yupdated($P2up, $Yupdate); //pdbg("\$proj1 is:", $proj1); write_pxml($Cxml, $proj1); break; } } } // must write the closing tag before closing the xml file close_tag($Cxml); fclose($P2up); fclose($Cxml);
break; case 'init': init(); $c->writeln(); merge(); break; case 'make': cleanup(true); $c->writeln(); make(); break; case 'make-help': make_help(); break; case 'update': xtract(); $c->writeln(); merge(); break; case 'update-help': update_help(); break; case 'status': // xtract(); merge(); // status(); break; default: $c->writeln($c->red(_("Error: ")) . sprintf(_("Unknown command: %s"), $cmd)); $c->writeln(); usage();