diff mbox series

sstate-cache-management: check also SSTATE_DIR environment variable

Message ID 20260907-sstate-cache-management-sstate-dir-v1-1-ed1a8ad1be0d@bootlin.com
State Under Review
Headers show
Series sstate-cache-management: check also SSTATE_DIR environment variable | expand

Commit Message

Benjamin Robin Sept. 7, 2026, 3:27 p.m. UTC
Support KAS users by recognizing the SSTATE_DIR environment variable for
configuring the sstate cache directory, as documented in [1]. Yocto
respects this variable since KAS includes it in
BB_ENV_PASSTHROUGH_ADDITIONS.

This improves usability for the many users relying on KAS.

[1] https://kas.readthedocs.io/en/latest/userguide/env-vars.html#variables-glossary

Signed-off-by: Benjamin Robin <benjamin.robin@bootlin.com>
---
 scripts/sstate-cache-management.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)


---
base-commit: 47021aa89adb81c822e8ec37f17266197914f6b8
change-id: 20260907-sstate-cache-management-sstate-dir-1e2246d3f63a

Best regards,
--  
Benjamin Robin <benjamin.robin@bootlin.com>
diff mbox series

Patch

diff --git a/scripts/sstate-cache-management.py b/scripts/sstate-cache-management.py
index 303b8f13a349..f5737004c544 100755
--- a/scripts/sstate-cache-management.py
+++ b/scripts/sstate-cache-management.py
@@ -202,9 +202,10 @@  def parse_arguments():
 
     parser.add_argument(
         "--cache-dir",
-        default=os.environ.get("SSTATE_CACHE_DIR"),
-        help="""Specify sstate cache directory, will use the environment
-            variable SSTATE_CACHE_DIR if it is not specified.""",
+        default=os.environ.get("SSTATE_CACHE_DIR") or os.environ.get("SSTATE_DIR"),
+        help="""Specify the sstate cache directory. Defaults to the value of the
+            SSTATE_CACHE_DIR environment variable, or SSTATE_DIR if SSTATE_CACHE_DIR
+            is not set.""",
     )
 
     # parser.add_argument(