From: chris.larson@siemens.com
To: isar-users@googlegroups.com
Cc: Christopher Larson <chris.larson@siemens.com>
Subject: [PATCH 6/9] isar-sstate: fix failures if a variable is set to just whitespace
Date: Fri, 5 Apr 2024 16:31:32 +0000 [thread overview]
Message-ID: <20240405163135.2987489-7-chris.larson@siemens.com> (raw)
In-Reply-To: <20240405163135.2987489-1-chris.larson@siemens.com>
From: Christopher Larson <chris.larson@siemens.com>
We see this failure if a variable is set to the empty string, as whitespace is
being stripped off of the variable after we check if the value is empty or None,
not before.
Traceback (most recent call last):
File "/home/kergoth/Code/indos/signatures/isar/scripts/isar-sstate", line 941, in <module>
sys.exit(main())
^^^^^^
File "/home/kergoth/Code/indos/signatures/isar/scripts/isar-sstate", line 937, in main
return globals()[f'sstate_{args.command}'](**vars(args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kergoth/Code/indos/signatures/isar/scripts/isar-sstate", line 894, in sstate_lint
if not val[0] == '/':
~~~^^^
IndexError: string index out of range
Signed-off-by: Christopher Larson <chris.larson@siemens.com>
---
scripts/isar-sstate | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/isar-sstate b/scripts/isar-sstate
index a4429b7a..4ea38bc8 100755
--- a/scripts/isar-sstate
+++ b/scripts/isar-sstate
@@ -868,10 +868,11 @@ def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, pedantic, li
sigdata['taskhash_ignore_tasks'] and name in sigdata['taskhash_ignore_tasks'] or \
name in ADDITIONAL_IGNORED_VARNAMES:
continue
- if not val:
- continue
# remove leading whitespaces possibly added by appending
val = val.lstrip()
+ if not val:
+ continue
+
if name == 'SRC_URI':
src_uri = val.split()
for entry in src_uri:
--
2.39.2
next prev parent reply other threads:[~2024-04-05 16:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 16:31 [PATCHv2 0/9] Add more signature cachability tests to the testsuite chris.larson
2024-04-05 16:31 ` [PATCH 1/9] isar-bootstrap: avoid forced early expansion of key vars chris.larson
2024-04-05 16:33 ` Larson, Chris
2024-04-05 16:31 ` [PATCH 2/9] isar-ci-ssh-setup: avoid abs path in signatures chris.larson
2024-04-05 16:31 ` [PATCH 3/9] isar-sstate: lint: check for absolute paths in SRC_URI chris.larson
2024-04-05 16:31 ` [PATCH 4/9] isar-sstate: lint: add support for checking stamps chris.larson
2024-04-05 16:31 ` [PATCH 5/9] isar-sstate: add --excluded-tasks argument chris.larson
2024-04-05 16:31 ` chris.larson [this message]
2024-04-05 16:31 ` [PATCH 7/9] cibuilder.py: add -S support to the bitbake method chris.larson
2024-04-05 16:31 ` [PATCH 8/9] testsuite: add perform_signature_lint method chris.larson
2024-04-05 16:31 ` [PATCH 9/9] testsuite: add signature cachability checks chris.larson
2024-04-11 16:10 ` [PATCHv2 0/9] Add more signature cachability tests to the testsuite Larson, Chris
2024-04-14 12:39 ` MOESSBAUER, Felix
2024-04-15 9:27 ` Uladzimir Bely
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=20240405163135.2987489-7-chris.larson@siemens.com \
--to=chris.larson@siemens.com \
--cc=isar-users@googlegroups.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