From patchwork Fri Mar 4 19:24:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Langasek X-Patchwork-Id: 373 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:42:01 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs24874qah; Fri, 4 Mar 2011 11:24:55 -0800 (PST) Received: by 10.52.91.34 with SMTP id cb2mr1477983vdb.296.1299266695674; Fri, 04 Mar 2011 11:24:55 -0800 (PST) Received: from becquer.dodds.net (becquer.dodds.net [207.224.24.209]) by mx.google.com with ESMTP id x16si3892457vbl.98.2011.03.04.11.24.54; Fri, 04 Mar 2011 11:24:55 -0800 (PST) Received-SPF: pass (google.com: domain of vorlon@virgil.dodds.net designates 207.224.24.209 as permitted sender) client-ip=207.224.24.209; Authentication-Results: mx.google.com; spf=pass (google.com: domain of vorlon@virgil.dodds.net designates 207.224.24.209 as permitted sender) smtp.mail=vorlon@virgil.dodds.net Received: from virgil.dodds.net (unknown [192.168.15.11]) by becquer.dodds.net (Postfix) with ESMTPA id 08401251D9; Fri, 4 Mar 2011 11:24:53 -0800 (PST) Received: by virgil.dodds.net (Postfix, from userid 1000) id 8E0EE41A97; Fri, 4 Mar 2011 11:24:48 -0800 (PST) From: Steve Langasek To: Tom Gall Cc: patches@linaro.org, Steve Langasek Subject: [PATCH 4/7] always check the version before calling dpkg-divert, except on install Date: Fri, 4 Mar 2011 11:24:38 -0800 Message-Id: <1299266681-13266-4-git-send-email-steve.langasek@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1299266681-13266-1-git-send-email-steve.langasek@linaro.org> References: <1299266681-13266-1-git-send-email-steve.langasek@linaro.org> From: Steve Langasek We always want to check the version number of the previous package before calling dpkg-divert, *except* on install, because one of the other options besides install and upgrade is 'abort-upgrade' - an aborted upgrade shouldn't result in us trying to readd the diversion. --- debian/libturbojpeg62.preinst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/debian/libturbojpeg62.preinst b/debian/libturbojpeg62.preinst index d0a4a54..03ff534 100644 --- a/debian/libturbojpeg62.preinst +++ b/debian/libturbojpeg62.preinst @@ -2,7 +2,7 @@ set -e -if [ upgrade != "$1" ] || dpkg --compare-versions "$2" lt 6b-git.20101110t043445.8a20111-0linaro2; then +if [ install = "$1" ] || dpkg --compare-versions "$2" lt 6b-git.20101110t043445.8a20111-0linaro2; then dpkg-divert --package libjpeg-turbo --add -rename --divert \ /usr/lib/libjpeg.so.62.0.0.orig /usr/lib/libjpeg.so.62.0.0 fi