From 8af6a2678d00d222c670260b7d3ec7db6eac65b6 Mon Sep 17 00:00:00 2001 From: mudler Date: Sat, 14 May 2016 17:29:56 +0200 Subject: [PATCH] [entropy.client] adding support for wildcard in ACCEPT_LICENSE This allows to call equo with ACCEPT_LICENSE="*" and accept automatically all the licenses without user prompting --- client/solo/commands/_manage.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/solo/commands/_manage.py b/client/solo/commands/_manage.py index 4c64fbffc..aa61ca4eb 100644 --- a/client/solo/commands/_manage.py +++ b/client/solo/commands/_manage.py @@ -737,10 +737,14 @@ class SoloManage(SoloCommand): # that the user accepts their licenses licenses = entropy_client.get_licenses_to_accept( package_matches) + # ACCEPT_LICENSE env var support accept_license = os.getenv("ACCEPT_LICENSE", "").split() - for mylic in accept_license: - licenses.pop(mylic, None) + if "*" in accept_license: + licenses.clear() + else: + for mylic in accept_license: + licenses.pop(mylic, None) if licenses: entropy_client.output(