p: factor out an unqualify() routine

for cutting off a '=$version' suffix from package names

Signed-off-by: Andreas Beckmann <anbe@debian.org>