Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add umpf-flags support to control the EXTRAVERSION patching #29

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

bith3ad
Copy link

@bith3ad bith3ad commented Nov 7, 2023

Add support to specify umpf-flags which influence the umpf build behaviour. The flags are tracked within the umpf tag via the new 'umpf-flags' section. Users can flags directly via the useries or by specfiy them via the command line option '--flags'.

The EXTRAVERSION patch conflicts if a stable update is done without using umpf, e.g. if multiple parties do stable updates for certain software package like Linux but only a few of them use umpf.

To avoid EXTRAVERSION conflicting each time a stable update is done we shift the EXTRAVERSION patching down into the middle of the Makefile by using the new umpf-flags mechanism:

# umpf-flags: extraversion=conflictfree

New flags can be added by extending the SUPPORTED_FLAGS list and adding the flag_ array, e.g.:

SUPPORTED_FLAGS=("extraversion" "foo")

...

flag_foo[val] = "baz"		# default value
flag_foo[values] = "baz bar"	# all possible values

To use the flag, you need to check the value, e.g.:

[ ${flag_foo[val]} == "baz" ] && echo "default value"

@michaelolbrich
Copy link
Member

This will fail with umpf continue. You need to store the flags somehow. Maybe similar to OVERRIDES:

  • Make FLAGS an associative array and fill it with the defaults (key is the flag name)
  • Store all possible values in the associative array FLAG_VALUES (or whatever) with the same keys
  • update FLAGS with the custom values
  • save FLAGS in bailout() just like OVERRIDES

Btw, ${!FLAGS[*]} would be the list of supported flags.

And take a look at the CI results shellcheck has some errors but that's code the will probably change anyways.

@bith3ad
Copy link
Author

bith3ad commented Nov 15, 2023

Thanks for your input. I fixed the corner case by saving the --flags parameter during bailout like you suggested. On the other hand to ensure that flags will be added to a provided git-umpf-tagI went the way relative did. I also fixed the missing init() and the variable an value assignment issue.

Add support to specify umpf-flags which influence the umpf build
behaviour. The flags are tracked within the umpf tag via the new
'umpf-flags' section. Users can flags directly via the useries or by
specfiy them via the command line option '--flags'.

The EXTRAVERSION patch conflicts if a stable update is done without
using umpf, e.g. if multiple parties do stable updates for certain
software package like Linux but only a few of them use umpf.

To avoid EXTRAVERSION conflicting each time a stable update is done we
shift the EXTRAVERSION patching down into the middle of the Makefile by
using the new umpf-flags mechanism:

	# umpf-flags: extraversion=conflictfree

New flags can be added by extending the SUPPORTED_FLAGS list and adding
the flag_<flag> array, e.g.:

	SUPPORTED_FLAGS=("extraversion" "foo")

	...

	flag_foo[val] = "baz"		# default value
	flag_foo[values] = "baz bar"	# all possible values

To use the flag, you need to check the value, e.g.:

	[ ${flag_foo[val]} == "baz" ] && echo "default value"

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Copy link
Member

@michaelolbrich michaelolbrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The state handling is getting quite complex and needs some kind of refactoring, but that's out of scope for this PR.

@michaelolbrich michaelolbrich merged commit 78ce139 into pengutronix:master Nov 15, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants