I just had the same no-parse problem with /etc/apt/preferences that aking469 had. I found this thread and used devil28's guidance, 'add a linefeed...' to solve this little poser.

Now I'm curious why that worked? It wasn't very intuitive from my, ancient newbie, side of the field (my last serious programming was done in Fortran - card punch machines and all!).

kilo hotel

devil

Titel: RE: Apt-get error Verfasst am: 04.06.2006, 06:28 Uhr

Team Member

Anmeldung: 06. Mai 2005
Beiträge: 3087
Wohnort: berlin

well, that empty line should have been there in the first place to meet unix file-format, but someone forgot.
apt upgraded itself to a new version and from then on demanded unix file-format and not dos file-format. who knows why....

btw.: old dogs can learn new operating systems:wink:

greetz
devil

_________________<<We are Xorg - resistance is futile - you will be axximilated>>

What's annoying is that all the package maintainers had to do was have apt add the linefeed to that file when the new apt package is installed. Why that wasn't done is hard to understand since there may be nothing easier to do.

A linefeed at the end will not alter the existing file in any way, and you can have a hundred extra line feeds without changing how apt works.

this one is definitely the weakest failing I've seen so far in debian sid, that should have been fixed within a day of the package release, but it's still in it.

I don't agree with devil28 as to the cause however, the absence of a linefeed does not have to be a dos/unix issue, it's simply how the file is parsed.

As I've noted before, .htaccess files have the same issue, the parser goes through them line by line, it knows it's reached the end of a line by the presence of the \n character, linefeed.

So what happens when you don't have that linefeed on the last line? The parser sits there, waiting for the last line to be parsed, but it can't be parsed, because it doesn't end.

If you remove the linefeed from the last line of any website using .htaccess files, the entire website will instantly fail, with a 500 error, for I assume the exact same reason.

So I'd guess, though I could of course be wrong, that apt simply changed how it parses it, not sure exactly what the change would be. With htacess, this has nothing to do with dos/unix at all, it's just the presence or absence of a closing \n character on each line. And since it's by definition present on each line before the last line, the only line that could suffer from its absence would be the last line.

I have scripts that parse input slightly differently, they parse each line after a line feed, so if the last one doesn't have it, it still gets parsed, but there are different ways to do it.

ai4kh

Titel: RE: Apt-get error Verfasst am: 04.06.2006, 22:03 Uhr

Anmeldung: 12. Apr 2006
Beiträge: 2

devil,
Thanks!

re: "btw.: old dogs can learn new operating systems:wink:"

It would seem the latter have the bulge on the former:nudge:

73, kilo hotel

KStorm

Titel: Re: RE: Apt-get error Verfasst am: 08.06.2006, 10:09 Uhr

Anmeldung: 19. Mai 2006
Beiträge: 5

ai4kh hat folgendes geschrieben::

First submisson:

I just had the same no-parse problem with /etc/apt/preferences that aking469 had. I found this thread and used devil28's guidance, 'add a linefeed...' to solve this little poser.

Now I'm curious why that worked? It wasn't very intuitive from my, ancient newbie, side of the field (my last serious programming was done in Fortran - card punch machines and all!).

kilo hotel

Same here. Actually, this is the 2nd time I tried to correct this problem...after inserting the linefeed at the beginning of /apt/preferences, I inserted it at the end, now everything is working again.