Bug#544315: DDPO: developer.php logs errors about dpkg to /var/log/apache/error.log
Package: qa.debian.org
Tags: patch
The php script developer.php writes quite some error messages to
/var/log/apache/error.log about dpkg.
Use this command on merkel:
tail -f /var/log/apache/error.log
and see many lines about dpkg appear, including this one:
dpkg: --compare-versions takes three arguments: <version> <relation> <version>
The php script developer.php uses "dpkg --compare-versions..." in the functions
"ver_comp" and "compare_versions". In function "ver_comp" argument $a can contain "-",
so not a real version number.
Use this command to reproduce the logged error message:
dpkg --compare-versions '-' gt '2.21.0.0'
One solution is to modify function ver_comp to treat "-" with return 3.
Another solution could be to escape the dash, so make it "\-".
Patch:
--- /org/qa.debian.org/web/developer.php 2009-07-25 00:28:47.000000000 +0200
+++ developer.php 2009-08-30 17:05:02.000000000 +0200
@@ -526,6 +526,8 @@
return $debvers;
}
function ver_comp($a, $b, $mangle = true) {
+ if( $a == "-" )
+ return 3;
exec('dpkg --compare-versions ' . escapeshellarg($a) . ' gt ' . escapeshellarg($mangle? vers_conv($b) : $b),$output,$res);
if ($res==0) return 1;
exec('dpkg --compare-versions ' . escapeshellarg($a) . ' lt ' . escapeshellarg($mangle? vers_conv($b) : $b),$output,$res);
Regards,
Bart Martens
Reply to: