-
Notifications
You must be signed in to change notification settings - Fork 251
yacc(1) is a dead language; bury it deep in the ground #1217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4586d99
to
622a851
Compare
Nice. However this seems to introduce some warnings:
|
b3e2f59
to
63a80ec
Compare
Thanks! I fixed those. I might have introduced more, though. :) |
0002748
to
c42cb74
Compare
c6e19a1
to
3b362ac
Compare
749273c
to
1586985
Compare
d6146f0
to
b165e9e
Compare
I guess in configure.ac you can drop AC_PROG_YACC et al? |
On Tue, Feb 18, 2025 at 08:43:06PM -0800, Chris Hofstaedtler wrote:
zeha left a comment (shadow-maint/shadow#1217)
I *guess* in configure.ac you can drop AC_PROG_YACC et al?
Thanks! I was grepping for lower-case yacc and didn't find that.
Cheers,
Alex
…
|
7bcbf10
to
f691412
Compare
Wow! 1k down. :) Interested parties, please test and complain if there's anything that affects you negatively. ;) Observers, feel free to suggest further simplification, if it's possible. I think I got rid of everything I could. Cc: @leegarrett |
f691412
to
33d97af
Compare
get_date() doesn't treat "" as a date anymore, so the comment is obsolete. We still need the code, though, as for example usermod(8) uses an empty string as a synonym for -1. Link: <shadow-maint#1217 (comment)> Reported-by: Chris Hofstaedtler <zeha@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
I don't like how this series progresses (for instance, patch 2 seems like it should just be squashed with 1, and patch 4 changes the first get_date argument name without changing its users, so that it cannot compile until get_date gets removed, and then re-added with different code later.) But the end result seems ok. |
About patch 2, it is on purpose, and I've documented why here: About patch 4: You're right; I didn't realize. That's something I should fix. BTW, it's patch 3, I think. |
get_date() doesn't treat "" as a date anymore, so the comment is obsolete. We still need the code, though, as for example usermod(8) uses an empty string as a synonym for -1. Link: <shadow-maint#1217 (comment)> Reported-by: Chris Hofstaedtler <zeha@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
I assumed it was something like that, but unfortunately it doesnt' show up when you do a wget https://github.com/shadow-maint/shadow/pull/1217.patch :) |
Well, once you resolve the conflicts, happy to merge. Not worth over-thinking I suppose. |
Thanks! I'll wait for Monday, since I want @ikerexxe to merge his tests first. I'll rebase everything anyway, so that you can merge other PRs if you want. |
get_date() doesn't treat "" as a date anymore, so the comment is obsolete. We still need the code, though, as for example usermod(8) uses an empty string as a synonym for -1. Link: <shadow-maint#1217 (comment)> Reported-by: Chris Hofstaedtler <zeha@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
get_date() doesn't treat "" as a date anymore, so the comment is obsolete. We still need the code, though, as for example usermod(8) uses an empty string as a synonym for -1. Link: <shadow-maint#1217 (comment)> Reported-by: Chris Hofstaedtler <zeha@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
263b1fe
to
0d42670
Compare
get_date() doesn't treat "" as a date anymore, so the comment is obsolete. We still need the code, though, as for example usermod(8) uses an empty string as a synonym for -1. Link: <shadow-maint#1217 (comment)> Reported-by: Chris Hofstaedtler <zeha@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This removes all yacc(1) code from this project. Add copyright and license, since there remains nothing of the original code. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
And rename the remaining parameter. Signed-off-by: Alejandro Colomar <alx@kernel.org>
The following trick: t = 0; gmtime_r(&t, &tm); is a clever way to clear the tm(3type) structure, and set it to use UTC. We need to set it to set UTC with this trick, because strptime(3) doesn't set the timezone. I (Alex) tried previously using bzero(&tm, sizeof(tm)); strptime("UTC", "%Z", &tm); but glibc ignores the timezone, and musl (at least I tried in an Alpine container) seems to report an error. The idea to use gmtime_r(3) was from lanodan. Link: <https://inbox.sourceware.org/libc-alpha/Z_LqUgildoq33vI-@cloudsdale.the-delta.net.eu.org/T/#u> Cc: Iker Pedrosa <ipedrosa@redhat.com> Cc: Serge Hallyn <serge@hallyn.com> Cc: Rich Felker <dalias@libc.org> Co-authored-by: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me> Signed-off-by: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me> Signed-off-by: Alejandro Colomar <alx@kernel.org>
If it fails, let's fall back to get_date(). Signed-off-by: Alejandro Colomar <alx@kernel.org>
get_date() doesn't treat "" as a date anymore, so the comment is obsolete. We still need the code, though, as for example usermod(8) uses an empty string as a synonym for -1. Link: <shadow-maint#1217 (comment)> Reported-by: Chris Hofstaedtler <zeha@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Let's merge this one first, and then rebase and merge #1233
get_date() doesn't treat "" as a date anymore, so the comment is obsolete. We still need the code, though, as for example usermod(8) uses an empty string as a synonym for -1. Link: <#1217 (comment)> Reported-by: Chris Hofstaedtler <zeha@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
get_date() doesn't treat "" as a date anymore, so the comment is obsolete. We still need the code, though, as for example usermod(8) uses an empty string as a synonym for -1. Link: <shadow-maint#1217 (comment)> Reported-by: Chris Hofstaedtler <zeha@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cc: @zeha, @timparenti
This applies further removal of code in get_date(). I'll queue this patch for after the bugfix from #1214 .
This won't be cherry-picked for a stable release, as it's not supposed to fix a reported bug. It just makes get_date() simpler.
Revisions:
v2
""
as a synonym for-1
. [@zeha]v2b
v2c
Range diff:
Interdiff:
v2d
Range diff:
Interdiff:
v2e
v2f
v2g
v2h
v3
v4
v4b
v5
"%Y-%m-%d"
instead of"%F"
with strptime(3). It seems"%F"
is portable only with strftime(3), but not strptime(3).v5b
v5c
v5d
v5e
v6
v6b
v6c
v6d
v6e
v6f
v6g