unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <m.othacehe@gmail.com>
To: 27550@debbugs.gnu.org
Subject: [bug#27550] [PATCH 1/2] repo: remove git-repo.
Date: Sat,  1 Jul 2017 17:02:50 +0200	[thread overview]
Message-ID: <20170701150251.14913-1-m.othacehe@gmail.com> (raw)
In-Reply-To: <20170701150043.14654-1-m.othacehe@gmail.com>

* src/cuirass/repo.scm (git-repo): Remove it.
* tests/repo.scm: Remove related tests.

git-repo is not used and it's usecases will be covered by (guix git).
---
 src/cuirass/repo.scm | 38 +-------------------------------------
 tests/repo.scm       | 32 --------------------------------
 2 files changed, 1 insertion(+), 69 deletions(-)

diff --git a/src/cuirass/repo.scm b/src/cuirass/repo.scm
index be5ea5b..26ea328 100644
--- a/src/cuirass/repo.scm
+++ b/src/cuirass/repo.scm
@@ -30,8 +30,7 @@
             repo-snapshot
             repo-updater
             repo-update
-            file-repo
-            git-repo))
+            file-repo))
 
 (define-immutable-record-type <repo>
   ;; An Abstract repository.  Use "repo" as a shortname for "repository".
@@ -79,38 +78,3 @@
             #:location file-name
             #:snapshoter file-repo-snapshot
             #:updater file-repo-update))))
-
-(define git-repo
-  (let ((git       "git")
-        (hash-algo "sha256"))
-    (define (git-repo-snapshot this store)
-      "Add a snapshot of URL to STORE. "
-      (let ((dir (repo-location this))
-            (id  (repo-id this)))
-        (call-with-temporary-directory
-         (λ (tmpdir)
-           (let ((tmp-repo (string-append tmpdir "/" dir)))
-             (and (zero? (system* "cp" "-R" dir tmpdir))
-                  (with-directory-excursion tmp-repo
-                    (zero? (system* "rm" "-rf" ".git")))
-                  (add-to-store store id #t hash-algo tmp-repo)))))))
-
-    (define (git-repo-update this ref)
-      (let ((url (repo-url this))
-            (dir (repo-location this)))
-        (and
-         (or (file-exists? dir)
-             (zero? (system* git "clone" url dir))
-             (error "file not found"))
-         (with-directory-excursion dir
-           (and (zero? (system* git "pull"))
-                (zero? (system* git "reset" "--hard" ref)))))))
-
-    (λ* (#:key url dir)
-      "Create a Git repository.  URL is the location of the remote repository.
-REF is the identifier that is tracked."
-      (repo #:id dir
-            #:url url
-            #:location dir
-            #:snapshoter git-repo-snapshot
-            #:updater git-repo-update))))
diff --git a/tests/repo.scm b/tests/repo.scm
index fc73a64..8890c0a 100644
--- a/tests/repo.scm
+++ b/tests/repo.scm
@@ -76,38 +76,6 @@ name."
   ;; Cleanup.
   (delete-file file-name))
 
-;;;
-;;; Git repository.
-;;;
-
-(define (create-git-repository name)
-  (let ((git "git"))
-    (system* git "init" name)
-    (with-directory-excursion name
-      (create-file "foo")
-      (system* git "add" "foo")
-      (system* git "commit" "-m" "'foo'"))))
-
-(test-group-with-cleanup "git-repo"
-  (define rpt (git-repo #:url file-name
-                        #:dir "git-example"))
-
-  ;; Since repository doesn't exist yet, 'repo-update' should throw an error.
-  (test-error "git-repo-update: file not found"
-    'system-error
-    (repo-update rpt "master"))
-
-  (create-git-repository file-name)
-
-  (test-assert "git-repo-update"
-    (repo-update rpt "master"))
-
-  (test-assert "git-repo-snapshot"
-    (in-store? (repo-snapshot rpt store)))
-
-  ;; Cleanup.
-  (system* "rm" "-rf" file-name "git-example"))
-
 (close-connection store)
 
 (test-end)
-- 
2.13.1

  reply	other threads:[~2017-07-01 15:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-01 15:00 [bug#27550] [PATCH 0/2] cuirass: Prepare (guix git) integration Mathieu Othacehe
2017-07-01 15:02 ` Mathieu Othacehe [this message]
2017-07-01 15:02   ` [bug#27550] [PATCH 2/2] utils: Remove useless procedures Mathieu Othacehe
2017-07-03 12:07 ` [bug#27550] [PATCH 0/2] cuirass: Prepare (guix git) integration Ludovic Courtès
2017-07-03 12:15   ` Mathieu Othacehe
2017-07-03 13:52     ` Mathieu Othacehe
2017-07-04 21:32       ` Ludovic Courtès
2017-07-05  7:42         ` Mathieu Othacehe
2017-07-05 11:54           ` Mathieu Othacehe
2017-07-05 21:45             ` Ludovic Courtès
2017-07-06  7:00               ` bug#27550: " Mathieu Othacehe
2017-07-05 21:44           ` [bug#27550] " Ludovic Courtès
2017-07-03 14:14     ` Ludovic Courtès
2017-07-03 14:28       ` Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170701150251.14913-1-m.othacehe@gmail.com \
    --to=m.othacehe@gmail.com \
    --cc=27550@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).