GNU bug report logs - #26822
[PATCH] gnu: Add git-repo.

Previous Next

Package: guix-patches;

Reported by: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Date: Sun, 7 May 2017 21:42:01 UTC

Severity: normal

Tags: patch

Done: Hartmut Goebel <h.goebel <at> goebel-consult.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26822 in the body.
You can then email your comments to 26822 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#26822; Package guix-patches. (Sun, 07 May 2017 21:42:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hartmut Goebel <h.goebel <at> crazy-compilers.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 07 May 2017 21:42:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add git-repo.
Date: Sun,  7 May 2017 23:41:07 +0200
* gnu/packages/android.scm (git-repo): New variable.
---
 gnu/packages/android.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index e23d0fd..23ffa2b 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2015 Kai-Chung Yan <seamlikok <at> gmail.com>
 ;;; Copyright © 2016 Marius Bakke <mbakke <at> fastmail.com>
 ;;; Copyright © 2017 Julien Lepiller <julien <at> lepiller.eu>
+;;; Copyright © 2017 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,8 +24,11 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages tls))
 
 ;; The Makefiles that we add are largely based on the Debian
@@ -298,3 +302,57 @@ with an emulator instance or connected Android device.  It facilitates a variety
 of device actions, such as installing and debugging apps, and it provides access
 to a Unix shell that can run commands on the connected device or emulator.")
     (license license:asl2.0)))
+
+(define-public git-repo
+  (package
+    (name "git-repo")
+    (version "1.12.37")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gerrit.googlesource.com/git-repo")
+             (commit (string-append "v" version))))
+       (file-name (string-append "git-repo-" version "-checkout"))
+    (sha256
+     (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'build
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (repo-dir (string-append out "/share/" ,name)))
+               (substitute* "repo"
+                 (("^repodir = '\\.repo'")
+                  (string-append "repodir = '" repo-dir "'"))
+                 (("^S_repo = 'repo'") "S_repo = '.'"))
+               #t
+               )))
+         (replace 'check
+           (lambda _
+             (zero? (system* "python" "-m" "nose"))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-dir (string-append out "/bin"))
+                    (repo-dir (string-append out "/share/" ,name)))
+               (mkdir-p bin-dir)
+               (mkdir-p repo-dir)
+               (copy-recursively "." repo-dir)
+               (delete-file-recursively (string-append repo-dir "/tests"))
+               (symlink (string-append repo-dir "/repo")
+                        (string-append bin-dir "/repo"))))))))
+    (native-inputs
+     `(("nose" ,python2-nose)
+       ("git" ,git)))
+    (home-page "https://code.google.com/p/git-repo/")
+    (synopsis "Helps to manage many Git repositories.")
+    (description "Repo is a tool built on top of Git.  Repo helps manage many
+Git repositories, does the uploads to revision control systems, and automates
+parts of the development workflow.  Repo is not meant to replace Git, only to
+make it easier to work with Git.  The repo command is an executable Python
+script that you can put anywhere in your path.")
+    (license license:asl2.0)))
-- 
2.7.4





Information forwarded to guix-patches <at> gnu.org:
bug#26822; Package guix-patches. (Sun, 07 May 2017 23:47:01 GMT) Full text and rfc822 format available.

Message #8 received at 26822 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 26822 <at> debbugs.gnu.org
Subject: Re: bug#26822: [PATCH] gnu: Add git-repo.
Date: Sun, 7 May 2017 19:46:45 -0400
[Message part 1 (text/plain, inline)]
On Sun, May 07, 2017 at 11:41:07PM +0200, Hartmut Goebel wrote:
> * gnu/packages/android.scm (git-repo): New variable.

Thanks!

> +     `(#:python ,python-2

If it only supports Python 2, can you say so in a comment?

> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'build
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (repo-dir (string-append out "/share/" ,name)))
> +               (substitute* "repo"
> +                 (("^repodir = '\\.repo'")
> +                  (string-append "repodir = '" repo-dir "'"))
> +                 (("^S_repo = 'repo'") "S_repo = '.'"))
> +               #t
> +               )))

For clarify, I think it should delete the build phase (since nothing is
built here) and add a new phase for this substitution.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26822; Package guix-patches. (Mon, 08 May 2017 07:58:01 GMT) Full text and rfc822 format available.

