#949716 qa.debian.org: DDPO doesn't show packages with version 0

#949716#5
Date:
2020-01-23 22:58:14 UTC
From:
To:
Package: qa.debian.org
Severity: normal

Hi!
If you have a package with version "0" (a valid version number) -- like
"fonts-recommended" at the moment, DDPO won't show it.  On the other hand,
a non-native package versioned "0-1" does show up.

This suggests a type confusion bug, like something equalling string "0" to
NULL.


Meow!

#949716#10
Date:
2020-01-24 00:28:57 UTC
From:
To:
Heh. From staring at the code for a little, my guess is that it is the
following snippet in wml/developer.wml's print_package_entry at fault:

The documentation for array_filter[1] says:

and if you follow the reference to the implicit boolean conversions
documentation[2], it indeed has the following:

(because Javascript isn't the only language with "helpful" design
decisions)

So, I think you have to have *every* version in the archive as "0";
later checks in that function explicitly compare against "".

It's worth noting that there's also

in the caller (print_package_entries), so if a src:0 were ever uploaded
to the archive it would feel left out of all the DDPO fun, although such
a source package name would surely be rejected...

As for the fix, you can (ab)use strlen as the callback (though of
*course* you have to pass the function name as a string...), so:

and

I use the word "fix" loosely here though, I've only convinced myself
it's correct; it has not seen an interpreter, let alone been tested on
this input!

James

[1] https://www.php.net/manual/en/function.array-filter.php#refsect1-function.array-filter-parameters
[2] https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting

#949716#15
Date:
2021-02-20 09:57:48 UTC
From:
To:
Hallo,

Ich habe dir eine Mail geschickt, aber keine Antwort von dir, warum?

Eddie