aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix 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 (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

;;;
;;; Generate AUTHORS file for directory with the Guix git repository.
;;;

(use-modules
 (ice-9 popen)
 (ice-9 rdelim)
 (ice-9 match)
 (srfi srfi-1)
 (guix config)
 (guix utils)
 (guix build utils))

(define %guix-dir
  (make-parameter #f))

(define-syntax-rule (append-maybe init-lst (test add-lst) ...)
  (let* ((lst init-lst)
         (lst (if test
                  (append lst add-lst)
                  lst))
         ...)
    lst))

(define (command-output cmd . args)
  "Execute CMD with ARGS and return its output without trailing newspace."
  (let* ((port (apply open-pipe* OPEN_READ cmd args))
         (output (read-string port)))
    (close-port port)
    (string-trim-right output #\newline)))

(define (git-output . args)
  "Execute git command with ARGS and return its output without trailing
newspace."
  (with-directory-excursion (%guix-dir)
    (apply command-output "git" args)))

(define* (contributors-string #:optional (range "HEAD"))
  "Return a string with names of people contributed to commit RANGE."
  (git-output "shortlog" "--numbered" "--summary" "--email" range))

(define* (tags #:key pattern sort)
  "Return a list of the git repository tags.
PATTERN is passed to '--list' and SORT is passed to '--sort' options of
'git tag' command."
  (let* ((args (append-maybe
                '("tag")
                (pattern (list "--list" pattern))
                (sort    (list "--sort" sort))))
         (output (apply git-output args)))
    (string-split output #\newline)))

(define (version-tags)
  "Return only version tags (v0.8, etc.) sorted from the biggest version
to the smallest one."
  (tags #:pattern "v*"
        #:sort "-version:refname"))

(define (generate-authors-file file)
  "Generate authors FILE."
  (define previous-release-tag
    (find (lambda (tag)
            (version>? %guix-version
                       (substring tag 1))) ; remove leading 'v'
          (version-tags)))

  (define release-range
    (string-append previous-release-tag "..HEAD"))

  (with-output-to-file file
    (lambda ()
      (display "\
GNU Guix consists of Scheme code that implements the deployment model
of the Nix package management tool.  In fact, it currently talks to a
build daemon whose code comes from Nix (see the manual for details.)

Nix was initially written by Eelco Dolstra; other people have been
contributing to it.  See `nix/AUTHORS' for details.\n\n")
      (format #t "Contributors to GNU Guix ~a:\n\n"
              %guix-version)
      (display (contributors-string release-range))
      (newline) (newline)
      (display "Overall contributors:\n\n")
      (display (contributors-string))
      (newline))))

(define (show-help)
  (match (command-line)
    ((me _ ...)
     (format #t "Usage: guile ~a DIRECTORY AUTHORS
Generate AUTHORS file for DIRECTORY with the Guix git repository.\n"
             me))))

(match (command-line)
  ((_ guix-dir authors-file)
   (parameterize ((%guix-dir guix-dir))
     (generate-authors-file authors-file)))
  (_
   (show-help)
   (exit 1)))

;;; generate-authors.scm ends here
tr>2018-03-20Merge branch 'master' into core-updatesMark H Weaver 2018-03-19gnu: bash-completion: Update to 2.8....* gnu/packages/bash.scm (bash-completion): Update to 2.8. * gnu/packages/patches/bash-completion-directories.patch: Update context. Tobias Geerinckx-Rice 2018-03-16gnu: bash: Return #t from 'install-sh-symlink' phase....* gnu/packages/bash.scm (bash)[arguments]: Return #t from 'install-sh-symlink' phase. Mark H Weaver 2018-03-04gnu: bash: Don't specify default configuration filenames....* gnu/packages/bash.scm (bash): Remove SYS_BASHRC and SYS_BASH_LOGOUT. Roel Janssen 2018-02-20gnu: bash: Update to patch level 19....* gnu/packages/bash.scm (%patch-series-4.4): Add patches 13 through 19. Marius Bakke 2017-07-23Merge branch 'master' into core-updatesLeo Famulari 2017-07-23gnu: bash-completion: Update to 2.7....* gnu/packages/bash.scm (bash-completion): Update to 2.7. Efraim Flashner 2017-07-10Merge branch 'master' into core-updatesLeo Famulari 2017-07-06gnu: bash-completion: Update to 2.6....* gnu/packages/bash.scm (bash-completion): Update to 2.6. Tobias Geerinckx-Rice 2017-06-02gnu: bash-minimal: Simplify 'arguments' field....* gnu/packages/bash.scm (bash-minimal)[arguments]: Remove 'let' and use 'substitute-keyword-arguments' directly. Ludovic Courtès 2017-05-30gnu: bash-minimal: Override keywords from 'bash'....'bash-minimal' is a package derived from 'bash' package. 'bash-minimal' is supposed to override keywords from 'bash', but does not do it due to ordering issue. This patch moves #:modules last. Fixes the bootstrap failure reported by rennes and Manolis Ragkousis and tracked down by Andy Wingo in <https://lists.gnu.org/archive/html/guix-devel/2017-05/msg00010.html>. * gnu/packages/bash.scm (bash-minimal)[arguments]: Move #:modules after (package-arguments bash). Signed-off-by: Ludovic Courtès <ludo@gnu.org> Sergei Trofimovich 2017-03-30Merge branch 'master' into core-updates...Most conflicts are from 6fd52309b8f52c9bb59fccffac53e029ce94b698. Marius Bakke 2017-03-30gnu: Use HTTPS for almost all gnu.org HOME-PAGEs....All HTTP gnu.org (and supported subdomain) HOME-PAGEs changed to HTTPS. Tobias Geerinckx-Rice 2017-03-09Merge branch 'master' into core-updatesLudovic Courtès 2017-03-07gnu: bash: Use the bootstrap Guile in 'url-fetch/reset-patch-level'....Fixes <http://bugs.gnu.org/25775>. Reported by Sirgazil, Ricardo Wurmus, Andy Wingo, and others. * guix/download.scm (in-band-download): Always use GUILE. This reverts 9f05908fb1e3707cae593d94688748294717a546. * gnu/packages/bash.scm (url-fetch/reset-patch-level): Remove #:guile. Pass %BOOTSTRAP-GUILE as #:guile to 'url-fetch'. Remove #:guile-for-build argument in 'gexp->derivation' call. Ludovic Courtès 2017-02-22gnu: bash-completion: Update to 2.5....* gnu/packages/bash.scm (bash-completion): Update to 2.5. Marius Bakke 2017-02-20gnu: bash: Update to patch level 12....* gnu/packages/bash.scm (%patch-series-4.4): Add patch 12. Efraim Flashner 2017-02-10gnu: bash: Remove graft for CVE-2017-5932....* gnu/packages/bash.scm (bash)[replacement]: Remove. (bash-minimal)[replacement]: Remove. (url-fetch/reset-patch-level, bash/fixed): Remove. Ludovic Courtès 2017-02-10Merge branch 'master' into core-updatesLudovic Courtès 2017-02-10gnu: bash: Add graft for patch #7 [fixes CVE-2017-5932]....* gnu/packages/bash.scm (bash)[replacement]: New field. (bash-minimal): Likewise. (url-fetch/reset-patch-level): New procedure. (bash/fixed): New variable. Ludovic Courtès 2017-02-10gnu: bash: Update patch URL to 4.4....* gnu/packages/bash.scm (patch-url): Change "43" to "44". Ludovic Courtès 2017-02-09gnu: bash-minimal: Assume getcwd works correctly when cross-compiling...* gnu/packages/bash.scm (bash-minimal): Assume getcwd works correctly when cross compiling. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Carlos Sánchez de La Lama 2017-02-09gnu: bash-minimal: Assume getcwd works correctly when cross-compiling...* gnu/packages/bash.scm (bash-minimal): Assume getcwd works correctly when cross compiling. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Carlos Sánchez de La Lama 2017-01-27gnu: bash: Do not retain dependency on Coreutils....Previously the "include" output of BASH-FINAL would refer to 'bootstrap-binaries' via 'Makefile.inc'. * gnu/packages/bash.scm (bash)[arguments]: In 'move-development-files' phase, remove absolute file name of 'install' from the 'INSTALL' variable in 'Makefile.inc'. * gnu/packages/commencement.scm (bash-final)[arguments]: Pass #:disallowed-references. Ludovic Courtès 2017-01-21gnu: bash: Update to patch level 11....* gnu/packages/bash.scm (%patch-series-4.4): Add patches 6 through 11. Leo Famulari 2016-11-27gnu: bash: Update to patch level 5....* gnu/packages/bash.scm (%patch-url-seqno): Update for bash-4.4. (%patch-series-4.4): Add patches 1 to 5. Efraim Flashner 2016-10-13gnu: bash-minimal: Remove "include" output....* gnu/packages/bash.scm (bash-minimal)[outputs]: New field. (static-bash)[outputs]: Remove. Ludovic Courtès 2016-10-12Merge branch 'master' into core-updatesMark H Weaver 2016-10-10gnu: bash-completion: Update to 2.4....* gnu/packages/bash.scm (bash-completion): Update to 2.4. [home-page]: Update to redirected home-page. Efraim Flashner 2016-10-02gnu: bash-minimal: Remove 'move-development-files' phase....* gnu/packages/bash.scm (bash-minimal)[arguments]: Delete 'move-development-files' phase. (static-bash)[arguments]: Remove deletion of 'move-development-files' phase. Ludovic Courtès 2016-10-01gnu: bash-minimal: Disable loadable module support....* gnu/packages/bash.scm (bash-minimal)[arguments]: Add 'ac_cv_func_dlopen=no' to #:configure-flags. Ludovic Courtès 2016-10-01gnu: bash: Update to 4.4....* gnu/packages/bash.scm (%patch-series-4.3): Remove. (%patch-series-4.4): New variable. (bash)[source]: Update to 4.4. [native-inputs]: Remove. [arguments]: Remove (ice-9 regex) modules; add (srfi srfi-26). Inline 'install-sh-symlink' phase. Remove 'install-headers' phase. Add 'move-development-files' phase. [native-search-paths]: New field. (static-bash)[outputs]: New field. [arguments]: Delete 'move-development-files' phase. * gnu/packages/commencement.scm (static-bash-for-glibc) (bash-final): Remove 'native-inputs'. Ludovic Courtès 2016-10-01gnu: bash-static: Use 'modify-phases'....* gnu/packages/bash.scm (static-bash)[arguments]: Use 'modify-phases'. Ludovic Courtès 2016-08-09gnu: bash-completion: Update to 2.3. Update the patch....* gnu/packages/bash.scm (bash-completion): Update to 2.3. * gnu/packages/patches/bash-completion-directories.patch: New version of the patch for the same purpose. Tomáš Čech 2016-08-09gnu: bash-completion: Modify to modify-phases....* gnu/packages/bash.scm (bash-completion): Use modify-phases instead of alist-cons-after. Tomáš Čech