Message #11 received at 26822 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>, 26822 <at> debbugs.gnu.org
Subject: Re: bug#26822: [PATCH] gnu: Add git-repo.
Date: Mon, 08 May 2017 09:57:31 +0200
[Message part 1 (text/plain, inline)]
Hartmut Goebel <h.goebel <at> crazy-compilers.com> writes:

> * gnu/packages/android.scm (git-repo): New variable.
> ---
>  gnu/packages/android.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 58 insertions(+)
>
> diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
> index e23d0fd..23ffa2b 100644
> --- a/gnu/packages/android.scm
> +++ b/gnu/packages/android.scm
> @@ -3,6 +3,7 @@
>  ;;; Copyright © 2015 Kai-Chung Yan <seamlikok <at> gmail.com>
>  ;;; Copyright © 2016 Marius Bakke <mbakke <at> fastmail.com>
>  ;;; Copyright © 2017 Julien Lepiller <julien <at> lepiller.eu>
> +;;; Copyright © 2017 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -23,8 +24,11 @@
>    #:use-module (guix packages)
>    #:use-module (guix git-download)
>    #:use-module (guix build-system gnu)
> +  #:use-module (guix build-system python)
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (gnu packages)
> +  #:use-module (gnu packages python)
> +  #:use-module (gnu packages version-control)
>    #:use-module (gnu packages tls))
>  
>  ;; The Makefiles that we add are largely based on the Debian
> @@ -298,3 +302,57 @@ with an emulator instance or connected Android device.  It facilitates a variety
>  of device actions, such as installing and debugging apps, and it provides access
>  to a Unix shell that can run commands on the connected device or emulator.")
>      (license license:asl2.0)))
> +
> +(define-public git-repo
> +  (package
> +    (name "git-repo")
> +    (version "1.12.37")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://gerrit.googlesource.com/git-repo")
> +             (commit (string-append "v" version))))
> +       (file-name (string-append "git-repo-" version "-checkout"))
> +    (sha256
> +     (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd"))))

The indentation of (sha256.. should align with file-name.

> +    (build-system python-build-system)
> +    (arguments
> +     `(#:python ,python-2
> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'build
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (repo-dir (string-append out "/share/" ,name)))
> +               (substitute* "repo"
> +                 (("^repodir = '\\.repo'")
> +                  (string-append "repodir = '" repo-dir "'"))
> +                 (("^S_repo = 'repo'") "S_repo = '.'"))
> +               #t
> +               )))

These parens want to stay closer to the #t.

> +         (replace 'check
> +           (lambda _
> +             (zero? (system* "python" "-m" "nose"))))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin-dir (string-append out "/bin"))
> +                    (repo-dir (string-append out "/share/" ,name)))
> +               (mkdir-p bin-dir)
> +               (mkdir-p repo-dir)
> +               (copy-recursively "." repo-dir)
> +               (delete-file-recursively (string-append repo-dir "/tests"))
> +               (symlink (string-append repo-dir "/repo")
> +                        (string-append bin-dir "/repo"))))))))

(symlink* ..) has an unspecified return value, so please return #t here.

Otherwise looks good. Would it make sense to have it in
version-control.scm, or is this tool mostly for doing Android
development?

> +    (native-inputs
> +     `(("nose" ,python2-nose)
> +       ("git" ,git)))
> +    (home-page "https://code.google.com/p/git-repo/")
> +    (synopsis "Helps to manage many Git repositories.")
> +    (description "Repo is a tool built on top of Git.  Repo helps manage many
> +Git repositories, does the uploads to revision control systems, and automates
> +parts of the development workflow.  Repo is not meant to replace Git, only to
> +make it easier to work with Git.  The repo command is an executable Python
> +script that you can put anywhere in your path.")
> +    (license license:asl2.0)))
> -- 
> 2.7.4
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26822; Package guix-patches. (Mon, 08 May 2017 08:04:01 GMT) Full text and rfc822 format available.

Message #14 received at 26822 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: Marius Bakke <mbakke <at> fastmail.com>, 26822 <at> debbugs.gnu.org
Subject: Re: bug#26822: [PATCH] gnu: Add git-repo.
Date: Mon, 8 May 2017 10:03:11 +0200
Am 08.05.2017 um 09:57 schrieb Marius Bakke:
> Otherwise looks good. Would it make sense to have it in
> version-control.scm, or is this tool mostly for doing Android
> development?

I've never seen this outside of android development. (And given the poor
quality of the implementation[*], I'd not suggest spreading it.)

[*] The main program also acts as an installer and such.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel <at> crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |





Information forwarded to guix-patches <at> gnu.org:
bug#26822; Package guix-patches. (Mon, 08 May 2017 09:03:02 GMT) Full text and rfc822 format available.

Message #17 received at 26822 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: Marius Bakke <mbakke <at> fastmail.com>, 26822 <at> debbugs.gnu.org
Subject: Re: bug#26822: [PATCH] gnu: Add git-repo.
Date: Mon, 08 May 2017 11:02:42 +0200
Hi,

Thanks for this patch!

Hartmut Goebel <h.goebel <at> crazy-compilers.com> writes:

> Am 08.05.2017 um 09:57 schrieb Marius Bakke:
>> Otherwise looks good. Would it make sense to have it in
>> version-control.scm, or is this tool mostly for doing Android
>> development?
>
> I've never seen this outside of android development. (And given the poor
> quality of the implementation[*], I'd not suggest spreading it.)

We use it at work for non-android development.  But I'm eager to find an
good alternative...

> [*] The main program also acts as an installer and such.




Information forwarded to guix-patches <at> gnu.org:
bug#26822; Package guix-patches. (Fri, 12 May 2017 11:58:01 GMT) Full text and rfc822 format available.

Message #20 received at 26822 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 26822 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add git-repo.
Date: Fri, 12 May 2017 13:56:51 +0200
* gnu/packages/android.scm (git-repo): New variable.
---
 gnu/packages/android.scm | 101 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 101 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index e23d0fd..be3f50a 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2015 Kai-Chung Yan <seamlikok <at> gmail.com>
 ;;; Copyright © 2016 Marius Bakke <mbakke <at> fastmail.com>
 ;;; Copyright © 2017 Julien Lepiller <julien <at> lepiller.eu>
+;;; Copyright © 2017 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,8 +24,13 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
+  #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages ssh)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages tls))
 
 ;; The Makefiles that we add are largely based on the Debian
@@ -298,3 +304,98 @@ with an emulator instance or connected Android device.  It facilitates a variety
 of device actions, such as installing and debugging apps, and it provides access
 to a Unix shell that can run commands on the connected device or emulator.")
     (license license:asl2.0)))
