In #269573, the bug submitter complains that he cannot remove the bash package, because its prerm script calls.....remove-shell, which is a shell script. Indeed, as bash is then the last remaining shell, we enter a nice loop.
Matthias Klose finally suggested the only safe solution to this : recode the two utilities {add|remove}-shell in C (or Perl). Anyone wanting to try? If no-one volunteers, we will tag this bug wontfix. --