Changeset 2941


Ignore:
Timestamp:
Jan 27, 2010, 9:53:16 PM (15 years ago)
Author:
broder
Message:

Add code to invirt-reload to de-duplicate multiple invocations. (LP: #439426)

This uses the dpkg triggers mechanism to de-duplicate multiple
invocations of invirt-reload over the course of a single dpkg run.

The code is largely lifted from Ubuntu's update-initramfs.

Location:
trunk/packages/invirt-base
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-base/debian/changelog

    r2920 r2941  
    11invirt-base (0.0.29) unstable; urgency=low
    22
     3  [ Greg Brockman ]
    34  * Added a safestructs for doing config without raising.
    45
    5  -- Greg Brockman <gdb@mit.edu>  Tue, 19 Jan 2010 23:49:19 -0500
     6  [ Evan Broder ]
     7  * Support running invirt-reload directly from a package postinst,
     8    instead of via triggers. (LP: #439426)
     9
     10 -- Evan Broder <broder@mit.edu>  Wed, 27 Jan 2010 21:18:07 -0500
    611
    712invirt-base (0.0.28) unstable; urgency=low
  • trunk/packages/invirt-base/debian/invirt-base.postinst

    r2009 r2941  
    2727
    2828    triggered)
    29         invirt-reload
     29        if dpkg --compare-versions "$DPKG_RUNNING_VERSION" ge '1.14.5ubuntu10~~'; then
     30            invirt-reload
     31        else
     32            DPKG_MAINTSCRIPT_PACKAGE='' invirt-reload
     33        fi
    3034    ;;
    3135
  • trunk/packages/invirt-base/scripts/invirt-reload

    r1609 r2941  
    11#!/bin/bash
     2
     3if [ "$DPKG_MAINTSCRIPT_PACKAGE" != '' ] && \
     4    [ $# = 0 ] && \
     5    dpkg-trigger --check-supported 2>/dev/null; then
     6    if dpkg-trigger --no-await invirt-base; then
     7        echo "invirt-reload: deferring update (trigger activated)"
     8        exit 0
     9    fi
     10fi
    211
    312for script in $(run-parts --test /etc/init.d); do
Note: See TracChangeset for help on using the changeset viewer.