Control: clone -1 -2
Control: retitle -2 debian-security-support: Returns EXIT_SUCCESS without doing
any work when the DEBIAN_VERSION check fails (cloned from #951874)
Control: tags -1 +pending
Control: tags -2 -pending
Holger Levsen wrote on Sun, 23 Feb 2020 15:25 +0000:
> On Sat, Feb 22, 2020 at 03:38:15PM +0000, Daniel Shahaf wrote:
> > Following up on #951772, here are a few more bugfixes:
> > Subject: [PATCH 1/4] Clarify an error message
> > Subject: [PATCH 2/4] Fix --version output: used an undefined variable.
> > Subject: [PATCH 3/4] Print errors and warnings to stderr
> > In one case, fix the exit code.
> > Subject: [PATCH 4/4] Avoid implementation-defined behaviour
>
> all merged except that one case, fixing the error code.
>
Thanks!
> For that, I'm not sure if this is really a good idea, as it might make stuff
> fail
> if /etc/debian-version has been changed by a user or if in future sid will
> get become
> version 99 or whatever.
>
> If you think exiting with 1 is a good idea still, please open a new bug, so
> this change is properly tracked and documented. (Though I'm not sure I'll
> merge
> it then...)
I still think it's better to «exit 1» than to «exit 0». A unix program
should either do what it was supposed to do and exit 0, or otherwise
exit 1. Since in this case we exit without checking whether any
installed packages are out of support, the exit code shouldn't be
zero.
Even if a user has edited /etc/debian_version, I think it's better to
exit non-zero to make them aware of the problem, than to silently
disable the "check for not-security-supported packages" functionality
by exiting zero. (The message on stderr might be ignored by the caller
unless the error code is non-zero.)
If sid becomes v99, then the version check in this package will be able
to be updated to accommodate that.
For self-containedness, the option discussed above is:
[[[
--- a/check-support-status.in
+++ b/check-support-status.in
@@ -24,7 +24,7 @@ if [ "$DEBIAN_VERSION" -lt "$DEB_LOWEST_VER_ID" ] || [
"$DEBIAN_VERSION" -gt "$D
>&2 printf "%s: " "$NAME"
>&2 eval_gettext "Unknown DEBIAN_VERSION \$DEBIAN_VERSION. Valid values
are from \$DEB_LOWEST_VER_ID to \$DEB_NEXT_VER_ID, inclusive."
>&2 echo
- exit 0
+ exit 1
fi
LIST=
]]]
Alternatively, how about deleting the «exit 0» line entirely? That
would effectively downgrade the error message to a warning.
Cheers,
Daniel
P.S. Was I expected to include d/changelog hunks in the patch series?
Every package does this differently…