* [Buildroot] [PATCH 0/5] utils/get-developers: misc cleanups and improvements
@ 2024-12-20 13:31 yann.morin
0 siblings, 0 replies; 10+ messages in thread
From: yann.morin @ 2024-12-20 13:31 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN
From: "Yann E. MORIN" <yann.morin@orange.com>
Hello All!
This small series brings in a few trivial cleanups and improvements to
get-developers.
Regards,
Yann E. MORIN.
The following changes since commit a0ebdd5cd8318d03693ffa2bfd95b311847bbc1c
package/cloudflared: bump to version 2024.12.2 (2024-12-20 00:33:23 +0100)
are available as patches in this mail series,
for you to apply patches up to 64f9d09898aee7370ee86df702b207182e6d0cb5
utils/get-developers: add option to report Cc: lines (2024-12-20 14:28:35 +0100)
----------------------------------------------------------------
Yann E. MORIN (5):
utils/get-developers: don't offload parse_args()
utils/get-developers: use parser.error rather than canned print+return
utils/get-developers: read patch from stdin when it's not a tty
utils/get-developers: sort reported developers
utils/get-developers: add option to report Cc: lines
utils/get-developers | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
--
____________
.-----------------.--------------------: _ :------------------.
| Yann E. MORIN | Real-Time Embedded | __/ ) | /"\ ASCII RIBBON |
| | Software Designer | _/ - /' | \ / CAMPAIGN |
| +33 638.411.245 '--------------------: (_ `--, | X AGAINST |
| yann.morin (at) orange.com |_=" ,--' | / \ HTML MAIL |
'--------------------------------------:______/_____:------------------'
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/5] utils/get-developers: don't offload parse_args()
2024-12-23 7:27 [Buildroot] [PATCH 0/5] utils/get-developers: misc cleanups and improvements yann.morin
@ 2024-12-23 7:27 ` yann.morin
2025-01-05 13:21 ` Julien Olivain
2024-12-23 7:27 ` [Buildroot] [PATCH 2/5] utils/get-developers: use parser.error() rather than canned print+return yann.morin
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: yann.morin @ 2024-12-23 7:27 UTC (permalink / raw)
To: buildroot; +Cc: yann.morin
From: "Yann E. MORIN" <yann.morin@orange.com>
Offloading parser.parse_args() to a helper function does not bring much,
if at all; it even is restrictive: indeed, we can't use parser.error()
to report errors and thus have to resort to a canned print+return
sequence...
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
---
utils/get-developers | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/utils/get-developers b/utils/get-developers
index 9ab5c4503f..33980366d6 100755
--- a/utils/get-developers
+++ b/utils/get-developers
@@ -5,7 +5,7 @@ import getdeveloperlib
import sys
-def parse_args():
+def __main__():
parser = argparse.ArgumentParser()
parser.add_argument('patches', metavar='P', type=argparse.FileType('r'), nargs='*',
help='list of patches (use - to read patches from stdin)')
@@ -23,11 +23,7 @@ def parse_args():
const=True, help='validate syntax of DEVELOPERS file')
parser.add_argument('-d', dest='filename', action='store', default=None,
help='override the default DEVELOPERS file (for debug)')
- return parser.parse_args()
-
-
-def __main__():
- args = parse_args()
+ args = parser.parse_args()
# Check that only one action is given
action = 0
--
2.34.1
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 0/5] utils/get-developers: misc cleanups and improvements
@ 2024-12-23 7:27 yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 1/5] utils/get-developers: don't offload parse_args() yann.morin
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: yann.morin @ 2024-12-23 7:27 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain, Yann E . MORIN
From: "Yann E. MORIN" <yann.morin@orange.com>
Hello All!
This small series brings in a few trivial cleanups and improvements to
get-developers.
Changes v1 -> v2:
- fix test-suite (Julien)
- enhance help text for new option (Julien)
- fix typoes
Regards,
Yann E. MORIN.
The following changes since commit 621ebccf3f1ca70443160103ae12ab3ea89f63bd
package/python-autocommand: add patch to fix build issue (2024-12-22 17:55:22 +0100)
are available as patches in this mail series,
for you to apply patches up to af1aba057da1bd3bb056f7e6886641149bf22592
utils/get-developers: add option to report Cc: lines (2024-12-23 08:24:24 +0100)
----------------------------------------------------------------
Yann E. MORIN (5):
utils/get-developers: don't offload parse_args()
utils/get-developers: use parser.error() rather than canned print+return
utils/get-developers: read patch from stdin when it's not a tty
utils/get-developers: sort reported developers
utils/get-developers: add option to report Cc: lines
support/testing/tests/utils/test_get_developers.py | 12 +++++------
utils/get-developers | 23 +++++++++++-----------
2 files changed, 17 insertions(+), 18 deletions(-)
--
____________
.-----------------.--------------------: _ :------------------.
| Yann E. MORIN | Real-Time Embedded | __/ ) | /"\ ASCII RIBBON |
| | Software Designer | _/ - /' | \ / CAMPAIGN |
| +33 638.411.245 '--------------------: (_ `--, | X AGAINST |
| yann.morin (at) orange.com |_=" ,--' | / \ HTML MAIL |
'--------------------------------------:______/_____:------------------'
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 2/5] utils/get-developers: use parser.error() rather than canned print+return
2024-12-23 7:27 [Buildroot] [PATCH 0/5] utils/get-developers: misc cleanups and improvements yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 1/5] utils/get-developers: don't offload parse_args() yann.morin
@ 2024-12-23 7:27 ` yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 3/5] utils/get-developers: read patch from stdin when it's not a tty yann.morin
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: yann.morin @ 2024-12-23 7:27 UTC (permalink / raw)
To: buildroot; +Cc: yann.morin, Julien Olivain
From: "Yann E. MORIN" <yann.morin@orange.com>
parser.error() reports a nice error message, that also displays a short
reminder of the available options.
Adapt the test-suite accordingly: previously, the error string was an
exact string in the stdout list, while it now is a substring in one of
the strings in stderr. The exit code changes, too.
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Julien Olivain <ju.o@free.fr>
---
Changes v1 -> v2:
- fix test-suite (Julien)
---
support/testing/tests/utils/test_get_developers.py | 12 ++++++------
utils/get-developers | 6 ++----
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/support/testing/tests/utils/test_get_developers.py b/support/testing/tests/utils/test_get_developers.py
index ffc01f6ce7..3ec4edeadd 100644
--- a/support/testing/tests/utils/test_get_developers.py
+++ b/support/testing/tests/utils/test_get_developers.py
@@ -41,9 +41,9 @@ class TestGetDevelopers(unittest.TestCase):
# no args, with syntax error in the file
developers = b'text3\n'
out, err, rc = call_get_developers("./utils/get-developers", [], self.WITH_EMPTY_PATH, topdir, developers)
- self.assertIn("No action specified", out)
- self.assertEqual(rc, 0)
- self.assertEqual(len(err), 0)
+ self.assertIn("No action specified", "\n".join(err))
+ self.assertEqual(rc, 2)
+ self.assertEqual(len(out), 0)
# -v generating error, called from the main dir
developers = b'text1\n'
@@ -150,9 +150,9 @@ class TestGetDevelopers(unittest.TestCase):
# no args, with syntax error in the file
developers = b'text3\n'
out, err, rc = call_get_developers("./utils/get-developers", [], self.WITH_EMPTY_PATH, topdir, developers)
- self.assertIn("No action specified", out)
- self.assertEqual(rc, 0)
- self.assertEqual(len(err), 0)
+ self.assertIn("No action specified", "\n".join(err))
+ self.assertEqual(rc, 2)
+ self.assertEqual(len(out), 0)
# patchfile from topdir and from elsewhere
abs_path = infra.filepath("tests/utils/test_get_developers/")
diff --git a/utils/get-developers b/utils/get-developers
index 33980366d6..8e5796beaf 100755
--- a/utils/get-developers
+++ b/utils/get-developers
@@ -40,11 +40,9 @@ def __main__():
if len(args.patches) != 0:
action += 1
if action > 1:
- print("Cannot do more than one action")
- return
+ parser.error("Cannot do more than one action")
if action == 0:
- print("No action specified")
- return
+ parser.error("No action specified")
devs = getdeveloperlib.parse_developers(args.filename)
if devs is None:
--
2.34.1
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 3/5] utils/get-developers: read patch from stdin when it's not a tty
2024-12-23 7:27 [Buildroot] [PATCH 0/5] utils/get-developers: misc cleanups and improvements yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 1/5] utils/get-developers: don't offload parse_args() yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 2/5] utils/get-developers: use parser.error() rather than canned print+return yann.morin
@ 2024-12-23 7:27 ` yann.morin
2025-01-18 21:00 ` Julien Olivain
2024-12-23 7:27 ` [Buildroot] [PATCH 4/5] utils/get-developers: sort reported developers yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 5/5] utils/get-developers: add option to report Cc: lines yann.morin
4 siblings, 1 reply; 10+ messages in thread
From: yann.morin @ 2024-12-23 7:27 UTC (permalink / raw)
To: buildroot; +Cc: yann.morin
From: "Yann E. MORIN" <yann.morin@orange.com>
It is very common that get-developers be used with its stdin a pipe from
git-show:
git show |./utils-get-developers -
In this case, the '-' is superfluous: we can very easily deduce that the
user wants to read stdin as the patch.
So, if no other action was requested, and stdin is not a tty, use it as
the source of the patch, and thus '-' is then no longer required.
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
---
Changes v2 -> v2:
- fix typoes in commit log
---
utils/get-developers | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/utils/get-developers b/utils/get-developers
index 8e5796beaf..b45e617bff 100755
--- a/utils/get-developers
+++ b/utils/get-developers
@@ -42,7 +42,9 @@ def __main__():
if action > 1:
parser.error("Cannot do more than one action")
if action == 0:
- parser.error("No action specified")
+ if sys.stdin.isatty():
+ parser.error("No action specified")
+ args.patches.append(sys.stdin)
devs = getdeveloperlib.parse_developers(args.filename)
if devs is None:
--
2.34.1
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 4/5] utils/get-developers: sort reported developers
2024-12-23 7:27 [Buildroot] [PATCH 0/5] utils/get-developers: misc cleanups and improvements yann.morin
` (2 preceding siblings ...)
2024-12-23 7:27 ` [Buildroot] [PATCH 3/5] utils/get-developers: read patch from stdin when it's not a tty yann.morin
@ 2024-12-23 7:27 ` yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 5/5] utils/get-developers: add option to report Cc: lines yann.morin
4 siblings, 0 replies; 10+ messages in thread
From: yann.morin @ 2024-12-23 7:27 UTC (permalink / raw)
To: buildroot; +Cc: yann.morin
From: "Yann E. MORIN" <yann.morin@orange.com>
The list of reported developers is not ordered: that may leave the
impression (when receiving a patch) that a Cc is more important than
another, by virtue of being earlier in the list.
Also, the ordering changes on every call.
Report the developers in an alphabetically order, so that there is no
confusion anymore, and so the ordering is reproducible across calls.
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
---
utils/get-developers | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils/get-developers b/utils/get-developers
index b45e617bff..3253ce5d6b 100755
--- a/utils/get-developers
+++ b/utils/get-developers
@@ -98,6 +98,7 @@ def __main__():
if i in dev.infras:
matching_devs.add(dev.name)
+ matching_devs = sorted(matching_devs)
if args.email:
for dev in matching_devs:
print(dev)
--
2.34.1
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 5/5] utils/get-developers: add option to report Cc: lines
2024-12-23 7:27 [Buildroot] [PATCH 0/5] utils/get-developers: misc cleanups and improvements yann.morin
` (3 preceding siblings ...)
2024-12-23 7:27 ` [Buildroot] [PATCH 4/5] utils/get-developers: sort reported developers yann.morin
@ 2024-12-23 7:27 ` yann.morin
4 siblings, 0 replies; 10+ messages in thread
From: yann.morin @ 2024-12-23 7:27 UTC (permalink / raw)
To: buildroot; +Cc: yann.morin, Julien Olivain
From: "Yann E. MORIN" <yann.morin@orange.com>
It is very common to use the output of get-developers to add cc: lines
in the commit log.
Add an option so that get-developers reports Cc: lines ready to be
pasted in a commit log. That new option behaves similarly to the
existing -e option: it only affects the output when parsing a patch.
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Julien Olivain <ju.o@free.fr>
---
Changes v1 -> v2:
- model the help text after the one of the -e option, below (Julien)
- extend commit log to explain that.
---
utils/get-developers | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/utils/get-developers b/utils/get-developers
index 3253ce5d6b..83c573bf23 100755
--- a/utils/get-developers
+++ b/utils/get-developers
@@ -17,6 +17,8 @@ def __main__():
help='find developers in charge of these files')
parser.add_argument('-c', dest='check', action='store_const',
const=True, help='list files not handled by any developer')
+ parser.add_argument('--cc', action="store_true",
+ help='list affected developers as CC: lines ready to be pasted in a commit log')
parser.add_argument('-e', dest='email', action='store_const',
const=True, help='only list affected developer email addresses')
parser.add_argument('-v', dest='validate', action='store_const',
@@ -99,9 +101,9 @@ def __main__():
matching_devs.add(dev.name)
matching_devs = sorted(matching_devs)
- if args.email:
+ if args.email or args.cc:
for dev in matching_devs:
- print(dev)
+ print(f"{'Cc: ' if args.cc else ''}{dev}")
else:
result = "--to buildroot@buildroot.org"
for dev in matching_devs:
--
2.34.1
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH 1/5] utils/get-developers: don't offload parse_args()
2024-12-23 7:27 ` [Buildroot] [PATCH 1/5] utils/get-developers: don't offload parse_args() yann.morin
@ 2025-01-05 13:21 ` Julien Olivain
2025-01-09 8:53 ` Peter Korsgaard
0 siblings, 1 reply; 10+ messages in thread
From: Julien Olivain @ 2025-01-05 13:21 UTC (permalink / raw)
To: yann.morin; +Cc: buildroot
On 23/12/2024 08:27, yann.morin@orange.com wrote:
> From: "Yann E. MORIN" <yann.morin@orange.com>
>
> Offloading parser.parse_args() to a helper function does not bring
> much,
> if at all; it even is restrictive: indeed, we can't use parser.error()
> to report errors and thus have to resort to a canned print+return
> sequence...
>
> Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Series applied to master, thanks.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH 1/5] utils/get-developers: don't offload parse_args()
2025-01-05 13:21 ` Julien Olivain
@ 2025-01-09 8:53 ` Peter Korsgaard
0 siblings, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2025-01-09 8:53 UTC (permalink / raw)
To: Julien Olivain, yann.morin; +Cc: buildroot
On 1/5/25 14:21, Julien Olivain wrote:
> On 23/12/2024 08:27, yann.morin@orange.com wrote:
>> From: "Yann E. MORIN" <yann.morin@orange.com>
>>
>> Offloading parser.parse_args() to a helper function does not bring much,
>> if at all; it even is restrictive: indeed, we can't use parser.error()
>> to report errors and thus have to resort to a canned print+return
>> sequence...
>>
>> Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
>
> Series applied to master, thanks.
And 2024.02.x / 2024.11.x as well, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH 3/5] utils/get-developers: read patch from stdin when it's not a tty
2024-12-23 7:27 ` [Buildroot] [PATCH 3/5] utils/get-developers: read patch from stdin when it's not a tty yann.morin
@ 2025-01-18 21:00 ` Julien Olivain
0 siblings, 0 replies; 10+ messages in thread
From: Julien Olivain @ 2025-01-18 21:00 UTC (permalink / raw)
To: yann.morin; +Cc: buildroot
Hi Yann,
On 23/12/2024 08:27, yann.morin@orange.com wrote:
> From: "Yann E. MORIN" <yann.morin@orange.com>
>
> It is very common that get-developers be used with its stdin a pipe
> from
> git-show:
> git show |./utils-get-developers -
>
> In this case, the '-' is superfluous: we can very easily deduce that
> the
> user wants to read stdin as the patch.
>
> So, if no other action was requested, and stdin is not a tty, use it as
> the source of the patch, and thus '-' is then no longer required.
>
> Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
>
> ---
> Changes v2 -> v2:
> - fix typoes in commit log
> ---
> utils/get-developers | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/utils/get-developers b/utils/get-developers
> index 8e5796beaf..b45e617bff 100755
> --- a/utils/get-developers
> +++ b/utils/get-developers
> @@ -42,7 +42,9 @@ def __main__():
> if action > 1:
> parser.error("Cannot do more than one action")
> if action == 0:
> - parser.error("No action specified")
> + if sys.stdin.isatty():
> + parser.error("No action specified")
> + args.patches.append(sys.stdin)
This patch introduces runtime test failures. See for example:
https://gitlab.com/buildroot.org/buildroot/-/jobs/8830671800
When running the test on a tty, the test succeed. For example:
support/testing/run-tests \
-d dl -o output_folder \
tests.utils.test_get_developers
...
OK
But when running the test _without_ a tty, the test fails.
This is the case in the Gitlab CI.
For example:
support/testing/run-tests \
-d dl -o output_folder \
tests.utils.test_get_developers < /dev/null
...
FAILED (failures=1)
Maybe the runtime test needs to adjust depending stdin is a tty
or not.
Could you have a look please?
>
> devs = getdeveloperlib.parse_developers(args.filename)
> if devs is None:
> --
> 2.34.1
Best regards,
Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-01-18 21:00 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-23 7:27 [Buildroot] [PATCH 0/5] utils/get-developers: misc cleanups and improvements yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 1/5] utils/get-developers: don't offload parse_args() yann.morin
2025-01-05 13:21 ` Julien Olivain
2025-01-09 8:53 ` Peter Korsgaard
2024-12-23 7:27 ` [Buildroot] [PATCH 2/5] utils/get-developers: use parser.error() rather than canned print+return yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 3/5] utils/get-developers: read patch from stdin when it's not a tty yann.morin
2025-01-18 21:00 ` Julien Olivain
2024-12-23 7:27 ` [Buildroot] [PATCH 4/5] utils/get-developers: sort reported developers yann.morin
2024-12-23 7:27 ` [Buildroot] [PATCH 5/5] utils/get-developers: add option to report Cc: lines yann.morin
-- strict thread matches above, loose matches on Subject: below --
2024-12-20 13:31 [Buildroot] [PATCH 0/5] utils/get-developers: misc cleanups and improvements yann.morin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox