[Dehs-devel] r131 - trunk

atomo64-guest at alioth.debian.org atomo64-guest at alioth.debian.org
Fri Apr 18 23:47:45 UTC 2008


Author: atomo64-guest
Date: 2008-04-18 23:47:44 +0000 (Fri, 18 Apr 2008)
New Revision: 131

Modified:
   trunk/dehs_pg.php
Log:
Fix wget call because -N together with -O is useless


Modified: trunk/dehs_pg.php
===================================================================
--- trunk/dehs_pg.php	2008-04-18 21:39:15 UTC (rev 130)
+++ trunk/dehs_pg.php	2008-04-18 23:47:44 UTC (rev 131)
@@ -443,20 +443,23 @@
 function dl_popcon() {
     global $dirs,$dbconn;
 
-    $localtempfile=$dirs[popcon_dir] . "/popcon.db.new";
+    $localtempdir=$dirs[popcon_dir] . "/new";
+    dir_ctrl($localtempdir);
+
     $localfile=$dirs[popcon_dir] . "/popcon.db";
     $remotefile='http://qa.debian.org/data/popcon/popcon.db';
 
     $return = 0;
     $output = null;
-    exec('/usr/bin/wget -qNc -O'.escapeshellarg($localtempfile).' ' . escapeshellarg($remotefile), $output, $return);
+    exec('cd ' . escapeshellarg($localtempdir) . ' && ' .
+         '/usr/bin/wget -qNc ' . escapeshellarg($remotefile), $output, $return);
 
     if ($return != 0) {
         echo __FUNCTION__ . "wget exited with status $return!\n";
         return false;
     }
 
-    return copy($localtempfile, $localfile);
+    return copy($localtempdir . '/popcon.db', $localfile);
 }
 function is_updated ($up_vers,$debian_vers, $dversionAsIs = false) {
     if ($up_vers=='') return 1;




More information about the Dehs-devel mailing list