(defpackage asdf-list-packages (:use :cl :asdf) (:export #:*own-packages*)) (in-package asdf-list-packages) (defvar *dependency-packages* '()) (defvar *own-packages* '() "Created packages of the asdf-list-packages system. This list is populated after the asdf-list-packages system is loaded.") (defsystem "asdf-list-packages" ;; system/component metadata :description "Automatically list created packages." :long-description "This demonstrates how to list the created packages of a system." ;; dependencies; installed automatically by quicklisp :depends-on (alexandria) ;; files loaded by asdf for system asdf-list-packages :components ((:file "main" :description "This is the main file, it has one package called MY-PACKAGE.")) :perform (prepare-op :after (o c) (setq *dependency-packages* (list-all-packages))) :perform (load-op :after (o c) (setq *own-packages* (remove-if (lambda (x) (member x *dependency-packages*)) (list-all-packages)))))