From af52ba64fa6350690d65a1aca9c89e13103fd8d0 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 24 Feb 2020 09:31:12 -0500 Subject: gnu: git-repo: Update to 2.3. * gnu/packages/android.scm (git-repo): Update to 2.3. [arguments]: Remove the #:python argument. git-repo v2.x is now compatible with Python 3. [phases]{configure-git}: New phase. {set-executable-paths}: Adapt the substitution rule for the GIT command. {check}: Use the "run_tests" script to launch tests. [native-inputs]: Replace python2-nose by python-test. --- gnu/packages/android.scm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 30dd8925a4..ba883f1ff9 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2019 Andreas Enge ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2020 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -716,7 +717,7 @@ (define-public android-udev-rules (define-public git-repo (package (name "git-repo") - (version "1.12.37") + (version "2.3") (source (origin (method git-fetch) @@ -725,11 +726,10 @@ (define-public git-repo (commit (string-append "v" version)))) (file-name (string-append "git-repo-" version "-checkout")) (sha256 - (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd")))) + (base32 "0jrll0mjfwakyjvlhbxwsdi32jhgss9mwz8c8h24n1qbqqxysrk4")))) (build-system python-build-system) (arguments - `(#:python ,python-2 ; code says: "Python 3 support is … experimental." - #:phases + `(#:phases (modify-phases %standard-phases (add-before 'build 'set-executable-paths (lambda* (#:key inputs outputs #:allow-other-keys) @@ -738,8 +738,8 @@ (define-public git-repo (gpg (assoc-ref inputs "gnupg")) (ssh (assoc-ref inputs "ssh"))) (substitute* '("repo" "git_command.py") - (("^GIT = 'git' ") - (string-append "GIT = '" git "/bin/git' "))) + (("^GIT = 'git'") + (string-append "GIT = '" git "/bin/git'"))) (substitute* "repo" ((" cmd = \\['gpg',") (string-append " cmd = ['" gpg "/bin/gpg',"))) @@ -777,9 +777,14 @@ (define-public git-repo ((" rev = _Verify\\(.*\\)") " rev = None")) #t))) (delete 'build) ; nothing to build + (add-before 'check 'configure-git + (lambda _ + (setenv "HOME" (getcwd)) + (invoke "git" "config" "--global" "user.email" "you@example.com") + (invoke "git" "config" "--global" "user.name" "Your Name"))) (replace 'check (lambda _ - (invoke "python" "-m" "nose"))) + (invoke "./run_tests"))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -798,7 +803,7 @@ (define-public git-repo ("gnupg" ,gnupg) ("ssh" ,openssh))) (native-inputs - `(("nose" ,python2-nose))) + `(("pytest" ,python-pytest))) (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 -- cgit v1.2.3 From 0c0156089cac0b8d4d3c761ba27d3e7e8d6d3bca Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 26 Feb 2020 09:13:03 -0500 Subject: gnu: git-repo: Update to 2.4.1. * gnu/packages/android.scm (git-repo): Update to 2.4.1. --- gnu/packages/android.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index ba883f1ff9..e4f3bff17c 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -717,7 +717,7 @@ (define-public android-udev-rules (define-public git-repo (package (name "git-repo") - (version "2.3") + (version "2.4.1") (source (origin (method git-fetch) @@ -726,7 +726,7 @@ (define-public git-repo (commit (string-append "v" version)))) (file-name (string-append "git-repo-" version "-checkout")) (sha256 - (base32 "0jrll0mjfwakyjvlhbxwsdi32jhgss9mwz8c8h24n1qbqqxysrk4")))) + (base32 "0khg1731927gvin73dcbw1657kbfq4k7agla5rpzqcnwkk5agzg3")))) (build-system python-build-system) (arguments `(#:phases -- cgit v1.2.3 From e64c5a8fe4e99eb4af24ca37574b5d4ab5a389d6 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 26 Feb 2020 11:20:54 -0500 Subject: gnu: git-repo: Really disable self update. * gnu/packages/android.scm (git-repo)[phases]{do-not-self-update}: Rename phase from 'do-not-clone-this-source. Rework the patching done to prevent repo from self updating. {set-executable-paths}: Do not patch the reference to GnuPG, as it is only necessary for the self update mechanism, which is disabled. [inputs]: Remove gnupg. --- gnu/packages/android.scm | 62 ++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index e4f3bff17c..17f5f41fcb 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -735,47 +735,48 @@ (define-public git-repo (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 + (add-before 'build 'do-not-self-update (lambda* (#:key outputs #:allow-other-keys) + ;; Setting the REPO_MAIN variable to an absolute file name is + ;; enough to have _FindRepo return the store main.py file. The + ;; self update mechanism is activated with the call to _Init() in + ;; main(), so we bypass it. + + ;; Ticket requesting upstream to provide a mean to disable the + ;; self update mechanism: + ;; https://bugs.chromium.org/p/gerrit/issues/detail?id=12407. (let* ((out (assoc-ref outputs "out")) - (repo-dir (string-append out "/share/" ,name))) + (repo-main (string-append out "/share/git-repo/main.py"))) (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))) + (("^REPO_MAIN = .*") + (format #f "REPO_MAIN = ~s~%" repo-main)) + ((" _Init\\(args, gitc_init=\\(cmd ==.*" all) + (string-append "True #" all))) + ;; Prevent repo from trying to git describe its version from + ;; the (disabled) self updated copy. + (substitute* "git_command.py" + (("ver = getattr\\(RepoSourceVersion.*") + (format #f "ver = ~s~%" ,version))) + (substitute* "subcmds/version.py" + (("rp_ver = .*") + (format #f "rp_ver = ~s~%" ,version))) + ;; Prevent repo from adding its (disabled) self update copy to + ;; the list of projects to fetch when using 'repo sync'. + (substitute* "subcmds/sync.py" + (("to_fetch\\.extend\\(all_projects\\).*" all) + (string-append "#" all)) + (("self\\._Fetch\\(to_fetch") + "self._Fetch(all_projects") + (("_PostRepoFetch\\(rp, opt\\.repo_verify).*" all) + (string-append "#" all)))))) (delete 'build) ; nothing to build (add-before 'check 'configure-git (lambda _ @@ -800,7 +801,6 @@ (define-public git-repo (inputs ;; TODO: Add git-remote-persistent-https once it is available in guix `(("git" ,git) - ("gnupg" ,gnupg) ("ssh" ,openssh))) (native-inputs `(("pytest" ,python-pytest))) -- cgit v1.2.3