fix faulty `lb chroot_apt remove`
i have no idea what the author was thinking with this, but it was certainly not accomplishing what it should.
the install mode:
- moves the exiting file aside to FILE.orig
- copies the config file in place
the remove mode:
- moves FILE (the user config file) to FILE.orig, replacing the backed up original (if there was one)
- copies the user config file to FILE (pointless)
- if FILE.orig exists, moves it to replace FILE (pointless)
thus the remove mode just effectively destroys the backup of the original file and leaves the user config file in place.
it would correctly remove the additions to chroot/etc/apt/preferences
though presumably.
we fix this by:
- replacing removal steps 1 & 2 with a command to remove the existing file
- performing the removal of additions to
chroot/etc/apt/preferences
only if they had been made to an existing file rather than to a user config provided file (which will be deleted)
Edited by Lyndon Brown