Fixes #2054. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2060
-- Commit Summary --
* build system: Don't use `seq` that is not available on OpenBSD
-- File Changes --
M m4/geany-status.m4 (2)
-- Patch Links --
https://github.com/geany/geany/pull/2060.patch https://github.com/geany/geany/pull/2060.diff
If this works, I prefer it over #2058 that changes output, although IMO this version is simple enough.
Does it work on windows?
@elextr well, I don't see a reason why it wouldn't work anywhere that has a POSIX shell. Windows doesn't by default, but I don't see why it wouldn't with MSYS2 or something. What I suggest here also works with Dash (at least the very line I change), so it should be pretty safe.
@b4n, maybe, but since `echo` is built-in whats wrong with being safe :)
Didn't test yet but I'm pretty sure this will work in MSYS2 as well.
But more than that, I would agree with @elextr that the plain `echo` solution in #2055 is very safe. The drawback is just that the number of dashes is constant and so might be a little less eye-candy compared to the dynamic version. Therefore it needs just an `echo` :).
Looking at this: https://stackoverflow.com/questions/5349718/how-can-i-repeat-a-character-in-... Another simpler candidate is: `printf '%*s' 100 | tr ' ' '-'` There is a pipe, ok, but still much fewer calls to external commands. :) printf is already used all around, and tr seems available on OpenBSD. Runs even in (t)csh! (this is of no use since the rest of the script won't)
Looking at this: https://stackoverflow.com/questions/5349718/how-can-i-repeat-a-character-in-... Another simpler candidate is: `printf '%*s' $total | tr ' ' '-'` There is a pipe, ok, but still much fewer calls to external commands. :) printf is already used all around, and tr seems available on OpenBSD. Runs even in (t)csh! (this is of no use since the rest of the script won't)
Let me throw in a solution as well. Since I also prefer a simple echo over loops with lots of forks:
`echo ----------------------------------------------------------------------------------------------- | head -c $total`
I.e. print a very large number of dashes and limit dynamically using head.
@kugel- sorry, `-c` isn't a POSIX standard option for `head`.
C'mon guys, this is configuration, its got all that ugly spam from autofools around it, there is no objective benefit for variable lengthy lines. Lets just use `echo` so it _works_ and move on to something important.
If it were me, I'd just go with echo too, but maybe something like
``` echo '-----''-----''-----''-----''-----''-----''-----''-----''-----''-----' ```
Without using a loop, it's still easy then to see and change how many dashes are involved in this very complicated PR xD
I can't believe this is still not resolved.
github-comments@lists.geany.org