projects/guix·blob java-team · refs

55 lines · 2.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2021, 2024 Ludovic Courtès <[email protected]>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19;;; This file returns a manifest containing origins of all the packages. The
20;;; main purpose is to allow continuous integration services to keep upstream
21;;; source code around. It can also be passed to 'guix weather -m'.
22
23(use-modules (srfi srfi-1) (srfi srfi-26)
24 (ice-9 match) (ice-9 vlist)
25 (guix packages) (guix profiles)
26 (gnu packages))
27
28(define (upstream-origin source)
29 "Return SOURCE without any patches or snippet."
30 (origin (inherit source)
31 (snippet #f) (patches '())))
32
33(define (all-origins)
34 "Return the list of origins referred to by all the packages."
35 (let loop ((packages (all-packages))
36 (origins '())
37 (visited vlist-null))
38 (match packages
39 ((head . tail)
40 (let ((new (remove (cut vhash-assq <> visited)
41 (package-direct-sources head))))
42 (loop tail (append new origins)
43 (fold (cut vhash-consq <> #t <>)
44 visited new))))
45 (()
46 origins))))
47
48;; Return a manifest containing all the origins.
49(manifest (map (lambda (origin)
50 (manifest-entry
51 (name (or (origin-actual-file-name origin)
52 "origin"))
53 (version "0")
54 (item (upstream-origin origin))))
55 (all-origins)))