blackducksoftware / ohcount

The Ohloh source code line counter
https://github.com/blackducksoftware/ohcount
GNU General Public License v2.0
257 stars 74 forks source link

/etc/issue on Fedora contains escape sequence \S #46

Closed bluedreamer closed 5 years ago

bluedreamer commented 7 years ago

Fedora uses an escape sequence to insert the OS name into /etc/issue output when processed by agetty

[user@localhost ~]$ cat /etc/issue
\S
Kernel \r on an \m (\l)

From the agetty man page

       s      Insert  the  system  name (the name of the operating system).  Same as `uname -s'.  See also
              the \S escape code.

       S or S{VARIABLE}
              Insert the VARIABLE data from /etc/os-release.  If this file does not exist then  fall  back
              to  /usr/lib/os-release.   If  the  VARIABLE argument is not specified, then use PRETTY_NAME
              from the file or the system name (see \s).  This escape code allows to keep /etc/issue  dis‐
              tribution and release independent.  Note that \S{ANSI_COLOR} is converted to the real termi‐
              nal escape sequence.

Ideally the standard way of obtaining the OS name should be used

[user@localhost ~]$ lsb_release -i
Distributor ID: Fedora
craigbarnes commented 6 years ago

Ideally the standard way of obtaining the OS name should be used

LSB is pretty much a dead standard and lsb_release is usually not installed by default. Using /etc/os-release would be a better first choice.

Also, this issue only describes the contents of some file on Fedora. It would be helpful to also describe how it actually relates to this codebase.

bluedreamer commented 6 years ago

I actually have pull request #54 that uses os-release. The issue is partly the build script printing out the platform and also making some decisions based on the OS name

craigbarnes commented 6 years ago

It seems to me like the maintainers of this project are still using it, but are now developing it as closed source. I have a private fork that I'm considering making open source, but it's not 100% compatible with the original (far fewer flags and extra features).

bluedreamer commented 6 years ago

If you do - feel free to take my pull request if it applies - I like ohcount it is a cool tool. I was kinda lost who is maintaining this now. Shame if it went closed source

craigbarnes commented 6 years ago

I've just pushed my code to https://github.com/craigbarnes/tally if you're interested. Strictly speaking it's not actually a "fork" -- it just borrows a few things from the original Ragel parsers.

PDegenPortnoy commented 6 years ago

@bluedreamer, @craigbarnes I apologize for the delay in responding. Our small team continues to be responsible for Ohcount and use in creating the analytics that are display at https://www.openhub.net. We have returned our focus to Ohcount, which has been long neglected, and will be merging all viable pull requests in short order.

Thank you for your contribution and thoughts and please accept my apology for the delay.

notalex commented 5 years ago

The https://github.com/blackducksoftware/ohcount/pull/54 has been picked for the upcoming version-4 branch. The reported issue will be fixed in the next release.