+
+(define-public git-repo
+  (package
+    (name "git-repo")
+    (version "1.12.37")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gerrit.googlesource.com/git-repo")
+             (commit (string-append "v" version))))
+       (file-name (string-append "git-repo-" version "-checkout"))
+       (sha256
+        (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2 ; code says: "Python 3 support is … experimental."
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'set-executable-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (git (assoc-ref inputs "git"))
+                    (gpg (assoc-ref inputs "gnupg"))
+                    (ssh (assoc-ref inputs "ssh")))
+               (substitute* '("repo" "git_command.py")
+                 (("^GIT = 'git' ")
+                  (string-append "GIT = '" git "/bin/git' ")))
+               (substitute* "repo"
+                 ((" cmd = \\['gpg',")
+                  (string-append " cmd = ['" gpg "/bin/gpg',")))
+               (substitute* "git_config.py"
+                 ((" command_base = \\['ssh',")
+                  (string-append " command_base = ['" ssh "/bin/ssh',")))
+               #t)))
+         (add-before 'build 'do-not-clone-this-source
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (repo-dir (string-append out "/share/" ,name)))
+               (substitute* "repo"
+                 (("^def _FindRepo\\(\\):.*")
+                  (format #f "
+def _FindRepo():
+  '''Look for a repo installation, starting at the current directory.'''
+  # Use the installed version of git-repo.
+  repo_main = '~a/main.py'
+  curdir = os.getcwd()
+  olddir = None
+  while curdir != '/' and curdir != olddir:
+    dot_repo = os.path.join(curdir, repodir)
+    if os.path.isdir(dot_repo):
+      return (repo_main, dot_repo)
+    else:
+      olddir = curdir
+      curdir = os.path.dirname(curdir)
+  return None, ''
+
+  # The remaining of this function is dead code.  It was used to
+  # find a git-checked-out version in the local project.\n" repo-dir))
+                 ;; Neither clone, check out, nor verify the git repository
+                 (("(^\\s+)_Clone\\(.*\\)") "")
+                 (("(^\\s+)_Checkout\\(.*\\)") "")
+                 ((" rev = _Verify\\(.*\\)") " rev = None"))
+               #t)))
+         (delete 'build) ; nothing to build
+         (replace 'check
+           (lambda _
+             (zero? (system* "python" "-m" "nose"))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-dir (string-append out "/bin"))
+                    (repo-dir (string-append out "/share/" ,name)))
+               (mkdir-p bin-dir)
+               (mkdir-p repo-dir)
+               (copy-recursively "." repo-dir)
+               (delete-file-recursively (string-append repo-dir "/tests"))
+               (symlink (string-append repo-dir "/repo")
+                        (string-append bin-dir "/repo"))
+               #t))))))
+    (inputs
+     ;; TODO: Add git-remote-persistent-https once it is available in guix
+     `(("git" ,git)
+       ("gnupg" ,gnupg)
+       ("ssh", openssh)))
+    (native-inputs
+     `(("nose" ,python2-nose)))
+    (home-page "https://code.google.com/p/git-repo/")
+    (synopsis "Helps to manage many Git repositories.")
+    (description "Repo is a tool built on top of Git.  Repo helps manage many
+Git repositories, does the uploads to revision control systems, and automates
+parts of the development workflow.  Repo is not meant to replace Git, only to
+make it easier to work with Git.  The repo command is an executable Python
+script that you can put anywhere in your path.")
+    (license license:asl2.0)))
-- 
2.7.4





Information forwarded to guix-patches <at> gnu.org:
bug#26822; Package guix-patches. (Fri, 12 May 2017 12:03:01 GMT) Full text and rfc822 format available.

Message #23 received at 26822 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 26822 <at> debbugs.gnu.org
Cc: Marius Bakke <mbakke <at> fastmail.com>, Leo Famulari <leo <at> famulari.name>
Subject: Re: bug#26822: [PATCH] gnu: Add git-repo.
Date: Fri, 12 May 2017 14:02:41 +0200
Hi,

it showed up that I package description was nor good enough: It only
passed my rudimentary first test, but fails just later. So I needed to
update this patch (respecting you prior feedback).

This package no replaced one function (_FindRepo). I decided to *not*
use a patch for this, but to insert the changed code at the beginning of
_FindRepo and keeping the old code as dead code (with an appropriate
comment). I know, this is ugly, but this program is ugly anyway: There
is no "install", but the front-end script downloads the software using
git and installs it. *shiver*

If you have concerns about this, please speak up.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel <at> crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |





Information forwarded to guix-patches <at> gnu.org:
bug#26822; Package guix-patches. (Fri, 02 Jun 2017 16:21:01 GMT) Full text and rfc822 format available.

Message #26 received at 26822 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 26822 <at> debbugs.gnu.org
Subject: Re: bug#26822: [PATCH] gnu: Add git-repo.
Date: Fri, 02 Jun 2017 18:20:30 +0200
Hi Hartmut,

Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> * gnu/packages/android.scm (git-repo): New variable.

Looks like this second version of the patch addresses Leo’s and Marius’
comments so I think you should push it.

Thanks,
Ludo’.




Reply sent to Hartmut Goebel <h.goebel <at> goebel-consult.de>:
You have taken responsibility. (Sun, 04 Jun 2017 09:46:01 GMT) Full text and rfc822 format available.

Notification sent to Hartmut Goebel <h.goebel <at> crazy-compilers.com>:
bug acknowledged by developer. (Sun, 04 Jun 2017 09:46:02 GMT) Full text and rfc822 format available.

Message #31 received at 26822-close <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> goebel-consult.de>
To: 26822-close <at> debbugs.gnu.org
Subject: merged
Date: Sun, 4 Jun 2017 11:45:26 +0200
pushed as c1151ecf807ead8e4e220ec17133ec0298f18b5a




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 Jul 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 298 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.