Happy hacking,
Debarshi
---------- Forwarded message ----------
From: David Timms <dti...@iinet.net.au>
Date: 02-Sep-2007 07:26
Subject: [Yum-devel] python-iniparse rejects baseurls with commented
lines and indented values
To: yum-...@linux.duke.edu
Hi, on a machine running f8t1, I updated yum to development, which:
installed python-iniparse 0.2.1-2.fc8
updated yum 3.2.4-3.fc8
Now yum commands rejects my repo files:
# yum update rpm
Loading "skip-broken" plugin
Config Error: File contains parsing errors:
file://///etc/yum.repos.d/fedora.reo
[line 8]:
http://ftp.iinet.net.au/pub/fedora/linux/releases/7.90/Eve/
# cat /etc/yum.repos.d/fedora.repo
====
[fedora]
name=Fedora $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
baseurl=
# ftp://infrastructure-server/linux/fedora/$releasever/$basearch/disc/
#
ftp://infrastructure-server/linux/fedora/$releasever/$basearch/yum/fedora/
#
ftp://ftp.iinet.net.au/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
http://ftp.iinet.net.au/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
#
ftp://mirror.pacific.net.au/linux/fedora/linux/releases/$releasever/Everything/$basearch/os/
#
http://mirror.pacific.net.au/linux/fedora/linux/releases/$releasever/Everything/$basearch/os/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[fedora-debuginfo]
====
Since the above will be wrapped and might not be obvious - simplified:
baseurl=
# http://internalsite/fedora/path/
http://ispsmirror/fedora/path/
http://incountrymirror/fedora/path/
# http://incountrymirror2/fedora/path/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
OK, I can solve this deleting the two space characters that I used to
indent the baseurl's {leacing the commented lines}, aka:
=====
baseurl=
# http://internalsite/fedora/path/
http://ispsmirror/fedora/path/
http://incountrymirror/fedora/path/
# http://incountrymirror2/fedora/path/
=====
or I can remove the commented lines alltogether, leaving the indentation:
=====
baseurl=
http://incountrymirror/fedora/path/
=====
I think that rejecting indented lines if there is an intervening comment
is being unnecessarily strict. The key is capable of having multiple
values, separated by newlines. We should be able to comment out
individual lines {and not permanently remove them}. We should also be
able to indent lines to more clearly indicate the structure of the
settings in the file.
I can report this as a bug, but where: bugzilla.redhat.com, or upstream ?
DaveT.
_______________________________________________
Yum-devel mailing list
Yum-...@linux.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel
--
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu
On 9/1/07, Debarshi 'Rishi' Ray <debars...@gmail.com> wrote:
> > I can report this as a bug, but where: bugzilla.redhat.com, or upstream ?
>
> I have forwarded it to the iniparse
> (http://code.google.com/p/iniparse/) mailing list.
>
> Regards,
> Debarshi
It turned out to be easier than I'd thought. I remember now why I
didn't support it initially - it was unclear to me what should happen
if a multi-line value with interspersed comments was assigned to. In
retrospect, it's straightforward: the comments are part of the value,
and they are replaced on assignment.
But, looking at the parsing code reminded me how ugly it is - many of
the details of the format are entirely results of accidents of
implementation.
-param
Thanks,
Tim