From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 16 Feb 2009 16:05:08 +0300 From: Alexey Tourbin To: ALT Devel discussion list Message-ID: <20090216130508.GL31985@altlinux.org> Mail-Followup-To: ALT Devel discussion list References: <20090216081651.GA15873@altlinux.org> <20090216122312.GK27664@wo.int.altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VLAOICcq5m4DWEYr" Content-Disposition: inline In-Reply-To: <20090216122312.GK27664@wo.int.altlinux.org> Subject: Re: [devel] gb-task-repo-vercheck (vercheck): Use rpmevrcmp X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.10b3 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 13:05:09 -0000 Archived-At: List-Archive: List-Post: --VLAOICcq5m4DWEYr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 16, 2009 at 03:23:12PM +0300, Dmitry V. Levin wrote: > On Mon, Feb 16, 2009 at 11:16:51AM +0300, Alexey Tourbin wrote: > [...] > > 0:1.0-alt1 cmp 1.0-alt2 should yield 1. >=20 > Why? >=20 > > Zero serial is greater than no serial. >=20 > Why? This is because how rpm-4.0 works. lib/psm.c: 72 int rpmVersionCompare(Header first, Header second) 73 { 74 const char * one, * two; 75 int_32 * epochOne, * epochTwo; 76 int rc; 77 =20 78 if (!headerGetEntry(first, RPMTAG_EPOCH, NULL, (void **) &epoch= One, NULL)) 79 epochOne =3D NULL; 80 if (!headerGetEntry(second, RPMTAG_EPOCH, NULL, (void **) &epoc= hTwo, 81 NULL)) 82 epochTwo =3D NULL; 83 =20 84 if (epochOne && !epochTwo) 85 return 1; 86 else if (!epochOne && epochTwo) 87 return -1; 88 else if (epochOne && epochTwo) { 89 if (*epochOne < *epochTwo) 90 return -1; 91 else if (*epochOne > *epochTwo) 92 return 1; 93 } 94 =20 95 rc =3D headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &o= ne, NULL); 96 rc =3D headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &= two, NULL); 97 =20 98 rc =3D rpmvercmp(one, two); 99 if (rc) 100 return rc; 101 =20 102 (void) headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &o= ne, NULL); 103 (void) headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &= two, NULL); 104 =20 105 rc =3D rpmvercmp(one, two); 106 if (rc) 107 return rc; 108 =20 109 if (upgrade_honor_buildtime()) 110 return rpmBuildTimeCompare(first, second); 111 =20 112 return 0; 113 } Thus, rpm will not upgrade a package (by default), and apt-rpm will not consider an upgrade, if zero serial gets removed (and, say, release number is increased). Let's try to remove zero serial from e.g. kbd and see what happens. --VLAOICcq5m4DWEYr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkmZZIQACgkQfBKgtDjnu0Yl7QCfWAkUCnUS0SSOAOMCpWaNMqpa kOYAn3oMMPF16djb4awSC7gToGJAYMHP =eCmy -----END PGP SIGNATURE----- --VLAOICcq5m4DWEYr--