On Mon, Oct 26, 2020 at 2:44 PM Jani Nikula <jani.nik...@intel.com> wrote:
>
> 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.nik...@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.

Ah yes, this should come handy when moving to gitlab too from the old
fd.o git servers.

Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch>


> ---
>  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
>


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dim-tools mailing list
dim-tools@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dim-tools

Reply via email to