;;; GNU Guix --- Functional package management for GNU ;;; Copyright 2016 Vincent Legoll ;;; ;;; 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 . (use-modules (guix packages) (gnu packages) (srfi srfi-1) (srfi srfi-26) (ice-9 getopt-long)) (define (revdep pkg) (fold-packages (lambda (package _) (when (any (cut eq? <> (specification->package pkg)) (map second (package-direct-inputs package))) (format #t "~a depends on ~a~%" (package-full-name package) pkg))) #t)) (define (main args) (let* ((option-spec '((version (single-char #\v) (value #f)) (help (single-char #\h) (value #f)))) (options (getopt-long args option-spec)) (help-wanted (option-ref options 'help #f)) (version-wanted (option-ref options 'version #f)) (pkgs (option-ref options '() #f))) (if (or version-wanted help-wanted) (begin (if version-wanted (display "revdep.scm version 0.1\n")) (if help-wanted (display "\ revdev.scm [options|package names] -v, --version Display version -h, --help Display this help\n"))) (map revdep pkgs)))) (main (command-line))