$actionurl = "$url/repodata/repomd.xml";
$repomdxml = file_get_contents($actionurl);
-file_put_contents("$file/repodata/repomd.xml", $repomdxml);
+if(file_exists("$file/repodata/repomd.xml.new")) unlink("$file/repodata/repomd.xml.new");
+file_put_contents("$file/repodata/repomd.xml.new", $repomdxml);
-$xml = simplexml_load_file("$file/repodata/repomd.xml");
+$xml = simplexml_load_file("$file/repodata/repomd.xml.new");
foreach($xml as $key => $var) {
}
unlink("$file/repodata/repoupdate.lock");
+if(file_exists("$file/repodata/repomd.xml")) {
+ unlink("$file/repodata/repomd.xml");
+}
+rename("$file/repodata/repomd.xml.new", "$file/repodata/repomd.xml")
+// TODO: check for outdated repodata files and delete
?>
\ No newline at end of file