From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-gx0-f172.google.com ([209.85.161.172]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1RG5G9-0004Vq-HS for ptxdist@pengutronix.de; Tue, 18 Oct 2011 10:42:55 +0200 Received: by ggnv1 with SMTP id v1so423474ggn.31 for ; Tue, 18 Oct 2011 01:42:46 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1318893704-23961-1-git-send-email-jon@ringle.org> References: <1318893704-23961-1-git-send-email-jon@ringle.org> Date: Tue, 18 Oct 2011 04:42:46 -0400 Message-ID: From: Jon Ringle Subject: Re: [ptxdist] [PATCH] ptxd_ipkg_rev_smaller: fix compare with empty micro Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0622788959==" Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de --===============0622788959== Content-Type: multipart/alternative; boundary=bcaec531496529c7ff04af8eb5ed --bcaec531496529c7ff04af8eb5ed Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 17, 2011 at 7:21 PM, Jon Ringle wrote: > ptxd_ipkg_rev_smaller will return the wrong value if the version number > does not include a $micro component. > For example: > pkgd_ipkg_rev_smaller foo_1.0-2_armel.ipk foo_1.0-1_armel.ipk > will incorrectly return 0 > > After more testing, I found that there were other situations where the version comparison does not work well. I ended up replacing the implementation of ptxd_ipkg_rev_smaller() with something much simpler, albeit dependent on dpkg that seems to work well: ptxd_ipkg_rev_smaller() { dpkg --compare-versions $1 lt $2 } --bcaec531496529c7ff04af8eb5ed Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Oct 17, 2011 at 7:21 PM, Jon Ringle <jon@ringle.org><= /span> wrote:
ptxd_ipkg_rev_smaller will return the wrong value if the version number
does not include a $micro component.
=A0
For example:
=A0 =A0 =A0 =A0pkgd_ipkg_rev_smaller foo_1.0-2_armel.ipk foo_1.0-1_armel.i= pk
will incorrectly return 0


After more testing, I found that there= were other situations where the version comparison does not work well.

I ended up replacing the implementation of ptxd_ipkg_= rev_smaller() with something much simpler, albeit dependent on dpkg that se= ems to work well:

ptxd_ipkg_rev_smaller() {
=A0 =A0 dpkg -= -compare-versions $1 lt $2
}

--bcaec531496529c7ff04af8eb5ed-- --===============0622788959== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- ptxdist mailing list ptxdist@pengutronix.de --===============0622788959==--