Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 484236 - net-nntp/sabnzbd: sabnzbd.ini should not use DOS line endings
Summary: net-nntp/sabnzbd: sabnzbd.ini should not use DOS line endings
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Low minor (vote)
Assignee: Justin Bronder (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-08 13:39 UTC by eponymous
Modified: 2013-09-08 15:50 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eponymous 2013-09-08 13:39:56 UTC
I discovered when writing the new init script (See: https://bugs.gentoo.org/show_bug.cgi?id=483786) for sabnzbd that the sabnzbd.ini has DOS line endings (CRLF, ^M) in it.

DOS line endings are a pain to deal with, especially in regexps.

We should run dos2unix on the sabnzbd.ini file to get Unix line endings.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-09-08 14:32:11 UTC
Fixed without a revision bump. Thanks for the report!
Comment 2 eponymous 2013-09-08 14:59:08 UTC
(In reply to Jeroen Roovers from comment #1)
> Fixed without a revision bump. Thanks for the report!

Hmm, can you explain how this is fixed?

Having thought about this a bit more I'm not sure if it's as simple as running dos2unix since sabnzbd will be writing to that file it will most likely write out CRLFs at the end.

This may be a bug to raise against the sabnzbd developers so that they detect the OS environment and write the correct line endings.

Sigh, this means yet another modification to my init script!
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-09-08 15:35:42 UTC
(In reply to eponymous from comment #2)
> (In reply to Jeroen Roovers from comment #1)
> Hmm, can you explain how this is fixed?

cvs/gentoo-x86/net-nntp/sabnzbd $ dos2unix files/sabnzbd.ini
dos2unix: converting file files/sabnzbd.ini to Unix format ...

> Having thought about this a bit more I'm not sure if it's as simple as
> running dos2unix since sabnzbd will be writing to that file it will most
> likely write out CRLFs at the end.
> 
> This may be a bug to raise against the sabnzbd developers so that they
> detect the OS environment and write the correct line endings.

I guess if the daemon does indeed write to /etc/sabnzbd.ini, that is a design bug that should be fixed upstream.

> Sigh, this means yet another modification to my init script!

How?
Comment 4 eponymous 2013-09-08 15:50:56 UTC
(In reply to Jeroen Roovers from comment #3)
> (In reply to eponymous from comment #2)
> > (In reply to Jeroen Roovers from comment #1)
> > Hmm, can you explain how this is fixed?
> 
> cvs/gentoo-x86/net-nntp/sabnzbd $ dos2unix files/sabnzbd.ini
> dos2unix: converting file files/sabnzbd.ini to Unix format ...
> 

Ah fair enough. I did do a re-fetch of the source and a "vim -b" on the file but couldn't see the "DOSless" result.

> > Having thought about this a bit more I'm not sure if it's as simple as
> > running dos2unix since sabnzbd will be writing to that file it will most
> > likely write out CRLFs at the end.
> > 
> > This may be a bug to raise against the sabnzbd developers so that they
> > detect the OS environment and write the correct line endings.
> 
> I guess if the daemon does indeed write to /etc/sabnzbd.ini, that is a
> design bug that should be fixed upstream.
> 

Yeah, I've confirmed it does so it can be raised with them.

> > Sigh, this means yet another modification to my init script!
> 
> How?

It's no biggie :) I've submitted a change to the init script to make it explicitly line-ending agnostic so we now don't care about the format of sabnzbd.ini.