This PR attempts to fix a bug which makes it impossible to remove the last existing tag for a device.
Consider the power-switch tag. elogind ships with a file called 70-power-switch.rules which applies that tag to certain devices. Try removing it e.g. for the ACPI Power Button device by creating an appropriately numbered rule file (e.g. /etc/udev/rules.d/75-remove-power-switch.rules) with the following contents:
This PR attempts to fix a bug which makes it impossible to remove the last existing tag for a device.
Consider the
power-switch
tag. elogind ships with a file called70-power-switch.rules
which applies that tag to certain devices. Try removing it e.g. for the ACPI Power Button device by creating an appropriately numbered rule file (e.g./etc/udev/rules.d/75-remove-power-switch.rules
) with the following contents:This will not remove the
power-switch
tag for the device:If you add any other tag to the tag list for the same device, e.g. by making the aforementioned rule file look like this:
the
power-switch
tag will be removed correctly:The reason for this behavior is that
udev_device_get_properties_list_entry()
only updates theTAGS
property if the tag list is non-empty.I believe this is an upstream bug which was fixed in v220 as a side effect of commits 57fa1d094cd2c5ac68970526ad0a0754c548e75d and f4ac4d1a82e2c468761fffa333323841ad886221. Since eudev did not adopt these changes, the bug remained unfixed.
I was not sure how to sum up all of the above in the commit log message, so please let me know if it should be adjusted.
Hope this helps!