fix prerm deletion-procedure to use null character and step-by-step file deletion
python3-lib2to3 has a bug in the prerm pycache file deletion procedure when there are too much files to 'rm -f $files;'.
The below output was generate by dpkg in the configuration process.
(Lendo banco de dados ... 65891 ficheiros e directórios actualmente instalados.)
A remover python3-lib2to3 (3.9.2-1) ...
Segmentation fault
dpkg: erro ao processar o pacote python3-lib2to3 (--remove):
o subprocesso instalado, do pacote python3-lib2to3, o script pre-removal retornou erro do status de saída 139
Erros foram encontrados durante o processamento de:
python3-lib2to3
The following environment was used (but the procure is present in currently debian package main branch):
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
# dpkg -l python3-lib2to3
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Nome Versão Arquitectura Descrição
+++-===============-============-============-=========================================================
rF python3-lib2to3 3.9.2-1 all Interactive high-level object-oriented language (lib2to3)
Debugging the procedure the following error was output by rm(with 4673 bytes long input list):
Segmentation fault
Thus, similarly to [1], I propose the patch in enumeration and xargs execution at prerm procedure.
[1] https://wiki.debian.org/CommonErrorMessages/ArgumentListTooLong
Edited by Ibirisol Fontes