64studio / pdk

64 Studio Platform Development Kit
GNU General Public License v2.0
20 stars 8 forks source link

removing with apt leaves files/folders leftover in python dist-packages #38

Open obbardc opened 6 years ago

obbardc commented 6 years ago
apt-get purge pdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  debugedit funnelweb git-core kpartx liblua5.2-0 libnspr4 libnss3 librpm3 librpmbuild3 librpmio3 librpmsign3 python-egenix-mxtexttools python-egenix-mxtools python-pexpect python-ptyprocess python-smartpm rpm
  rpm-common rpm2cpio smartpm-core
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  pdk* pdk-mediagen*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 1,564 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 49213 files and directories currently installed.)
Removing pdk (1.0.0~alpha1) ...
dpkg: warning: while removing pdk, directory '/usr/lib/python2.7/dist-packages/picax' not empty so not removed
dpkg: warning: while removing pdk, directory '/usr/lib/python2.7/dist-packages/pdk/xml_legacy/utils' not empty so not removed
dpkg: warning: while removing pdk, directory '/usr/lib/python2.7/dist-packages/pdk/xml_legacy/sax' not empty so not removed
dpkg: warning: while removing pdk, directory '/usr/lib/python2.7/dist-packages/pdk/xml_legacy/parsers/xmlproc' not empty so not removed
Processing triggers for man-db (2.7.6.1-2) ...
obbardc commented 6 years ago

Workaround:

apt@pdk:~$ sudo rm -rf /usr/lib/python2.7/dist-packages/picax
apt@pdk:~$ sudo rm -rf /usr/lib/python2.7/dist-packages/pdk
danielhjames commented 6 years ago

Ah, https://github.com/64studio/pdk/tree/master/debian does not include a postrm file with a purge case. I can take care of that.

obbardc commented 6 years ago

I thought python install/remove is handled with setup.py through the include /usr/share/cdbs/1/class/python-distutils.mk in debian/rules?

danielhjames commented 6 years ago

I will look into that, thanks for the tip!. Usually I handle this kind of thing via the debian/postrm file because it enables you to have different actions for remove versus purge of the package. A purge should leave nothing behind, but in some cases you want the remove to leave certain parts intact to support a later install.