From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: [PATCH] gnu: Add git-review. Date: Fri, 9 Sep 2016 18:00:21 +0300 Message-ID: <20160909150021.GD5507@macbook42.flashner.co.il> References: <20160908070630.18458-1-clement@lassieur.org> <439770f1-4691-45ac-348e-9e41bc126e0d@uq.edu.au> <20160908183217.GK12493@macbook42.flashner.co.il> <87oa3xfpmv.fsf@lassieur.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MIdTMoZhcV1D07fI" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biNIF-0002mg-30 for guix-devel@gnu.org; Fri, 09 Sep 2016 11:00:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biNI7-0006Lt-RY for guix-devel@gnu.org; Fri, 09 Sep 2016 11:00:38 -0400 Received: from flashner.co.il ([178.62.234.194]:37304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biNI7-0006H3-G8 for guix-devel@gnu.org; Fri, 09 Sep 2016 11:00:31 -0400 Content-Disposition: inline In-Reply-To: <87oa3xfpmv.fsf@lassieur.org> 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" To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Cc: guix-devel@gnu.org --MIdTMoZhcV1D07fI Content-Type: multipart/mixed; boundary="d9ADC0YsG2v16Js0" Content-Disposition: inline --d9ADC0YsG2v16Js0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 09, 2016 at 10:23:20AM +0200, Cl=C3=A9ment Lassieur wrote: > Efraim Flashner writes: >=20 > > On Thu, Sep 08, 2016 at 10:28:37PM +1000, Ben Woodcroft wrote: >=20 > >> I think including git simply as an input is problematic because git-re= view > >> calls git via 'subprocess', as evidenced by > >>=20 > >> $ ./pre-inst-env guix environment -C --ad-hoc git-review > >> $ git-review > >> [..] > >> File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/p= ython3.4/subprocess.py", > >> line 1457, in _execute_child > >> raise child_exception_type(errno_num, err_msg) > >> FileNotFoundError: [Errno 2] No such file or directory: 'git' > >>=20 > >> So, I think we need to patch the source code to call the full path to = git, > >> or otherwise wrap the 'git-review' executable. > >>=20 > >> > + (home-page "http://docs.openstack.org/infra/git-review/") > >> > + (synopsis "Command-line tool for Gerrit") > >> > + (description > >> > + "Git-review is a command-line tool that helps submitting Git b= ranches to > >> > +Gerrit for review, or fetching existing ones.") > >> > + (license asl2.0))) > >> Otherwise seems OK to me. Can you test with environment -C -N? > >> ben > >>=20 > > > > Try it with the attached patch >=20 > Hi, sorry for the mess and thanks for the reviews. >=20 > I did not know about the "guix environment -C -N" way of testing > packages, and I'm very happy to learn this. >=20 > The attached patch seems to work for git, but the same error now happens > with ssh. >=20 > --=20 > Cl=C3=A9ment I found ssh and I found an instance of scp, so this should be better. --=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 --d9ADC0YsG2v16Js0 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-gnu-python-git-review-Find-outside-commands.patch" Content-Transfer-Encoding: quoted-printable =46rom a4169c369d850da7859e94152f96dc71acb42e4f Mon Sep 17 00:00:00 2001 =46rom: Efraim Flashner Date: Thu, 8 Sep 2016 21:31:32 +0300 Subject: [PATCH] gnu: python-git-review: Find outside commands. * gnu/packages/openstack.scm (python-git-review)[arguments]: Hardcode the location of `git', `ssh' and `scp' so that `git-review' can find it natively. [inputs]: Add openssh. --- gnu/packages/openstack.scm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm index 4cb38a9..65bc296 100644 --- a/gnu/packages/openstack.scm +++ b/gnu/packages/openstack.scm @@ -20,6 +20,7 @@ =20 (define-module (gnu packages openstack) #:use-module (gnu packages python) + #:use-module (gnu packages ssh) #:use-module (gnu packages tls) #:use-module (gnu packages version-control) #:use-module (guix build-system python) @@ -796,11 +797,33 @@ permanence.") (base32 "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) (build-system python-build-system) - (arguments `(#:tests? #f)) ; tests require a running Gerrit server + (arguments + `(#:tests? #f ; tests require a running Gerrit server + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'hardcode-outside-programs + (lambda _ + (let* ((git (string-append + (assoc-ref %build-inputs "git") "/bin/git")) + (base (assoc-ref %build-inputs "openssh")) + (ssh (string-append base "/bin/ssh")) + (scp (string-append base "/bin/scp"))) + (substitute* '("git_review/cmd.py" "git_review/tests/test_g= it_review.py" + "git_review/tests/test_unit.py" "git_review/= tests/utils.py") + (("\"git ") (string-append "\"" git " ")) + (("\"git\"") (string-append "\"" git "\"")) + (("'git'") (string-append "'" git "'"))) + (substitute* "git_review/cmd.py" + (("\"ssh\"") (string-append "\"" ssh "\"")) + (("'ssh'") (string-append "'" ssh "'")) + (("\"scp\"") (string-append "\"" scp "\"")) + (("'scp") (string-append "'" scp))) + #t)))))) (native-inputs `(("python-pbr" ,python-pbr))) (inputs `(("python-requests" ,python-requests) + ("openssh" ,openssh) ("git" ,git))) (home-page "http://docs.openstack.org/infra/git-review/") (synopsis "Command-line tool for Gerrit") --=20 2.10.0 --d9ADC0YsG2v16Js0-- --MIdTMoZhcV1D07fI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJX0s6FAAoJEPTB05F+rO6Tc2oP/0OJ/8vR4nDptHi7fuApyGPl EtjKCNZWfF85EcWSFmyRaT3vUWWp5wBygHBU7RKWiiX1ZwoM97/St0R6ISldRy1v mNzHnHbSA32H7lHUURasK+W719NwaTETVYQrCg3DDZE5VRwKOFkjJaYWsPEnW2Mw +Z2bdimKO91cDFyKGtj2EHg1YOKcXeVNgT2M+xtSnYXifhQDa81Z64T6pdP3RpFG 4jesxC0Qo1PEJAedD6NUJDIMthKzqQoRwLbD/I01/OsDcXRz8/nc9CsryQZYHkL4 cZUcm3jtKZB7UDgPIUiyR6WTXiy83X/kMRIDsgleEI4rZwA/VOOU6RP0BzUacHx3 NKuSFLqBmXr+u4qpV5IRC2yBMZjqjSrjerq7ft/Bn79CdBTS1ThWB0JP5Y/1uaT+ Z2lSKb3FWbFaeneWk2e26ptEx5Edun8YJRNbbGtMWLrC0XcKx80SlAqttLHxhHw5 CbOefkOolon7xLf7/qqxCZAVZ1nFIGLSOzm4IwchoA9OXy/V/x8LqRs0I/SVdxH4 DmuRF7E0frjmksNKpy7ZXOKyM2YCA2ICEEhN8P9VBctFyElbRXdq7NRBdmBmkt5G x23tUbowDWZEVF2ubdQS9c5khOhcwxnv3aht6USmPYUJa92HvKg2qzke/Ou+I1mv GWPKyzAnR6LBb2yQj6Bm =zPQ4 -----END PGP SIGNATURE----- --MIdTMoZhcV1D07fI--