DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [PATCH 5/6] devtools: make uAPI check exclusive to other options
Date: Wed, 27 Aug 2025 10:21:48 +0200	[thread overview]
Message-ID: <20250827082413.1417226-6-thomas@monjalon.net> (raw)
In-Reply-To: <20250827082413.1417226-1-thomas@monjalon.net>

When doing a check of Linux uAPI headers,
it is better to not fix them before.
Also, it does not make sense to check just after doing an update,
as the check would just repeat the same update process.
That's why a check is now run alone without any update.

The current version has to be retrieved in all cases,
so it is moved at the beginning of any processing.

If the check option (-c) is used with an import (-i) or an upgrade (-u),
an error is raised.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/linux-uapi.sh | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/devtools/linux-uapi.sh b/devtools/linux-uapi.sh
index 654c4a8c25..0986b668de 100755
--- a/devtools/linux-uapi.sh
+++ b/devtools/linux-uapi.sh
@@ -10,7 +10,7 @@ base_url="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/pla
 base_path="kernel/linux/uapi/"
 version=""
 file=""
-check_headers=0
+check_headers=false
 
 print_usage()
 {
@@ -90,8 +90,6 @@ fixup_includes()
 
 update_all()
 {
-	local current_version=$(< $base_path/version)
-
 	if [ -n "$version" ]; then
 		if version_older_than "$version" "$current_version"; then
 			echo "Headers already up to date ($current_version >= $version)"
@@ -156,7 +154,7 @@ while getopts i:u:ch opt ; do
 	case $opt in
 		i ) file=$OPTARG ;;
 		u ) version=$OPTARG ;;
-		c ) check_headers=1 ;;
+		c ) check_headers=true ;;
 		h ) print_usage ; exit 0 ;;
 		? ) print_usage ; exit 1 ;;
 	esac
@@ -167,13 +165,17 @@ if [ $# -ne 0 ]; then
 	print_usage
 	exit 1
 fi
+if $check_headers && [ -n "$file" -o -n "$version" ]; then
+	echo "The option -c is incompatible with -i and -u"
+	exit 1
+fi
 
 cd $(dirname $0)/..
+current_version=$(cat $base_path/version)
 
-update_all
-
-if [ $check_headers -eq 0 ]; then
-	exit 0
+if $check_headers; then
+	version=$current_version
+	check_all
+else
+	update_all
 fi
-
-check_all
-- 
2.47.1


  parent reply	other threads:[~2025-08-27  8:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27  8:21 [PATCH 0/6] devtools: improve Linux uAPI script Thomas Monjalon
2025-08-27  8:21 ` [PATCH 1/6] devtools: remove superfluous curly braces in " Thomas Monjalon
2025-08-27  8:21 ` [PATCH 2/6] devtools: remove superfluous fallbacks " Thomas Monjalon
2025-08-27  8:21 ` [PATCH 3/6] devtools: move uAPI processing into functions Thomas Monjalon
2025-08-27  8:21 ` [PATCH 4/6] devtools: remove unused variables in uAPI script Thomas Monjalon
2025-08-27  8:21 ` Thomas Monjalon [this message]
2025-08-27  8:21 ` [PATCH 6/6] devtools: add quiet mode " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250827082413.1417226-6-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).