[RFC] dim: add a simple facility to require minimum dim version
Jani Nikula
jani.nikula at intel.com
Mon Oct 26 13:44:35 UTC 2020
Add simple single-digit dim version scheme, and add 'dim version'
subcommand to print it. Start off with version 0.
If $DIM_MIN_VERSION is set, bail out if the requirement is not met. The
idea is to set this in nightly.conf to be able to soft-enforce dim
updates before rolling out changes. (It's obviously possible to bypass
the requirement.)
We do have the dim uptodate nag, but it never bails out.
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
Background: We're planning on finally dropping drm-intel-next-queued
branch in favor of just using drm-intel-next directly. This will need
some flag day updates. First roll out a way to enforce new
dim... although the users need to first update to a dim version that has
the facility. But gotta start somewhere.
---
dim | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/dim b/dim
index 33e2400c32cc..8f2151365556 100755
--- a/dim
+++ b/dim
@@ -305,6 +305,11 @@ function branch_to_repo # branch
echo ""
}
+function dim_version
+{
+ echo "0"
+}
+
function dim_uptodate
{
local using
@@ -417,6 +422,14 @@ function check_git_version
fi
}
+function check_dim_version
+{
+ if [[ -n "$DIM_MIN_VERSION" ]] && [[ "$(dim_version)" < "$DIM_MIN_VERSION" ]]; then
+ echoerr "ERROR: required minimum dim version $DIM_MIN_VERSION, you have $(dim_version)"
+ exit 1
+ fi
+}
+
function check_dim_config
{
if [[ "$DIM_REPO" == "drm-tip" || "$DIM_REPO" == "drm-rerere" || "$DIM_REPO" == "maintainer-tools" ]]; then
@@ -2365,6 +2378,7 @@ function list_developer_commands
# help commands
"help"
"usage"
+ "version"
# include setup
"setup"
)
@@ -2622,6 +2636,7 @@ else
read_integration_config
check_for_updates
+ check_dim_version
check_git_version
fi
--
2.20.1
More information about the dim-tools
mailing list