aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-02-23 12:44:43 +0100
committerLudovic Courtès <ludo@gnu.org>2016-02-23 12:45:25 +0100
commit561360a589d2bea0b01b38aa9049b8e69cfad2e7 (patch)
tree48349b7c4345c254325d15bd172cde2775d767f6 /doc
parent5a179844e70fb41e9747f7ba0e723184a52e757d (diff)
downloadpatches-561360a589d2bea0b01b38aa9049b8e69cfad2e7.tar
patches-561360a589d2bea0b01b38aa9049b8e69cfad2e7.tar.gz
doc: Add example of VCS-snapshot version numbers.
* doc/guix.texi (Version Numbers): Add example for VCS version numbers.
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi21
1 files changed, 20 insertions, 1 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 51b0652aae..ec05461faa 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -10456,7 +10456,26 @@ field to, say, 7 digits. It avoids an aesthetic annoyance (assuming
aesthetics have a role to play here) as well as problems related to OS
limits such as the maximum shebang length (127 bytes for the Linux
kernel.) It is best to use the full commit identifiers in
-@code{origin}s, though, to avoid ambiguities.
+@code{origin}s, though, to avoid ambiguities. A typical package
+definition may look like this:
+
+@example
+(define my-package
+ (let ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7"))
+ (package
+ (version (string-append "0.9-1."
+ (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "git://example.org/my-package.git")
+ (commit commit)))
+ (sha256 (base32 "1mbikn@dots{}"))
+ (file-name (string-append "my-package-" version
+ "-checkout"))))
+ ;; @dots{}
+ )))
+@end example
@node Synopses and Descriptions
@subsection Synopses and Descriptions