guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/04: Rename 'guix substitute-binary' to 'guix substitute'.


From: Ludovic Courtès
Subject: 03/04: Rename 'guix substitute-binary' to 'guix substitute'.
Date: Wed, 25 Mar 2015 09:46:37 +0000

civodul pushed a commit to branch master
in repository guix.

commit 2c74fde00e4e721c6a73646935ab0cfe19dd9188
Author: Ludovic Courtès <address@hidden>
Date:   Wed Mar 25 10:34:27 2015 +0100

    Rename 'guix substitute-binary' to 'guix substitute'.
    
    * guix/scripts/substitute-binary.scm: Rename to...
    * guix/scripts/substitute.scm: ... this.  Adjust module name, entry
      point, comments, and help string accordingly.
    * nix/scripts/substitute-binary.in: Rename to...
    * nix/scripts/substitute.in: ... this.
    * pre-inst-env.in (NIX_SUBSTITUTERS): Adjust accordingly.
    * tests/substitute-binary.scm: Rename to...
    * tests/substitute.scm: ... this.  Adjust references to (guix scripts
      substitute) accordingly.
    * guix/ui.scm (show-guix-help)[internal?]: Change "substitute-binary" to
      "substitute".
    * Makefile.am (MODULES, SCM_TESTS): Adjust to file renames.
    * daemon.am (nodist_pkglibexec_SCRIPTS): Likewise.
    * config-daemon.ac: Likewise.
    * guix/tests.scm (call-with-derivation-narinfo): Adjust comments and
      docstring.
---
 .gitignore                                         |    2 +-
 Makefile.am                                        |    4 +-
 config-daemon.ac                                   |    4 +-
 daemon.am                                          |    2 +-
 .../{substitute-binary.scm => substitute.scm}      |   12 ++--
 guix/tests.scm                                     |    4 +-
 guix/ui.scm                                        |    2 +-
 nix/scripts/substitute-binary.in                   |   11 ----
 nix/scripts/substitute.in                          |   11 ++++
 pre-inst-env.in                                    |    2 +-
 tests/store.scm                                    |   10 ++--
 tests/{substitute-binary.scm => substitute.scm}    |   56 ++++++++++----------
 12 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/.gitignore b/.gitignore
index 3ec3636..eaa7dbd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,7 +96,7 @@ stamp-h[0-9]
 /doc/guix.tp
 /doc/guix.vr
 /doc/guix.vrs
-/nix/scripts/substitute-binary
+/nix/scripts/substitute
 /doc/images/bootstrap-graph.png
 /doc/images/bootstrap-graph.eps
 /guix-register
diff --git a/Makefile.am b/Makefile.am
index 882ab8e..4a1f8d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -96,7 +96,7 @@ MODULES =                                     \
   guix/scripts/gc.scm                          \
   guix/scripts/hash.scm                                \
   guix/scripts/pull.scm                                \
-  guix/scripts/substitute-binary.scm           \
+  guix/scripts/substitute.scm                  \
   guix/scripts/authenticate.scm                        \
   guix/scripts/refresh.scm                     \
   guix/scripts/system.scm                      \
@@ -162,7 +162,7 @@ SCM_TESTS =                                 \
   tests/pk-crypto.scm                          \
   tests/pki.scm                                        \
   tests/sets.scm                               \
-  tests/substitute-binary.scm                  \
+  tests/substitute.scm                         \
   tests/builders.scm                           \
   tests/derivations.scm                                \
   tests/ui.scm                                 \
diff --git a/config-daemon.ac b/config-daemon.ac
index 5f83d45..fb80c75 100644
--- a/config-daemon.ac
+++ b/config-daemon.ac
@@ -133,8 +133,8 @@ if test "x$guix_build_daemon" = "xyes"; then
 
   AC_CONFIG_FILES([nix/scripts/list-runtime-roots],
     [chmod +x nix/scripts/list-runtime-roots])
