From ff6638d112d794c9c433731643711932452fd2ff Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Jul 2016 16:54:31 +0200 Subject: publish: Handle '/file' URLs, for content-addressed files. * guix/scripts/publish.scm (render-content-addressed-file): New procedure. (http-write): Add 'application/octet-stream' case. (make-request-handler): Add /file/NAME/sha256/HASH URLs. * tests/publish.scm ("/file/NAME/sha256/HASH") ("/file/NAME/sha256/INVALID-NIX-BASE32-STRING") ("/file/NAME/sha256/INVALID-HASH"): New tests. * doc/guix.texi (Invoking guix publish): Mention the /file URLs. --- doc/guix.texi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 7ea9ddfe35..e7b233d828 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5633,6 +5633,20 @@ archive}), the daemon may download substitutes from it: guix-daemon --substitute-urls=http://example.org:8080 @end example +As a bonus, @command{guix publish} also serves as a content-addressed +mirror for source files referenced in @code{origin} records +(@pxref{origin Reference}). For instance, assuming @command{guix +publish} is running on @code{example.org}, the following URL returns the +raw @file{hello-2.10.tar.gz} file with the given SHA256 hash +(represented in @code{nix-base32} format, @pxref{Invoking guix hash}): + +@example +http://example.org/file/hello-2.10.tar.gz/sha256/0ssi1@dots{}ndq1i +@end example + +Obviously, these URLs only work for files that are in the store; in +other cases, they return 404 (``Not Found''). + The following options are available: @table @code -- cgit 1.4.1 From 654c0d97c9de4bf25b9facda1278835883555ae0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 22 Jul 2016 14:39:29 +0200 Subject: doc: Mention quoting and keywords. Suggested by Vincent Legoll . * doc/guix.texi (Defining Packages): Remove quasiquote in 'arguments' example. Mention quoting and keywords, with references to Guile's manual. --- doc/guix.texi | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index e7b233d828..393efab6e4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2387,7 +2387,7 @@ package looks like this: (base32 "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i")))) (build-system gnu-build-system) - (arguments `(#:configure-flags '("--enable-silent-rules"))) + (arguments '(#:configure-flags '("--enable-silent-rules"))) (inputs `(("gawk" ,gawk))) (synopsis "Hello, GNU world: An example GNU package") (description "Guess what GNU Hello prints!") @@ -2452,12 +2452,44 @@ The @code{arguments} field specifies options for the build system @var{gnu-build-system} as a request run @file{configure} with the @code{--enable-silent-rules} flag. +@cindex quote +@cindex quoting +@findex ' +@findex quote +What about these quote (@code{'}) characters? They are Scheme syntax to +introduce a literal list; @code{'} is synonymous with @code{quote}. +@xref{Expression Syntax, quoting,, guile, GNU Guile Reference Manual}, +for details. Here the value of the @code{arguments} field is a list of +arguments passed to the build system down the road, as with @code{apply} +(@pxref{Fly Evaluation, @code{apply},, guile, GNU Guile Reference +Manual}). + +The hash-colon (@code{#:}) sequence defines a Scheme @dfn{keyword} +(@pxref{Keywords,,, guile, GNU Guile Reference Manual}), and +@code{#:configure-flags} is a keyword used to pass a keyword argument +to the build system (@pxref{Coding With Keywords,,, guile, GNU Guile +Reference Manual}). + @item The @code{inputs} field specifies inputs to the build process---i.e., build-time or run-time dependencies of the package. Here, we define an input called @code{"gawk"} whose value is that of the @var{gawk} variable; @var{gawk} is itself bound to a @code{} object. +@cindex backquote (quasiquote) +@findex ` +@findex quasiquote +@cindex comma (unquote) +@findex , +@findex unquote +@findex ,@@ +@findex unquote-splicing +Again, @code{`} (a backquote, synonymous with @code{quasiquote}) allows +us to introduce a literal list in the @code{inputs} field, while +@code{,} (a comma, synonymous with @code{unquote}) allows us to insert a +value in that list (@pxref{Expression Syntax, unquote,, guile, GNU Guile +Reference Manual}). + Note that GCC, Coreutils, Bash, and other essential tools do not need to be specified as inputs here. Instead, @var{gnu-build-system} takes care of ensuring that they are present (@pxref{Build Systems}). -- cgit 1.4.1 From 3c2d03a2b91a085b94c66e7810f358988538d1e4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 21 Jul 2016 18:05:39 +0000 Subject: doc: Add note on gender-neutral wording. Suggested by ng0 . * doc/contributing.texi (Submitting Patches): Add @item regarding gender-neutral wording. --- doc/contributing.texi | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc') diff --git a/doc/contributing.texi b/doc/contributing.texi index 208c6af5e8..dc554d2c76 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -323,6 +323,12 @@ related to the hardware---e.g., use of different instruction set extensions---or to the operating system kernel---e.g., reliance on @code{uname} or @file{/proc} files. +@item +When writing documentation, please use gender-neutral wording when +referring to people, such as +@uref{https://en.wikipedia.org/wiki/Singular_they, singular +``they''@comma{} ``their''@comma{} ``them''}, and so forth. + @end enumerate When posting a patch to the mailing list, use @samp{[PATCH] @dots{}} as -- cgit 1.4.1