The issue was that if a pkg does not add the missing newline at INSTALL or REMOVE scripts, those were generated with a syntax error. Found by onekk.