All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Cocci] Exit with non-zero status
@ 2020-04-29 18:40 Markus Elfring
  2020-04-29 19:07 ` Paul Chaignon
  0 siblings, 1 reply; 11+ messages in thread
From: Markus Elfring @ 2020-04-29 18:40 UTC (permalink / raw)
  To: Paul Chaignon; +Cc: cocci

> I am trying to exit spatch with a non-zero exit status when required
> changes have been found.

I got used to the interpretation that a zero exit status
should indicate a successful execution of the program.


>   @finalize:python@
>   @@
>   exit(cnt)
>
> where cnt is incremented by another Python rule everytime a required
> change is found.

I suggest to handle the desired search result counter
by an other data processing interface.
How would you like to treat program execution failures otherwise?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [Cocci] Exit with non-zero status
@ 2020-04-29 14:39 Paul Chaignon
  2020-04-29 15:07 ` Julia Lawall
  0 siblings, 1 reply; 11+ messages in thread
From: Paul Chaignon @ 2020-04-29 14:39 UTC (permalink / raw)
  To: cocci

Hi everyone,

I am trying to exit spatch with a non-zero exit status when required
changes have been found. I have tried to add a rule with finalize:python
and the following code:

  @finalize:python@
  @@
  exit(cnt)

where cnt is incremented by another Python rule everytime a required
change is found. This works as expected except for the --in-place option
which becomes ineffective.

Is this a bug, or is finalize:python not intended to be used in that
manner? Is it possible to overwrite spatch's exit status?

Thanks,
Paul
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-05-06 12:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 18:40 [Cocci] Exit with non-zero status Markus Elfring
2020-04-29 19:07 ` Paul Chaignon
2020-04-29 19:50   ` Markus Elfring
2020-05-05  9:59     ` Paul Chaignon
2020-05-05 11:08       ` Markus Elfring
2020-05-06 12:01         ` Paul Chaignon
2020-05-06 12:24           ` Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-04-29 14:39 Paul Chaignon
2020-04-29 15:07 ` Julia Lawall
2020-04-29 15:16   ` Paul Chaignon
2020-04-29 15:25     ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.