Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 400753 - sys-apps/grep-2.[9|10] : doesn't recognize start of line ??
Summary: sys-apps/grep-2.[9|10] : doesn't recognize start of line ??
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 13:58 UTC by Toralf Förster
Modified: 2012-01-25 23:20 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
output of eix-test-obsolete brief > (x,1.71 KB, text/plain)
2012-01-25 14:55 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2012-01-25 13:58:04 UTC
Hhm, at a chrooted stable system image I get the expected output for 2.9:

$ eix-test-obsolete | grep -v -e "^No " -e "^Skipping " -e "^$"
The names of all installed packages are in the database.
Installed packages with a version not in the database (or masked):
[D] dev-libs/nettle (2.4@09/23/2011 -> 2.0): Low-level cryptographic library

However at an unstable system version 2.10 gives :

$ eix-test-obsolete brief | grep -v -e "^No " -e "^Skipping " -e "^$"
The names of all installed packages are in the database.
No  redundant  entries in /etc/portage/package.{,accept_}keywords
No  redundant  entries in /etc/portage/package.mask
No  redundant  entries in /etc/portage/package.unmask
Skipping check:  redundant  entries in /etc/portage/package.use
Skipping check:  redundant  entries in /etc/portage/package.env
No  redundant  entries in /etc/portage/package.license
Skipping check:  redundant  entries in /etc/portage/package.cflags
All installed versions of packages are in the database.

A simple test case however works :

$ echo -e "abc\ndef\n" | grep -v -e "^def"
abc



Therefore I wonder if there is an unusual behavior of "eix-test-obsolete brief" or with grep ??


Reproducible: Always
Comment 1 Toralf Förster gentoo-dev 2012-01-25 14:55:34 UTC
Created attachment 299867 [details]
output of eix-test-obsolete brief >

Oops,

got the attached file via

$> eix-test-obsolete brief > x

(eix 0.23.7) and it seems that this doesn't works at a stable Gentoo too as expected:

$ cat x | grep -v -e "^No " -e "^Skipping " -e "^$"
Comment 2 SpanKY gentoo-dev 2012-01-25 19:17:32 UTC
load the file up into an editor and you'll see that there are ^G chars there:

^[]0;eix-test-obsolete: accept_keywords^GNo  redundant  entries in /etc/portage/package.{,accept_}keywords

the issue is that your terminal is rendering things in such a way that it just looks like "No  redundant ..." is the start of the line.
Comment 3 Toralf Förster gentoo-dev 2012-01-25 20:24:10 UTC
Well - this issue started with eix-0.23.7 whereas eix-0.24.3-r1 doesn't produce such output - so it is not only the terminal I think, or ?
Comment 4 SpanKY gentoo-dev 2012-01-25 23:15:03 UTC
run your grep test and pipe it to a file, then edit that file.  you'll see chars that weren't visible in the terminal.

then run `cat` on the file and see that again the chars are not there and it looks like lines start with "No".

the file you posted does not violate the regex matching rules -- "No" did not start at the beginning of line (regardless of how the escape sequences caused the line to be displayed).

you could try asking the eix author why they're playing tricks with the output
Comment 5 Martin Väth 2012-01-25 23:18:38 UTC
You are confused by the ANSI sequences to update the status line of the terminal - which you terminal "displays" by changing the status line (depending on your terminal, this is most likely the windows title).
To suppress this output use the option -K.

>=eix-0.23.8 will probably suppress this output always unless it goes to a terminal.
Comment 6 Martin Väth 2012-01-25 23:20:50 UTC
(In reply to comment #5)
> To suppress this output use the option -K.

Typo: I meant option -H