The change made to fix #520396 causes the /var/lib/misc/dnsmasq.leases file to be overwritten when (re)installing dnsmasq. In addition #522874 reports the migration problem when dnsmasq was installed prior to merging <net-dns/dnsmasq-2.71-r1 This luckily prevents users that upgrade from losing the lease file. The ebuild should only install dnsmasq.leases if it doesn't exist and preferably not let portage track it so it is not removed when dnsmasq is unmerged. Reproducible: Always Steps to Reproduce: 1. emerge =net-dns/dnsmasq-2.71-r1 2. echo "lease data" > /var/lib/misc/dnsmasq.leases 3. emerge =net-dns/dnsmasq-2.71-r1 4. test -s /var/lib/misc/dnsmasq.leases || echo "I lost my leases" Actual Results: /var/lib/misc/dnsmasq.leases is overwritten with an empty file. Expected Results: /var/lib/misc/dnsmasq.leases should not be touched if it exists.
CONFIG_PROTECT (make.conf(5)) is your friend.
I'm well aware of it but I don't think it applies here as dnsmasq.leases is not a configuration file. Would a different solution to fix #520396 be to create the leases file from the init script instead of the ebuild?
This is fixed in net-dns/dnsmasq-2.72