=== modified file 'debian/lxc.postinst' --- debian/lxc.postinst 2013-02-08 21:25:36 +0000 +++ debian/lxc.postinst 2013-03-27 19:43:50 +0000 @@ -72,6 +72,27 @@ # We need this after the debhelper generated code so that dpkg-maintscript # can do its renamming first. if [ "$1" = "configure" ]; then + + # The dnsmasq hook has been introduced through SRU into Ubuntu 12.04 + # and Ubuntu 12.10. + # + # This means that even though we version-guard the maintscripts entry + # it'll fire multiple times for users doing 12.04 => 12.10 => 13.04 + # or even just 12.10 => 13.04. + # + # As there's unfortunately no way to specify per-series base versions + # for maintscripts hooks, we let it fire multiple times and then fix up + # the mess it creates. + # + # This migration code can be removed after Ubuntu 14.04 LTS is released. + if [ -L /etc/dnsmasq.d-available/lxc ] && + [ "$(readlink /etc/dnsmasq.d-available/lxc)" = "/etc/dnsmasq.d-available/lxc" ] && + [ -e /etc/dnsmasq.d-available/lxc.dpkg-new ]; then + echo "The dnsmasq configuration has been migrated twice, fixing it." + mv /etc/dnsmasq.d-available/lxc /etc/dnsmasq.d/lxc + mv /etc/dnsmasq.d-available/lxc.dpkg-new /etc/dnsmasq.d-available/lxc + fi + # Configure dnsmasq if [ -f /etc/dnsmasq.d-available/lxc ]; then echo "Setting up lxc dnsmasq configuration."