-  AC_CONFIG_FILES([nix/scripts/substitute-binary],
-    [chmod +x nix/scripts/substitute-binary])
+  AC_CONFIG_FILES([nix/scripts/substitute],
+    [chmod +x nix/scripts/substitute])
   AC_CONFIG_FILES([nix/scripts/guix-authenticate],
     [chmod +x nix/scripts/guix-authenticate])
   AC_CONFIG_FILES([nix/scripts/offload],
diff --git a/daemon.am b/daemon.am
index 5963606..9d6516a 100644
--- a/daemon.am
+++ b/daemon.am
@@ -165,7 +165,7 @@ nix/libstore/schema.sql.hh: nix/libstore/schema.sql
 
 nodist_pkglibexec_SCRIPTS =                    \
   nix/scripts/list-runtime-roots               \
-  nix/scripts/substitute-binary
+  nix/scripts/substitute
 
 if BUILD_DAEMON_OFFLOAD
 
diff --git a/guix/scripts/substitute-binary.scm b/guix/scripts/substitute.scm
similarity index 99%
rename from guix/scripts/substitute-binary.scm
rename to guix/scripts/substitute.scm
index e797c6d..e99c299 100755
--- a/guix/scripts/substitute-binary.scm
+++ b/guix/scripts/substitute.scm
@@ -17,7 +17,7 @@
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
-(define-module (guix scripts substitute-binary)
+(define-module (guix scripts substitute)
   #:use-module (guix ui)
   #:use-module (guix store)
   #:use-module (guix utils)
@@ -53,7 +53,7 @@
   #:export (narinfo-signature->canonical-sexp
             read-narinfo
             write-narinfo
-            guix-substitute-binary))
+            guix-substitute))
 
 ;;; Comment:
 ;;;
