~ubuntu-branches/ubuntu/raring/libvirt/raring

« back to all changes in this revision

Viewing changes to debian/libvirt-bin.postinst

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-03-28 09:11:04 UTC
  • Revision ID: package-import@ubuntu.com-20130328091104-k2dlopsj2xmwxog4
Tags: 1.0.2-0ubuntu10
Add code to postinst to fix any double-migration of /etc/dnsmasq.
(LP: #1157332)

Show diffs side-by-side

added added

removed removed

Lines of Context:
228
228
# We need this after the debhelper generated code so that dpkg-maintscript
229
229
# can do its renamming first.
230
230
if [ "$1" = "configure" ]; then
 
231
    # The dnsmasq hook has been introduced through SRU into Ubuntu 12.04
 
232
    # and Ubuntu 12.10.
 
233
    #
 
234
    # This means that even though we version-guard the maintscripts entry
 
235
    # it'll fire multiple times for users doing 12.04 => 12.10 => 13.04
 
236
    # or even just 12.10 => 13.04.
 
237
    #
 
238
    # As there's unfortunately no way to specify per-series base versions
 
239
    # for maintscripts hooks, we let it fire multiple times and then fix up
 
240
    # the mess it creates.
 
241
    #
 
242
    # This migration code can be removed after Ubuntu 14.04 LTS is released.
 
243
    if [ -L /etc/dnsmasq.d-available/libvirt-bin ] &&
 
244
       [ "$(readlink /etc/dnsmasq.d-available/libvirt-bin)" = "/etc/dnsmasq.d-available/libvirt-bin" ] &&
 
245
       [ -e /etc/dnsmasq.d-available/libvirt-bin.dpkg-new ]; then
 
246
        echo "The dnsmasq configuration has been migrated twice, fixing it."
 
247
        mv /etc/dnsmasq.d-available/libvirt-bin /etc/dnsmasq.d/libvirt-bin
 
248
        mv /etc/dnsmasq.d-available/libvirt-bin.dpkg-new /etc/dnsmasq.d-available/libvirt-bin
 
249
 
 
250
        # Try to restart a potential system wide dnsmasq
 
251
        invoke-rc.d dnsmasq restart 2>/dev/null || true
 
252
    fi
 
253
 
231
254
    # Configure dnsmasq
232
255
    if [ -f /etc/dnsmasq.d-available/libvirt-bin ]; then
233
256
        echo "Setting up libvirt-bin dnsmasq configuration."