Skyedra / UnspamifyUbuntu

Remove spam from Ubuntu
MIT License
167 stars 9 forks source link

feat: reject ubuntu-advantage-desktop-daemon too #5

Closed muggenhor closed 1 year ago

muggenhor commented 1 year ago

And provide a version with maximum epoch value to reduce the likelihood of this ever being overruled.

Skyedra commented 1 year ago

Thanks for the contribution! This looks like a good change.

As far as I can tell, software-properties-gtk is the only package that depends (requires) on ubuntu-advantage-desktop-daemon.

I don't suppose you (or someone else) has already tested software-properties-gtk to see if it still functions without ubuntu-advantage-desktop-daemon installed? Or do we need to patch software-properties-gtk, similar to how we did for update-manager?

muggenhor commented 1 year ago

software-properties-gtk fails already without ubuntu-advantage-tools, in a similar way as update-manager. It doesn't appear to depend on the daemon at all (at least not directly).

$ software-properties-gtk
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 37, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 57, in <module>
    from .UbuntuProPage import UbuntuProPage
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/UbuntuProPage.py", line 27, in <module>
    from .DialogUaAttach import DialogUaAttach
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/DialogUaAttach.py", line 25, in <module>
    from uaclient.api.u.pro.attach.magic.initiate.v1 import initiate
ModuleNotFoundError: No module named 'uaclient'

So that's a separate issue from what this PR does. I do think it's possible to solve both problems in a better way than patching the code though: provide a NOP-implementation of uaclient that provides NOP versions of the imported functions/types as part of this "fake" pkg.

muggenhor commented 1 year ago

I don't think patching is ideal (compared to just installing a package). But at least it works. I've created #6 for that.

Skyedra commented 1 year ago

Thanks! With the information you have provided, I plan to approve this PR regardless once I get a chance to test it locally.

I do think it's possible to solve both problems in a better way than patching the code though: provide a NOP-implementation of uaclient that provides NOP versions of the imported functions/types as part of this "fake" pkg.

This seems like a great idea! Having to maintain manual patches is something that seems likely to unexpectedly break in future at some upstream update point. If you or someone else would like to tackle a NOP implementation in future, a PR would be welcome with this feature.

(Ideally (but not required) whatever method we use to NOP these would not create a new dependency on other non-typical packages though, as it might be a bit strange for a user to have to pull in a whole bunch of new dependent packages for our 'fake' package.)

Skyedra commented 1 year ago

Merged, thanks again