summaryrefslogtreecommitdiff
path: root/guix/deprecation.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/deprecation.scm')
-rw-r--r--guix/deprecation.scm24
1 files changed, 22 insertions, 2 deletions
diff --git a/guix/deprecation.scm b/guix/deprecation.scm
index 453aad7106..2f7c058940 100644
--- a/guix/deprecation.scm
+++ b/guix/deprecation.scm
@@ -20,7 +20,7 @@
#:use-module (guix i18n)
#:use-module (ice-9 format)
#:export (define-deprecated
- without-deprecation-warnings
+ define-deprecated/alias
deprecation-warning-port))
;;; Commentary:
@@ -33,7 +33,7 @@
(define deprecation-warning-port
;; Port where deprecation warnings go.
- (make-parameter (current-warning-port)))
+ (make-parameter (current-error-port)))
(define (source-properties->location-string properties)
"Return a human-friendly, GNU-standard representation of PROPERTIES, a
@@ -87,3 +87,23 @@ This will write a deprecation warning to DEPRECATION-WARNING-PORT."
(id
(identifier? #'id)
#'real))))))))))
+
+(define-syntax-rule (define-deprecated/alias deprecated replacement)
+ "Define as an alias a deprecated variable, procedure, or macro, along
+these lines:
+
+ (define-deprecated/alias nix-server? store-connection?)
+
+where 'nix-server?' is the deprecated name for 'store-connection?'.
+
+This will write a deprecation warning to DEPRECATION-WARNING-PORT."
+ (define-syntax deprecated
+ (lambda (s)
+ (warn-about-deprecation 'deprecated (syntax-source s)
+ #:replacement 'replacement)
+ (syntax-case s ()
+ ((_ args (... ...))
+ #'(replacement args (... ...)))
+ (id
+ (identifier? #'id)
+ #'replacement)))))