From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Karetnikov Subject: Re: Generation 0 Date: Thu, 26 Sep 2013 06:18:56 +0400 Message-ID: <877ge4jpf3.fsf@karetnikov.org> References: <87vc2o4qwc.fsf@gnu.org> <87y57kljro.fsf@karetnikov.org> <87hae81uvo.fsf@gnu.org> <87li2oslzh.fsf_-_@karetnikov.org> <87hadcr4sh.fsf_-_@karetnikov.org> <8738ow5zif.fsf@gnu.org> <87vc1r6nu0.fsf@karetnikov.org> <87eh8ebdba.fsf@gnu.org> <871u4d97ku.fsf@karetnikov.org> <87vc1pnjzz.fsf@gnu.org> <87siws22sw.fsf@karetnikov.org> <87vc1oiu1y.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VP15t-0000CJ-L4 for guix-devel@gnu.org; Wed, 25 Sep 2013 22:14:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VP15r-0007t0-Dj for guix-devel@gnu.org; Wed, 25 Sep 2013 22:14:17 -0400 In-Reply-To: <87vc1oiu1y.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 25 Sep 2013 21:24:09 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >> There are two cases: >> >> 1. A generation does not exist. >> >> 2. The profile points to the zeroth generation, and there are no other >> generations. >> >> =E2=80=98tests/guix-package.sh=E2=80=99 tests the first case. Should we= test the second >> case too? What would be the best way to do so? > The second case is valid. Thus it=E2=80=99s OK for --list-generations to= not > print anything, but it must exit with 0. > Likewise, --delete-generations should do nothing and exit with 0 with > the only generation that would be deleted is Generation 0. > Does it make sense? I was asking a different question, that is, whether we should test both cases in =E2=80=98tests/guix-package.sh=E2=80=99 or it=E2=80=99s OK to test= only the first case. Currently, there=E2=80=99s a test for the first case. (Note that by the wo= rd =E2=80=9Ccases=E2=80=9D I mean the =E2=80=98cond=E2=80=99 cases.) Anyway, can I push this patch? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-guix-package-Exit-with-0-when-there-is-nothing-to-li.patch Content-Transfer-Encoding: quoted-printable From=2000188949e6c49592f6f2dc30bf21731ae142afc0 Mon Sep 17 00:00:00 2001 From: Nikita Karetnikov Date: Thu, 26 Sep 2013 02:00:06 +0000 Subject: [PATCH 1/3] guix package: Exit with 0 when there is nothing to lis= t. * guix/scripts/package.scm (guix-package)[process-query]: Exit with 0 when there are no generations containing packages or no profiles. =2D-- guix/scripts/package.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 66505f1..ed1e72c 100644 =2D-- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -983,7 +983,7 @@ more information.~%")) ((string-null? pattern) (let ((numbers (generation-numbers profile))) (if (equal? numbers '(0)) =2D (exit 1) + (exit 0) (for-each list-generation numbers)))) ((matching-generations pattern profile) =3D> =2D-=20 1.7.9.5 --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJSQ5mTAAoJEM+IQzI9IQ38Lp0P/01ZXJQEfDF1EgQHiFKEWBpv 7dY/T0v9JsInA1DI3qsGrLeGKFpw2IMILbvVK9IOm4XWuhyLH/dG5ceI6tXEiTC9 TpcvzQ2nTNEsohAwFpW4qRCmjdCB8RCPnc8ou5qk7tNP9CRrClB1M2XAsk0liSj5 ks8tOjw+XlnyTDcxB71JvqBceELLzA5Jx82kbWe4aqFQpFLVWfsAlRIZDXvcwgzh G7h2/nzKfuyeOuHLD0BCDOfaGr2GvTr+TFRKFPAfVogPG1A7oVtHcxaoeRPCkvJ5 4B4+88cHf0UWaz1fe5Yyg41aQuUWXgQKs6UFm+aczFIjEowWrhLf51INL8uSuB7P TwEaBA5lokS3XIi6lfjCBeMyKEM0DxQ4GEQk/9TzhzuzPTlkfN1pya1yZQOKES0D Ws80EIR5V6do6j4YA3QWXsRlBDd4y5AEtR5/KtdSTm6WMpM67R2Ovo1hOn5rOwNm K42wcLIwadf8GGC6Gf3AcPy0JW3y6l87Y/HqNIhVPPu6xxxYH9kr3cQjfzfx73AG FzM95mibywW2bOl5L8VtnglR/Tbeu4hj4+if6ecLWqeD5Z4uOmhoGYDkmRf3ovJy qGVF4ZqwT+jXv2q/T7WMzS4kWWKAoefoEvD11xxt3SHvuUgFzJICg99kg9Frdi0p LIigU9FT5jILRYtVlj1C =ilI3 -----END PGP SIGNATURE----- --==-=-=--