From: Vincent Fazio <vfazio@gmail.com>
To: linux-gpio@vger.kernel.org
Cc: brgl@kernel.org, Vincent Fazio <vfazio@gmail.com>
Subject: [libgpiod][PATCH v2 13/14] bindings: python: fix directory validation in artifact script
Date: Sat, 24 Oct 2026 15:00:47 -0500 [thread overview]
Message-ID: <20261024200048.25987-5-vfazio@gmail.com> (raw)
In-Reply-To: <20261024200048.25987-1-vfazio@gmail.com>
The PyPI artifact generation script had two issues with its directory
validation:
* When validating the source directory, it erroneously tested whether
output_dir was a directory instead of source_dir.
* When validating the output directory, it only tested for writability
(-w), which would allow an existing writable regular file to pass
validation and only fail later when copying build artifacts.
Fix the source_dir check to inspect source_dir, and ensure output_dir
is verified to be a directory in addition to being writable.
Fixes: 72d2fa01 ("bindings: python: add script to generate sdist and wheels")
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
---
bindings/python/generate_pypi_artifacts.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bindings/python/generate_pypi_artifacts.sh b/bindings/python/generate_pypi_artifacts.sh
index 22dad9f..bc8aa05 100755
--- a/bindings/python/generate_pypi_artifacts.sh
+++ b/bindings/python/generate_pypi_artifacts.sh
@@ -58,13 +58,13 @@ while getopts :hv:o:s:cf value; do
esac
done
-if [ -z "${source_dir}" ] || [ ! -d "${output_dir}" ]; then
+if [ -z "${source_dir}" ] || [ ! -d "${source_dir}" ]; then
printf "Invalid source directory %s.\n" "${source_dir}"
exit 1
fi
-if [ -z "${output_dir}" ] || [ ! -w "${output_dir}" ]; then
- printf "Output directory %s is not writable.\n" "${output_dir}"
+if [ -z "${output_dir}" ] || [ ! -d "${output_dir}" ] || [ ! -w "${output_dir}" ]; then
+ printf "Output directory %s is not writable directory.\n" "${output_dir}"
exit 1
fi
--
2.43.0
next prev parent reply other threads:[~2026-10-24 20:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 20:00 [libgpiod][PATCH v2 09/14] bindings: python: chip: use literals for dict/list and declare types Vincent Fazio
2026-10-24 20:00 ` [libgpiod][PATCH v2 10/14] bindings: python: bump ruff linter dependency Vincent Fazio
2026-10-24 20:00 ` [libgpiod][PATCH v2 11/14] bindings: python: include Python.h before other headers Vincent Fazio
2026-10-24 20:00 ` [libgpiod][PATCH v2 12/14] bindings: python: advertise Python 3.15 support Vincent Fazio
2026-10-24 20:00 ` Vincent Fazio [this message]
2026-10-24 20:00 ` [libgpiod][PATCH v2 14/14] bindings: python: bump dependencies in artifact script Vincent Fazio
2026-10-28 9:19 ` [libgpiod][PATCH v2 09/14] bindings: python: chip: use literals for dict/list and declare types Bartosz Golaszewski
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=20261024200048.25987-5-vfazio@gmail.com \
--to=vfazio@gmail.com \
--cc=brgl@kernel.org \
--cc=linux-gpio@vger.kernel.org \
/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