Open mavit opened 1 month ago
@mavit would cut
be available by default? I'm surprised awk
isn't. I thought that was one of those tools which would "always" be installed.
@JohanSaaw I see you added those lines using awk
. But I think some of them could be changed to use cut
or grep
instead. If they were available by default, would you mind changing the code lines?
Hi @michaelherger , @mavit
I'll check the code in the RPM scripts. I see this is for v 8. 5.2, so I aasume I would need to make the fix for 8.5.2, 8.5.3 and 9.0.0, or?
Would it be an acceptable solution to add awk as a pre-req in the RPM package?
On SUSE and RedHat variants cut is a part of the RPM package coreutils. That package will always be installed (I can't imagine an installation without it at least).
Regards, Johan
would
cut
be available by default?
It's present even in the Red Hat UBI micro container image, so I think the answer is currently yes. I'd probably Requires: /usr/bin/cut
anyway, just in case.
But Perl seems like an obvious choice for these kinds of one-liners, here.
@michaelherger ,
I had a closer look. I can fix this, As @mavit says, I also think it is best to do it with some in-line PERL code in the shell scripts.
There is one occurrence of awk that has been in the code for ages and that is the line:
PORT=awk '/^httpport/ {print $2}' %{_var}/lib/%{shortname}/prefs/server.prefs
I updated the line with "%{shortname}", that is probably why it looks like I added the awk. If you check the RPM spec file for v 8.5.2 you will see that it is there.
I added the other four occurrences when I amended the RPM spec file to re-brand all components to lyrionmusicserver.
I will start fixing the v 9.0.0 and then I can also submit a fix for v 8.5.3.
Is that OK?
Regards, Johan
Go for it! I'm thankful for any contribution!
@michaelherger ,
Just to let you know.
My son is visiting, so I can't spend the time I would like on this. So I'll probably only be able to create a pull request for this at the coming week-end (24-25/08).
Regards, Johan
My son is visiting, so I can't spend the time I would like on this. So I'll probably only be able to create a pull request for this at the coming week-end (24-25/08).
No problem! It's not broken, is it? Just an improvement. Enjoy your time with your son.
I tried installing the RPM in a SLES container, and found that
awk
was missing:It probably makes sense to replace use of
awk
withperl
, but ensuringawk
is installed is a quick fix for now.