colored osc build output
Hi, is it possible to trick a local osc build into producing colored output without much fuzz? The point is, if I 'osc chroot' into the package and trigger a build manually, colored output is generated. Therefor I guess, rpmbuild ignores/avoids certain environment values (COLORTERM?) for better parsebility. For local builds of huge projects, colored output would be much nicer, since it would be easier to distinguish between warnings and errors. Cheers, Pete
On Friday 2020-12-04 15:17, Hans-Peter Jansen wrote:
The point is, if I 'osc chroot' into the package and trigger a build manually, colored output is generated. Therefor I guess, rpmbuild ignores/avoids certain environment values (COLORTERM?) for better parsebility.
Color decision is solely driven based on stdout being a tty (or not). In case of `osc build`, it is not a tty but a pipe to the outside world.
Hi, On 12/5/20 12:47 AM, Hans-Peter Jansen wrote:
Hi,
is it possible to trick a local osc build into producing colored output without much fuzz?
The point is, if I 'osc chroot' into the package and trigger a build manually, colored output is generated. Therefor I guess, rpmbuild ignores/avoids certain environment values (COLORTERM?) for better parsebility.
For local builds of huge projects, colored output would be much nicer, since it would be easier to distinguish between warnings and errors.
There is a tool "grc" that uses regular expressions, it does a reasonable job and is certainly better then nothing. I've been using it for around 5 years and it works well enough for me but patches to make it better are more then welcome. zypper in grc grc osc build -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
Am Sonntag, 6. Dezember 2020, 04:23:53 CET schrieb Simon Lees:
Hi,
On 12/5/20 12:47 AM, Hans-Peter Jansen wrote:
Hi,
is it possible to trick a local osc build into producing colored output without much fuzz?
The point is, if I 'osc chroot' into the package and trigger a build manually, colored output is generated. Therefor I guess, rpmbuild ignores/avoids certain environment values (COLORTERM?) for better parsebility.
For local builds of huge projects, colored output would be much nicer, since it would be easier to distinguish between warnings and errors.
There is a tool "grc" that uses regular expressions, it does a reasonable job and is certainly better then nothing. I've been using it for around 5 years and it works well enough for me but patches to make it better are more then welcome.
zypper in grc
grc osc build
Exactly, what I was looking for, thanks Simon. Now I need to train my vegetative nervous system to type grc before osc build.. Cheers, Pete
On Sun, Dec 6, 2020 at 9:21 PM Hans-Peter Jansen <hpj@urpla.net> wrote:
Am Sonntag, 6. Dezember 2020, 04:23:53 CET schrieb Simon Lees:
Hi,
On 12/5/20 12:47 AM, Hans-Peter Jansen wrote:
Hi,
is it possible to trick a local osc build into producing colored output without much fuzz?
The point is, if I 'osc chroot' into the package and trigger a build manually, colored output is generated. Therefor I guess, rpmbuild ignores/avoids certain environment values (COLORTERM?) for better parsebility.
For local builds of huge projects, colored output would be much nicer, since it would be easier to distinguish between warnings and errors.
There is a tool "grc" that uses regular expressions, it does a reasonable job and is certainly better then nothing. I've been using it for around 5 years and it works well enough for me but patches to make it better are more then welcome.
zypper in grc
grc osc build
Exactly, what I was looking for, thanks Simon.
Now I need to train my vegetative nervous system to type grc before osc build..
alias oscb="..."?
Cheers, Pete _______________________________________________ openSUSE Packaging mailing list -- packaging@lists.opensuse.org To unsubscribe, email packaging-leave@lists.opensuse.org List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/packaging@lists.opensuse.org
On 12/7/20 6:53 AM, Mark Stopka wrote:
On Sun, Dec 6, 2020 at 9:21 PM Hans-Peter Jansen <hpj@urpla.net> wrote:
Am Sonntag, 6. Dezember 2020, 04:23:53 CET schrieb Simon Lees:
Hi,
On 12/5/20 12:47 AM, Hans-Peter Jansen wrote:
Hi,
is it possible to trick a local osc build into producing colored output without much fuzz?
The point is, if I 'osc chroot' into the package and trigger a build manually, colored output is generated. Therefor I guess, rpmbuild ignores/avoids certain environment values (COLORTERM?) for better parsebility.
For local builds of huge projects, colored output would be much nicer, since it would be easier to distinguish between warnings and errors.
There is a tool "grc" that uses regular expressions, it does a reasonable job and is certainly better then nothing. I've been using it for around 5 years and it works well enough for me but patches to make it better are more then welcome.
zypper in grc
grc osc build
Exactly, what I was looking for, thanks Simon.
Now I need to train my vegetative nervous system to type grc before osc build..
alias oscb="..."?
Yeah thats what I do, here's the fish version type oscb oscb is a function with definition # Defined in /home/simon/src/config/tackle/plugins/devel/oscb.fish @ line 1 function oscb --description 'osc build' grc osc build --ccache --cpio-bulk-download --download-api-only $argv end -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
On 2020-12-06 21:21:21 +0100, Hans-Peter Jansen wrote:
Am Sonntag, 6. Dezember 2020, 04:23:53 CET schrieb Simon Lees:
There is a tool "grc" that uses regular expressions, it does a reasonable job and is certainly better then nothing. I've been using it for around 5 years and it works well enough for me but patches to make it better are more then welcome.
zypper in grc
grc osc build
Exactly, what I was looking for, thanks Simon.
Now I need to train my vegetative nervous system to type grc before osc build..
Maybe something like this does the trick (untested): marcus@linux:~> cat ~/bin/color_build #!/bin/bash exec grc build $@ marcus@linux:~> chmod +x ~/bin/color_build marcus@linux:~> osc config general build-cmd ~/bin/color_build 'general': 'build-cmd' is set to '/home/marcus/bin/color_build' marcus@linux:~> Marcus
On Dez 06 2020, Marcus Hüwe wrote:
marcus@linux:~> cat ~/bin/color_build #!/bin/bash exec grc build $@
You should put quotes around $@. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Am Sonntag, 6. Dezember 2020, 21:39:16 CET schrieb Marcus Hüwe:
On 2020-12-06 21:21:21 +0100, Hans-Peter Jansen wrote:
Am Sonntag, 6. Dezember 2020, 04:23:53 CET schrieb Simon Lees:
There is a tool "grc" that uses regular expressions, it does a reasonable job and is certainly better then nothing. I've been using it for around 5 years and it works well enough for me but patches to make it better are more then welcome.
zypper in grc
grc osc build
Exactly, what I was looking for, thanks Simon.
Now I need to train my vegetative nervous system to type grc before osc build..
Maybe something like this does the trick (untested):
marcus@linux:~> cat ~/bin/color_build #!/bin/bash exec grc build $@ marcus@linux:~> chmod +x ~/bin/color_build marcus@linux:~> osc config general build-cmd ~/bin/color_build 'general': 'build-cmd' is set to '/home/marcus/bin/color_build' marcus@linux:~>
Nice trick, Marcus, but I get a completely different output for that case. $ grc osc build # nice and expressive: https://paste.opensuse.org/91070912 root# echo > /usr/local/bin/colored_build << EOF !/bin/bash exec /usr/bin/grc /usr/bin/build "$@" EOF root# chmod +x /usr/local/bin/colored_build root# echo >> /etc/sudoers.d/local-build << EOF hp ALL = NOPASSWD: /usr/local/bin/colored_build EOF $ osc config general build-cmd /usr/local/bin/colored_build # rather greenish: https://paste.opensuse.org/96352274 Hmm. Pete
On 2020-12-08 15:46:09 +0100, Hans-Peter Jansen wrote:
Am Sonntag, 6. Dezember 2020, 21:39:16 CET schrieb Marcus Hüwe:
On 2020-12-06 21:21:21 +0100, Hans-Peter Jansen wrote:
<SNIP>
Now I need to train my vegetative nervous system to type grc before osc build..
Maybe something like this does the trick (untested):
marcus@linux:~> cat ~/bin/color_build #!/bin/bash exec grc build $@ marcus@linux:~> chmod +x ~/bin/color_build marcus@linux:~> osc config general build-cmd ~/bin/color_build 'general': 'build-cmd' is set to '/home/marcus/bin/color_build' marcus@linux:~>
Nice trick, Marcus, but I get a completely different output for that case.
$ grc osc build
# nice and expressive: https://paste.opensuse.org/91070912
root# echo > /usr/local/bin/colored_build << EOF !/bin/bash exec /usr/bin/grc /usr/bin/build "$@" EOF root# chmod +x /usr/local/bin/colored_build root# echo >> /etc/sudoers.d/local-build << EOF hp ALL = NOPASSWD: /usr/local/bin/colored_build EOF
$ osc config general build-cmd /usr/local/bin/colored_build
# rather greenish: https://paste.opensuse.org/96352274
Looks more openSUS(E)ish... so that's correct:P Joking aside, now the grc script is executed as root - maybe that's why it does not find your (user) config files? (Just a wild guess) Marcus
Am Dienstag, 8. Dezember 2020, 21:05:39 CET schrieb Marcus Hüwe:
On 2020-12-08 15:46:09 +0100, Hans-Peter Jansen wrote:
Nice trick, Marcus, but I get a completely different output for that case.
$ grc osc build
# nice and expressive: https://paste.opensuse.org/91070912
root# echo > /usr/local/bin/colored_build << EOF !/bin/bash exec /usr/bin/grc /usr/bin/build "$@" EOF root# chmod +x /usr/local/bin/colored_build root# echo >> /etc/sudoers.d/local-build << EOF hp ALL = NOPASSWD: /usr/local/bin/colored_build EOF
$ osc config general build-cmd /usr/local/bin/colored_build
# rather greenish: https://paste.opensuse.org/96352274
Looks more openSUS(E)ish... so that's correct:P Joking aside,
LOL
now the grc script is executed as root - maybe that's why it does not find your (user) config files? (Just a wild guess)
Hmm, just using grc out of the box, no user centric config files in place. That would imply, grc behaves differently, when running as root. Oh well. Pete
On 12/9/20 6:50 PM, Hans-Peter Jansen wrote:
Am Dienstag, 8. Dezember 2020, 21:05:39 CET schrieb Marcus Hüwe:
On 2020-12-08 15:46:09 +0100, Hans-Peter Jansen wrote:
Nice trick, Marcus, but I get a completely different output for that case.
$ grc osc build
# nice and expressive: https://paste.opensuse.org/91070912
root# echo > /usr/local/bin/colored_build << EOF !/bin/bash exec /usr/bin/grc /usr/bin/build "$@" EOF root# chmod +x /usr/local/bin/colored_build root# echo >> /etc/sudoers.d/local-build << EOF hp ALL = NOPASSWD: /usr/local/bin/colored_build EOF
$ osc config general build-cmd /usr/local/bin/colored_build
# rather greenish: https://paste.opensuse.org/96352274
Looks more openSUS(E)ish... so that's correct:P Joking aside,
LOL
now the grc script is executed as root - maybe that's why it does not find your (user) config files? (Just a wild guess)
Hmm, just using grc out of the box, no user centric config files in place. That would imply, grc behaves differently, when running as root. Oh well.
grc's config files are in /usr/share/grc/ so it should behave the same for any user including root. Having said that I don't really run it as root because I have the following in my sudoers file simon ALL = NOPASSWD: /usr/bin/build If you wanted different config per user you could create a conf.osc_bob and then pass -c osc_bob to it on the command line. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
participants (6)
-
Andreas Schwab
-
Hans-Peter Jansen
-
Jan Engelhardt
-
Marcus Hüwe
-
Mark Stopka
-
Simon Lees