--- trunk/dehs_pg.php 2007/08/03 15:50:04 44 +++ trunk/dehs_pg.php 2007/08/03 22:37:29 45 @@ -280,13 +280,29 @@ } function vers_conv($debvers) { - preg_match("/(.+:)?([^-]+)(ds|dsfg|debian)/",$debvers,$matches); +/* preg_match("/(.+:)?([^-]+)(ds|dsfg|debian)/",$debvers,$matches); if (!$matches[3]) { unset($matches); preg_match("/(.+:)?([^-]+)/",$debvers,$matches); } if (substr($matches[2],-1)=='.') $matches[2]=substr($matches[2],0,-1); return $matches[2]; +*/ + // Strip off the epoch + $pos = strpos($debvers, ':'); + if ( $pos !== FALSE) { + $debvers = substr($debvers, $pos+1); + } + + // strip off the Debian revision (look from the back of the string) + $pos = strrpos($debvers, '-'); + if ( $pos !== FALSE) { + $debvers = substr($debvers, 0, $pos); + } + + // strip off repacking indicators + $debvers = preg_replace("/[-.+~]?(ds|dfsg|debian)(.*)/i", "", $debvers); + return $debvers; } function check_db() { global $dirs,$dbconn; @@ -507,6 +523,7 @@ $tot--; print "Packages Left: " . $tot-- . " Found: $found Not found: $notfound Not Down: $notdown\r"; #print "\n Not Downlaoded: $res_array[up_url]\n"; + unlink($localfile); continue; } foreach($changes_files as $filename) { @@ -542,7 +559,7 @@ fwrite($fw,$watch); fclose($fw); - $uscan_res=shell_exec($base . "uscan --dehs --package $name --upstream-version " . vers_conv($version) . " --watchfile $tmpnam 2>/dev/null 2>&1"); + $uscan_res=shell_exec("uscan --dehs --package $name --upstream-version " . vers_conv($version) . " --watchfile $tmpnam 2>/dev/null 2>&1"); unlink($tmpnam); $p = xml_parser_create(); xml_parse_into_struct($p, $uscan_res, $vals, $index);