>> If you are going to go do customizations the fact that the scripts that are built without those customizations in mind fail to work properly isn’t a bug. I’d suggest you simply use the pg_upgrade tool directly if you don’t like (or adhere to) the assumptions built into the distro-specific scripts. I like this tools, but I don't think that it is a choice to not follow "your" assumptions(I mean ignore first value), especially if it could lead to the deletion of data, but maybe I wrong.
It assumes that the directory configuration only appears once (I suspect this violation is the true cause) and, I'm assuming here, that its choice for where to place the various files (i.e., /var, not /postgres) is maintained. I agree that the script is seemingly not as robust as it could be.
As for working toward improvement - the main Apt page on the PostgreSQL Wiki has the relevant information: