[RFC] dim: add a simple facility to require minimum dim version
Jani Nikula
jani.nikula at intel.com
Mon Oct 26 19:04:05 UTC 2020
On Mon, 26 Oct 2020, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Mon, Oct 26, 2020 at 2:44 PM Jani Nikula <jani.nikula at 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.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.
>
> Ah yes, this should come handy when moving to gitlab too from the old
> fd.o git servers.
>
> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
Thanks, pushed.
BR,
Jani.
>
>
>> ---
>> 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
>>
--
Jani Nikula, Intel Open Source Graphics Center
More information about the dim-tools
mailing list