From 00677a7e554c79692878bbf56886689c64cd02c1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 19 Aug 2016 17:33:10 +0200 Subject: edit: Do not honor 'GUIX_BUILD_OPTIONS'. * guix/scripts/edit.scm (guix-edit)[parse-arguments]: New procedure. Use it. --- guix/scripts/edit.scm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm index ce3ac4146d..555796a69c 100644 --- a/guix/scripts/edit.scm +++ b/guix/scripts/edit.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2016 Ludovic Courtès ;;; Copyright © 2015 Mathieu Lirzin ;;; ;;; This file is part of GNU Guix. @@ -74,9 +74,16 @@ line." (define (guix-edit . args) + (define (parse-arguments) + ;; Return the list of package names. + (args-fold* args %options + (lambda (opt name arg result) + (leave (_ "~A: unrecognized option~%") name)) + cons + '())) + (with-error-handling - (let* ((specs (parse-command-line args %options '(()) - #:argument-handler cons)) + (let* ((specs (reverse (parse-arguments))) (packages (map specification->package specs))) (for-each (lambda (package) (unless (package-location package) -- cgit v1.2.3 From c52bf877e9352cd9f29afb13fd4f7d39ed38f1a0 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 20 Aug 2016 03:49:42 -0400 Subject: system: Fix 'guix system' when root fs is named by UUID. Fixes . * guix/scripts/system.scm (previous-grub-entries) (display-system-generation): Handle the case where the root device is specified by UUID. --- guix/scripts/system.scm | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'guix') diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 209ebf9752..4b53c3d263 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -52,6 +52,7 @@ #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) #:use-module (ice-9 match) + #:use-module (rnrs bytevectors) #:export (guix-system read-operating-system)) @@ -397,6 +398,9 @@ it atomically, and then run OS's activation script." read-boot-parameters)) (label (boot-parameters-label params)) (root (boot-parameters-root-device params)) + (root-device (if (bytevector? root) + (uuid->string root) + root)) (kernel (boot-parameters-kernel params)) (kernel-arguments (boot-parameters-kernel-arguments params))) (menu-entry @@ -405,7 +409,7 @@ it atomically, and then run OS's activation script." (seconds->string time) ")")) (linux kernel) (linux-arguments - (cons* (string-append "--root=" root) + (cons* (string-append "--root=" root-device) #~(string-append "--system=" #$system) #~(string-append "--load=" #$system "/boot") kernel-arguments)) @@ -473,18 +477,21 @@ list of services." #:optional (profile %system-profile)) "Display a summary of system generation NUMBER in a human-readable format." (unless (zero? number) - (let* ((generation (generation-file-name profile number)) - (param-file (string-append generation "/parameters")) - (params (call-with-input-file param-file read-boot-parameters)) - (label (boot-parameters-label params)) - (root (boot-parameters-root-device params)) - (kernel (boot-parameters-kernel params))) + (let* ((generation (generation-file-name profile number)) + (param-file (string-append generation "/parameters")) + (params (call-with-input-file param-file read-boot-parameters)) + (label (boot-parameters-label params)) + (root (boot-parameters-root-device params)) + (root-device (if (bytevector? root) + (uuid->string root) + root)) + (kernel (boot-parameters-kernel params))) (display-generation profile number) (format #t (_ " file name: ~a~%") generation) (format #t (_ " canonical file name: ~a~%") (readlink* generation)) ;; TRANSLATORS: Please preserve the two-space indentation. (format #t (_ " label: ~a~%") label) - (format #t (_ " root device: ~a~%") root) + (format #t (_ " root device: ~a~%") root-device) (format #t (_ " kernel: ~a~%") kernel)))) (define* (list-generations pattern #:optional (profile %system-profile)) -- cgit v1.2.3 From b47f7510f032b795c60b1fa6628562e9f62044e4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 26 Aug 2016 15:14:20 -0500 Subject: base64: Restore original license header. When incorporating a copyleft licensed program with a lax licensed program, it is correct to preserve the original license notice. See also: https://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html * guix/base64.scm: Restored original license header. --- guix/base64.scm | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/base64.scm b/guix/base64.scm index e4d2ec589b..4bd5dc5e1b 100644 --- a/guix/base64.scm +++ b/guix/base64.scm @@ -6,8 +6,6 @@ ;; ;; Some optimizations made by Ludovic Courtès , 2015. ;; -;; Copyright © 2009, 2010 Göran Weinholt -;; ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or @@ -20,6 +18,30 @@ ;; ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . +;; +;; This file incorporates work covered by the following copyright and +;; permission notice: +;; +;; Copyright © 2009, 2010 Göran Weinholt +;; +;; Permission is hereby granted, free of charge, to any person obtaining a +;; copy of this software and associated documentation files (the "Software"), +;; to deal in the Software without restriction, including without limitation +;; the rights to use, copy, modify, merge, publish, distribute, sublicense, +;; and/or sell copies of the Software, and to permit persons to whom the +;; Software is furnished to do so, subject to the following conditions: +;; +;; The above copyright notice and this permission notice shall be included in +;; all copies or substantial portions of the Software. +;; +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +;; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +;; DEALINGS IN THE SOFTWARE. + #!r6rs ;; RFC 4648 Base-N Encodings -- cgit v1.2.3 From a34b236c17f5f7a29c3ce05766071b57e8cdb271 Mon Sep 17 00:00:00 2001 From: David Craven Date: Fri, 5 Aug 2016 19:15:56 +0200 Subject: import: Importers return prefixed licenses. * guix/import/utils.scm (define-module): Import licenses with license: prefix. (string->licenses): Use prefixed licenses. (license->symbol): Return symbols with the prefix license:. * guix/tests/pypi.scm (pypi->guix-package): Update test cases. * guix/tests/gem.scm (gem->guix-package): Update test case. --- guix/import/utils.scm | 26 +++++++++++++------------- tests/gem.scm | 2 +- tests/pypi.scm | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'guix') diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 44e004b084..93cd0f0fa5 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -22,7 +22,7 @@ #:use-module (srfi srfi-1) #:use-module (guix hash) #:use-module (guix base32) - #:use-module (guix licenses) + #:use-module ((guix licenses) #:prefix license:) #:use-module (guix utils) #:use-module ((guix build download) #:prefix build:) #:export (factorize-uri @@ -112,12 +112,12 @@ recursively apply the procedure to the sub-list." (define (string->license str) "Convert the string STR into a license object." (match str - ("GNU LGPL" lgpl2.0) - ("GPL" gpl3) - ((or "BSD" "BSD License") bsd-3) - ((or "MIT" "MIT license" "Expat license") expat) - ("Public domain" public-domain) - ((or "Apache License, Version 2.0" "Apache 2.0") asl2.0) + ("GNU LGPL" license:lgpl2.0) + ("GPL" license:gpl3) + ((or "BSD" "BSD License") license:bsd-3) + ((or "MIT" "MIT license" "Expat license") license:expat) + ("Public domain" license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") license:asl2.0) (_ #f))) (define (license->symbol license) @@ -125,12 +125,12 @@ recursively apply the procedure to the sub-list." to in the (guix licenses) module, or #f if there is no such known license." ;; TODO: Traverse list public variables in (guix licenses) instead so we ;; don't have to maintain a list manualy. - (assoc-ref `((,lgpl2.0 . lgpl2.0) - (,gpl3 . gpl3) - (,bsd-3 . bsd-3) - (,expat . expat) - (,public-domain . public-domain) - (,asl2.0 . asl2.0)) + (assoc-ref `((,license:lgpl2.0 . license:lgpl2.0) + (,license:gpl3 . license:gpl3) + (,license:bsd-3 . license:bsd-3) + (,license:expat . license:expat) + (,license:public-domain . license:public-domain) + (,license:asl2.0 . license:asl2.0)) license)) (define (snake-case str) diff --git a/tests/gem.scm b/tests/gem.scm index 0b37c70142..a46c2b1439 100644 --- a/tests/gem.scm +++ b/tests/gem.scm @@ -71,7 +71,7 @@ ('synopsis "A cool gem") ('description "This package provides a cool gem") ('home-page "https://example.com") - ('license ('list 'expat 'asl2.0))) + ('license ('list 'license:expat 'license:asl2.0))) #t) (x (pk 'fail x #f))))) diff --git a/tests/pypi.scm b/tests/pypi.scm index 01d8a575ab..ab4e9c958b 100644 --- a/tests/pypi.scm +++ b/tests/pypi.scm @@ -130,7 +130,7 @@ baz > 13.37") ('home-page "http://example.com") ('synopsis "summary") ('description "summary") - ('license 'lgpl2.0)) + ('license 'license:lgpl2.0)) (string=? (bytevector->nix-base32-string test-source-hash) hash)) @@ -190,7 +190,7 @@ baz > 13.37") ('home-page "http://example.com") ('synopsis "summary") ('description "summary") - ('license 'lgpl2.0)) + ('license 'license:lgpl2.0)) (string=? (bytevector->nix-base32-string test-source-hash) hash)) -- cgit v1.2.3 From fd59105c49965db956fac73c68d8b00d068f5d5c Mon Sep 17 00:00:00 2001 From: Roel Janssen Date: Sun, 28 Aug 2016 16:22:19 +0200 Subject: guix scripts: Disable grafting on dry runs. * guix/scripts/archive.scm, guix/scripts/build.scm, guix/scripts/environment.scm, guix/scripts/system.scm, guix/scripts/package.scm: Disable grafting when a dry-run parameter is given. --- guix/scripts/archive.scm | 2 +- guix/scripts/build.scm | 2 +- guix/scripts/environment.scm | 2 +- guix/scripts/package.scm | 3 ++- guix/scripts/system.scm | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm index e06c38aaab..8c7322d617 100644 --- a/guix/scripts/archive.scm +++ b/guix/scripts/archive.scm @@ -162,7 +162,7 @@ Export/import one or more packages from/to the store.\n")) (alist-cons 'expression arg result))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) - (alist-cons 'dry-run? #t result))) + (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) %standard-build-options)) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index a02a0d5792..9a113b4ebe 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -541,7 +541,7 @@ must be one of 'package', 'all', or 'transitive'~%") (alist-cons 'file arg result))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) - (alist-cons 'dry-run? #t result))) + (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) (option '(#\r "root") #t #f (lambda (opt name arg result) (alist-cons 'gc-root arg result))) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 9f72b7bf24..0c69bfc9d3 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -226,7 +226,7 @@ COMMAND or an interactive shell in that environment.\n")) (alist-cons 'ad-hoc? #t result))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) - (alist-cons 'dry-run? #t result))) + (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) (option '(#\s "system") #t #f (lambda (opt name arg result) (alist-cons 'system arg diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 2a751a4552..fd42cdb36e 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -486,7 +486,8 @@ kind of search path~%") #f))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result arg-handler) - (values (alist-cons 'dry-run? #t result) + (values (alist-cons 'dry-run? #t + (alist-cons 'graft? #f result)) #f))) (option '("bootstrap") #f #f (lambda (opt name arg result arg-handler) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 4b53c3d263..a9fe7d5975 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -750,7 +750,7 @@ Build the operating system declared in FILE according to ACTION.\n")) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) - (alist-cons 'dry-run? #t result))) + (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) (option '(#\s "system") #t #f (lambda (opt name arg result) (alist-cons 'system arg -- cgit v1.2.3 From 83f18e06530f025df9f6c5059bfe261a1291a24f Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Tue, 23 Aug 2016 02:08:02 -0500 Subject: guix: lint: Check descriptions for trademark signs. * guix/scripts/lint.scm (check-description-style): Emit a warning if trademark signs found in description. * tests/lint.scm (description: may not contain trademark signs): Add test. --- guix/scripts/lint.scm | 13 +++++++++++++ tests/lint.scm | 16 +++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 51191e7e7b..eac3214bbf 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -161,6 +161,18 @@ markup is valid return a plain-text version of DESCRIPTION, otherwise #f." 'description) #f))) + (define (check-trademarks description) + "Check that DESCRIPTION does not contain '™' or '®' characters. See +http://www.gnu.org/prep/standards/html_node/Trademarks.html." + (match (string-index description (char-set #\™ #\®)) + ((and (? number?) index) + (emit-warning package + (format #f (_ "description should not contain ~ +trademark sign '~a' at ~d") + (string-ref description index) index) + 'description)) + (else #t))) + (define (check-proper-start description) (unless (or (properly-starts-sentence? description) (string-prefix-ci? (package-name package) description)) @@ -191,6 +203,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}") (if (string? description) (begin (check-not-empty description) + (check-trademarks description) ;; Use raw description for this because Texinfo rendering ;; automatically fixes end of sentence space. (check-end-of-sentence-space description) diff --git a/tests/lint.scm b/tests/lint.scm index 770f43e57f..df69d2b4b1 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013 Cyril Roelandt -;;; Copyright © 2014, 2015 Eric Bavier +;;; Copyright © 2014, 2015, 2016 Eric Bavier ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2015, 2016 Mathieu Lirzin ;;; @@ -203,6 +203,20 @@ string) on HTTP requests." "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD).")))) (check-description-style pkg))))) +(test-assert "description: may not contain trademark signs" + (and (->bool + (string-contains (with-warnings + (let ((pkg (dummy-package "x" + (description "Does The Right Thing™")))) + (check-description-style pkg))) + "should not contain trademark sign")) + (->bool + (string-contains (with-warnings + (let ((pkg (dummy-package "x" + (description "Works with Format®")))) + (check-description-style pkg))) + "should not contain trademark sign")))) + (test-assert "synopsis: not a string" (->bool (string-contains (with-warnings -- cgit v1.2.3