diff options
-rw-r--r-- | doc/properties.rst | 5 | ||||
-rw-r--r-- | src/core.lisp | 6 | ||||
-rw-r--r-- | src/package.lisp | 1 |
3 files changed, 10 insertions, 2 deletions
diff --git a/doc/properties.rst b/doc/properties.rst index 115ef76..9261127 100644 --- a/doc/properties.rst +++ b/doc/properties.rst @@ -15,8 +15,9 @@ to which this property is applied or is to be applied; and (ii) check that applying this property makes sense -- e.g. that we're not trying to install a package using apt(1) on a FreeBSD host. -Can retrieve existing static informational attributes using ``GET-HOSTATTRS``. -Should signal the condition ``INCOMPATIBLE-PROPERTY`` if existing static +Can retrieve existing static informational attributes using ``GET-HOSTATTRS``, +or things which wrap ``GET-HOSTATTRS``, such as ``GET-HOSTNAME``. Should +signal the condition ``INCOMPATIBLE-PROPERTY`` if existing static informational attributes indicate that the property should not be applied to this host. Can use ``PUSH-HOSTATTRS`` and ``REQUIRE-DATA`` to add new entries to the host's static information atributes. diff --git a/src/core.lisp b/src/core.lisp index 99b95dd..fd99788 100644 --- a/src/core.lisp +++ b/src/core.lisp @@ -321,6 +321,12 @@ is needed to deploy a property. Called by property :HOSTATTRS subroutines." (push-hostattrs :data (cons iden1 iden2))) +(defun get-hostname () + "Get the hostname of the host to which properties are being applied. + +Called by property subroutines." + (car (get-hostattrs :hostname))) + ;;;; Property application specifications diff --git a/src/package.lisp b/src/package.lisp index 3b889ef..2904ef2 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -77,6 +77,7 @@ #:defprop #:get-hostattrs #:push-hostattrs + #:get-hostname #:require-data #:defhost |