backward-driver.lisp 2.58 KB
Newer Older
1
2
3
;;;; -------------------------------------------------------------------------
;;; Hacks for backward-compatibility of the driver

4
5
6
(uiop/package:define-package :uiop/backward-driver
  (:use :uiop/common-lisp :uiop/package :uiop/utility
   :uiop/pathname :uiop/stream :uiop/os :uiop/image
7
   :uiop/run-program :uiop/lisp-build :uiop/configuration)
8
  (:export
9
   #:coerce-pathname
10
11
   #:user-configuration-directories #:system-configuration-directories
   #:in-first-directory #:in-user-configuration-directory #:in-system-configuration-directory
12
   ))
13
(in-package :uiop/backward-driver)
14
15
16

;;;; Backward compatibility with various pathname functions.

17
18
19
(with-upgradability ()
  (defun coerce-pathname (name &key type defaults)
    ;; For backward-compatibility only, for people using internals
20
21
    ;; Reported users in quicklisp 2015-11: hu.dwim.asdf (removed in next release)
    ;; Will be removed after 2015-12.
22
23
    ;;(warn "Please don't use ASDF::COERCE-PATHNAME. Use ASDF/PATHNAME:PARSE-UNIX-NAMESTRING.")
    (parse-unix-namestring name :type type :defaults defaults))
24

25
26
  ;; Backward compatibility for ASDF 2.27 to 3.1.4
  (defun user-configuration-directories ()
Robert Goldman's avatar
Robert Goldman committed
27
28
    "Return the current user's list of user configuration directories
for configuring common-lisp.
29
30
    DEPRECATED. Use uiop:xdg-config-pathnames instead."
    (xdg-config-pathnames "common-lisp"))
31
  (defun system-configuration-directories ()
Robert Goldman's avatar
Robert Goldman committed
32
33
    "Return the list of system configuration directories for common-lisp.
    DEPRECATED. Use uiop:config-system-pathnames instead."
34
    (system-config-pathnames "common-lisp"))
35
  (defun in-first-directory (dirs x &key (direction :input))
Robert Goldman's avatar
Robert Goldman committed
36
37
38
39
40
41
    "Finds the first appropriate file named X in the list of DIRS for I/O
in DIRECTION \(which may be :INPUT, :OUTPUT, :IO, or :PROBE).
   If direction is :INPUT or :PROBE, will return the first extant file named
X in one of the DIRS.
   If direction is :OUTPUT or :IO, will simply return the file named X in the
first element of DIRS that exists. DEPRECATED."
42
43
44
45
    (find-preferred-file
     (mapcar #'(lambda (dir) (subpathname (ensure-directory-pathname dir) x)) dirs)
     :direction direction))
  (defun in-user-configuration-directory (x &key (direction :input))
Robert Goldman's avatar
Robert Goldman committed
46
47
    "Return the file named X in the user configuration directory for common-lisp.
DEPRECATED."
48
    (xdg-config-pathname `("common-lisp" ,x) direction))
49
  (defun in-system-configuration-directory (x &key (direction :input))
Robert Goldman's avatar
Robert Goldman committed
50
51
    "Return the pathname for the file named X under the system configuration directory
for common-lisp. DEPRECATED."
52
    (find-preferred-file (system-config-pathnames "common-lisp" x) :direction direction)))