From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1HaR-0001tC-Ba for guix-patches@gnu.org; Sun, 08 Oct 2017 15:50:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1HaO-0000en-8l for guix-patches@gnu.org; Sun, 08 Oct 2017 15:50:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:48011) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1HaO-0000ed-46 for guix-patches@gnu.org; Sun, 08 Oct 2017 15:50:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e1HaM-0004hc-Fl for guix-patches@gnu.org; Sun, 08 Oct 2017 15:50:03 -0400 Subject: [bug#27596] [PATCH] guix: lint: Add checker for new upstream versions. Resent-Message-ID: Date: Sun, 8 Oct 2017 22:49:04 +0300 From: Efraim Flashner Message-ID: <20171008194904.GC2547@macbook42.flashner.co.il> References: <20170706101723.3349-1-efraim@flashner.co.il> <87h8ypocp1.fsf@gnu.org> <20170801112046.GG2406@macbook42.flashner.co.il> <87y3qb4u7t.fsf@gnu.org> <877ew6isxe.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zCKi3GIZzVBPywwA" Content-Disposition: inline In-Reply-To: <877ew6isxe.fsf@gnu.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 27596@debbugs.gnu.org --zCKi3GIZzVBPywwA Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 07, 2017 at 10:50:21PM +0200, Ludovic Court=C3=A8s wrote: > Ping! :-) >=20 > ludo@gnu.org (Ludovic Court=C3=A8s) skribis: >=20 > > Hi Efraim, > > > > Sorry for the delay. > > > > Efraim Flashner skribis: > > > >> From 136841864c883338381764ef09a6f4ec967949e7 Mon Sep 17 00:00:00 2001 > >> From: Efraim Flashner > >> Date: Thu, 6 Jul 2017 09:13:31 +0300 > >> Subject: [PATCH] guix: lint: Add checker for new upstream versions. > >> > >> * guix/scripts/lint.scm (check-for-updates): New procedure. > >> (%checkers): Add it. > >> * guix/scripts/refresh.scm (importer-modules, %updaters): Move > >> from here ... > >> * guix/upstream.scm: ... to here. > > > > [...] > > > >> +(define (check-for-updates package) > >> + "Check if there is an update available for PACKAGE." > >> + (match (package-latest-release package (force %updaters)) > >> + ((? upstream-source? source) > >> + (when (version>? (upstream-source-version source) > >> + (package-version package)) > >> + (emit-warning package > >> + (format #f (G_ "can be upgraded to ~a~%") > >> + (upstream-source-version source))))))) > > > > I think you can (1) use =E2=80=98package-latest-release*=E2=80=99 which= ensures that the > > returned version is newer, and (2) add a case for #f since > > =E2=80=98package-latest-release*=E2=80=99 can return #f. > > > > Apart from that it LGTM, thank you! > > > > Ludo=E2=80=99. I've been working on it with package-latest-release*, and its nice not having to reimplement the logic, but I can't get it to return the newest version of the upstream-package. I got it to return a useful message with: (define (check-for-updates package) (if (package-latest-release* package (force %updaters)) (emit-warning package (format #f (G_ "can be upgraded to ~a~%") (upstream-source-version (package-latest-relea= se package (force %updaters))))) #t)) but I've already checked if there's an upstream release, I shouldn't need to check a second time. package-latest-release* returns true/false, so if I want to print the version to upgrade to I need to check it a second time. package-latest-release returns an which is more easily queried for the latest upstream version. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --zCKi3GIZzVBPywwA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlnagSYACgkQQarn3Mo9 g1FZCA/+N3ZCbXrU8FQ9S79novN8BbUfSiPMe+yopi7O/DP918OFoGEPpBuHKacF yT2D/ukf1iLdXm85Evkusc2Pc+2n6I3H38RWWIrwZcISndsZa8lHwR2kETFFKFPq JpzKZlzCwqfgmgHQXYIne3It78/gu46E3ehkOG6yr13P9iryZgDsEWwosbP8ny2K ZzPe/NvIo+sX2OMeUbAWS3oSUYrD7oEAELS0LBak9UG+cpMM8QfR3kQ98DoSk3Cl X5Y36C+KCkNCKLeI0N5RmZ96iRrFhtIkctF+LfHCTFX56/KI5eWa+y3oWhoTs+R5 evIS18KTTOn0t5bc7a43hJt84mlbsH5lt0OSsMLZwlEJoj32g4jNw/+xrc8LxhdQ X2zgFjs36NMtOMuoWQLSQSwuhXylHbUMhDfYkDqVLJbpokmUFKUa74kXBrwusKVY vAHIueVhHwWBKs9IMlxXJi7O8a8/S6wMrQhv/lm3LbyS+xCytPMn7hOOkGT+5jKn s87NmyBC4IpmoT3DxhC8ejZwnwVgBa5R4g/FKD2u9Y3mBDKkSIuvcU8Z8dcn3UY2 teJxz6u4WjNoHdyfmfyPPW1k1HFPk3nqjs3UwHpyDFvE4BoIAHzeCTqzi+xdULlX Ctip2E3WE02rndyFEu2b+XvPZehYI0ZpjVl0NHqtbXTP0hAf9Zc= =RaPp -----END PGP SIGNATURE----- --zCKi3GIZzVBPywwA--