#!/bin/sh set -e case ${PIUPARTS_OBJECTS%%=*} in TARBALL) # skip while creating the tarball exit 0 ;; esac if [ ! -f /etc/dpkg/dpkg.cfg.d/piuparts-force-unsafe-io ] then if dpkg --force-help | grep -q unsafe-io then echo "Enabling dpkg --force-unsafe-io." echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/piuparts-force-unsafe-io fi fi if [ ! -h /bin/sync ] then if test -e /usr/bin/sync; then if dpkg -S /usr/bin/sync >/dev/null 2>&1; then mv /usr/bin/sync /usr/bin/sync.distrib else mv /bin/sync /bin/sync.distrib.usr-is-merged fi dpkg-divert --add --no-rename --divert /usr/bin/sync.distrib /usr/bin/sync dpkg-divert --add --no-rename --divert /bin/sync.distrib.usr-is-merged /bin/sync else # We're probably unmerged-/usr and a single diversion will do. dpkg-divert --add --rename --divert /bin/sync.distrib /bin/sync fi ln -sv true /bin/sync fi