@@ -675,7 +675,7 @@ PORT.  REPORT-PROGRESS is a two-argument procedure such as 
that returned by
 ;;;
 
 (define (show-help)
-  (display (_ "Usage: guix substitute-binary [OPTION]...
+  (display (_ "Usage: guix substitute [OPTION]...
 Internal tool to substitute a pre-built binary to a local build.\n"))
   (display (_ "
       --query            report on the availability of substitutes for the
@@ -761,7 +761,7 @@ found."
      ;; daemon.
      "http://hydra.gnu.org";)))
 
-(define (guix-substitute-binary . args)
+(define (guix-substitute . args)
   "Implement the build daemon's substituter protocol."
   (mkdir-p %narinfo-cache-directory)
   (maybe-remove-expired-cached-narinfo)
@@ -882,7 +882,7 @@ substituter disabled~%")
 
             (every (compose zero? cdr waitpid) pids))))
        (("--version")
-        (show-version-and-exit "guix substitute-binary"))
+        (show-version-and-exit "guix substitute"))
        (("--help")
         (show-help))
        (opts
@@ -893,4 +893,4 @@ substituter disabled~%")
 ;;; eval: (put 'with-timeout 'scheme-indent-function 1)
 ;;; End:
 
-;;; substitute-binary.scm ends here
+;;; substitute.scm ends here
diff --git a/guix/tests.scm b/guix/tests.scm
index 0896e84..080ee9c 100644
--- a/guix/tests.scm
+++ b/guix/tests.scm
@@ -126,7 +126,7 @@ Deriver: ~a~%"
 (define* (call-with-derivation-narinfo drv thunk
                                        #:key (sha256 (make-bytevector 32 0)))
   "Call THUNK in a context where fake substituter data, as read by 'guix
-substitute-binary', has been installed for DRV.  SHA256 is the hash of the
+substitute', has been installed for DRV.  SHA256 is the hash of the
 expected output of DRV."
   (let* ((output  (derivation->output-path drv))
          (dir     (%substitute-directory))
@@ -178,7 +178,7 @@ CONTENTS."
     (lambda ()
       (let ((hash (call-with-input-file (string-append dir "/example.nar")
                     port-sha256)))
-        ;; Create fake substituter data, to be read by `substitute-binary'.
+        ;; Create fake substituter data, to be read by 'guix substitute'.
         (call-with-derivation-narinfo drv
           thunk
           #:sha256 (or sha256 hash))))
diff --git a/guix/ui.scm b/guix/ui.scm
index ae37c8e..4929f93 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -815,7 +815,7 @@ parameter of 'args-fold'."
 
 (define (show-guix-help)
   (define (internal? command)
-    (member command '("substitute-binary" "authenticate" "offload")))
+    (member command '("substitute" "authenticate" "offload")))
 
   (format #t (_ "Usage: guix COMMAND ARGS...
 Run COMMAND with ARGS.\n"))
diff --git a/nix/scripts/substitute-binary.in b/nix/scripts/substitute-binary.in
deleted file mode 100644
index 48d7bb8..0000000
--- a/nix/scripts/substitute-binary.in
+++ /dev/null
@@ -1,11 +0,0 @@
address@hidden@
-# A shorthand for "guix substitute-binary", for use by the daemon.
-
-if test "x$GUIX_UNINSTALLED" = "x"
-then
-    prefix="@prefix@"
-    exec_prefix="@exec_prefix@"
-    exec "@bindir@/guix" substitute-binary "$@"
-else
-    exec guix substitute-binary "$@"
-fi
diff --git a/nix/scripts/substitute.in b/nix/scripts/substitute.in
new file mode 100644
index 0000000..5a2eeb7
--- /dev/null
+++ b/nix/scripts/substitute.in
@@ -0,0 +1,11 @@
address@hidden@
+# A shorthand for "guix substitute", for use by the daemon.
+
+if test "x$GUIX_UNINSTALLED" = "x"
+then
+    prefix="@prefix@"
+    exec_prefix="@exec_prefix@"
+    exec "@bindir@/guix" substitute "$@"
+else
+    exec guix substitute "$@"
+fi
diff --git a/pre-inst-env.in b/pre-inst-env.in
index ef9a3ce..fe56da6 100644
--- a/pre-inst-env.in
+++ b/pre-inst-env.in
@@ -44,7 +44,7 @@ export PATH
 # Daemon helpers.
 
 NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots"
-NIX_SUBSTITUTERS="$abs_top_builddir/nix/scripts/substitute-binary"
+NIX_SUBSTITUTERS="$abs_top_builddir/nix/scripts/substitute"
 NIX_BUILD_HOOK="$abs_top_builddir/nix/scripts/offload"
 NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'guix-authenticate'
 
diff --git a/tests/store.scm b/tests/store.scm
index 9ed78be..8e929bb 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -367,7 +367,7 @@
   (with-store s
     (let* ((d (package-derivation s %bootstrap-guile (%current-system)))
            (o (derivation->output-path d)))
-      ;; Create fake substituter data, to be read by `substitute-binary'.
+      ;; Create fake substituter data, to be read by 'guix substitute'.
       (with-derivation-narinfo d
         ;; Remove entry from the local cache.
         (false-if-exception
@@ -375,7 +375,7 @@
                                      "/guix/substitute-binary/"
                                      (store-path-hash-part o))))
 
-        ;; Make sure `substitute-binary' correctly communicates the above
+        ;; Make sure 'guix substitute' correctly communicates the above
         ;; data.
         (set-build-options s #:use-substitutes? #t)
         (and (has-substitutes? s o)
@@ -439,7 +439,7 @@
       (with-derivation-substitute d c
         (sha256 => (make-bytevector 32 0)) ;select a hash that doesn't match C
 
-        ;; Make sure we use `substitute-binary'.
+        ;; Make sure we use 'guix substitute'.
         (set-build-options s
                            #:use-substitutes? #t
                            #:fallback? #f)
@@ -464,9 +464,9 @@
                  #:guile-for-build
                  (package-derivation s %bootstrap-guile (%current-system))))
            (o   (derivation->output-path d)))
-      ;; Create fake substituter data, to be read by `substitute-binary'.
+      ;; Create fake substituter data, to be read by 'guix substitute'.
       (with-derivation-narinfo d
-        ;; Make sure we use `substitute-binary'.
+        ;; Make sure we use 'guix substitute'.
         (set-build-options s #:use-substitutes? #t)
         (and (has-substitutes? s o)
              (guard (c ((nix-protocol-error? c)
diff --git a/tests/substitute-binary.scm b/tests/substitute.scm
similarity index 86%
rename from tests/substitute-binary.scm
rename to tests/substitute.scm
index 7c1204c..5697592 100644
--- a/tests/substitute-binary.scm
+++ b/tests/substitute.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Nikita Karetnikov <address@hidden>
-;;; Copyright © 2014 Ludovic Courtès <address@hidden>
+;;; Copyright © 2014, 2015 Ludovic Courtès <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -17,8 +17,8 @@
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
-(define-module (test-substitute-binary)
-  #:use-module (guix scripts substitute-binary)
+(define-module (test-substitute)
+  #:use-module (guix scripts substitute)
   #:use-module (guix base64)
   #:use-module (guix hash)
   #:use-module (guix serialization)
@@ -95,7 +95,7 @@ version identifier.."
 
 
 
-(test-begin "substitute-binary")
+(test-begin "substitute")
 
 (test-quit "not a number"
     "signature version"
@@ -156,7 +156,7 @@ a file for NARINFO."
           (cute write-file
                 (string-append narinfo-directory "/example.out") <>))
 
-        (set! (@@ (guix scripts substitute-binary)
+        (set! (@@ (guix scripts substitute)
                   %allow-unauthenticated-substitutes?)
               #f))
       thunk
@@ -166,8 +166,8 @@ a file for NARINFO."
 (define-syntax-rule (with-narinfo narinfo body ...)
   (call-with-narinfo narinfo (lambda () body ...)))
 
-;; Transmit these options to 'guix substitute-binary'.
-(set! (@@ (guix scripts substitute-binary) %cache-url)
+;; Transmit these options to 'guix substitute'.
+(set! (@@ (guix scripts substitute) %cache-url)
       (getenv "GUIX_BINARY_SUBSTITUTE_URL"))
 
 (test-equal "query narinfo without signature"
@@ -180,7 +180,7 @@ a file for NARINFO."
          (with-input-from-string (string-append "have " (%store-prefix)
                                                 
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
            (lambda ()
-             (guix-substitute-binary "--query"))))))))
+             (guix-substitute "--query"))))))))
 
 (test-equal "query narinfo with invalid hash"
   ;; The hash in the signature differs from the hash of %NARINFO.
@@ -195,7 +195,7 @@ a file for NARINFO."
          (with-input-from-string (string-append "have " (%store-prefix)
                                                 
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
            (lambda ()
-             (guix-substitute-binary "--query"))))))))
+             (guix-substitute "--query"))))))))
 
 (test-equal "query narinfo signed with authorized key"
   (string-append (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
@@ -209,7 +209,7 @@ a file for NARINFO."
          (with-input-from-string (string-append "have " (%store-prefix)
                                                 
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
            (lambda ()
-             (guix-substitute-binary "--query"))))))))
+             (guix-substitute "--query"))))))))
 
 (test-equal "query narinfo signed with unauthorized key"
   ""                                              ; not substitutable
@@ -225,15 +225,15 @@ a file for NARINFO."
          (with-input-from-string (string-append "have " (%store-prefix)
                                                 
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
            (lambda ()
-             (guix-substitute-binary "--query"))))))))
+             (guix-substitute "--query"))))))))
 
 (test-quit "substitute, no signature"
     "lacks a signature"
   (with-narinfo %narinfo
-    (guix-substitute-binary "--substitute"
-                            (string-append (%store-prefix)
-                                           
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
-                            "foo")))
+    (guix-substitute "--substitute"
+                     (string-append (%store-prefix)
+                                    "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
+                     "foo")))
 
 (test-quit "substitute, invalid hash"
     "hash"
@@ -241,10 +241,10 @@ a file for NARINFO."
   (with-narinfo (string-append %narinfo "Signature: "
                                (signature-field "different body")
                                "\n")
-    (guix-substitute-binary "--substitute"
-                            (string-append (%store-prefix)
-                                           
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
-                            "foo")))
+    (guix-substitute "--substitute"
+                     (string-append (%store-prefix)
+                                    "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
+                     "foo")))
 
 (test-quit "substitute, unauthorized key"
     "unauthorized"
@@ -253,10 +253,10 @@ a file for NARINFO."
                                 %narinfo
                                 #:public-key %wrong-public-key)
                                "\n")
-    (guix-substitute-binary "--substitute"
-                            (string-append (%store-prefix)
-                                           
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
-                            "foo")))
+    (guix-substitute "--substitute"
+                     (string-append (%store-prefix)
+                                    "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
+                     "foo")))
 
 (test-equal "substitute, authorized key"
   "Substitutable data."
@@ -265,15 +265,15 @@ a file for NARINFO."
     (dynamic-wind
       (const #t)
       (lambda ()
-        (guix-substitute-binary "--substitute"
-                                (string-append (%store-prefix)
-                                               
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
-                                "substitute-retrieved")
+        (guix-substitute "--substitute"
+                         (string-append (%store-prefix)
+                                        
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
+                         "substitute-retrieved")
         (call-with-input-file "substitute-retrieved" get-string-all))
       (lambda ()
         (false-if-exception (delete-file "substitute-retrieved"))))))
 
-(test-end "substitute-binary")
+(test-end "substitute")
 
 
 (exit (= (test-runner-fail-count (test-runner-current)) 0))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]