[Alexandria-list] What is supposed to be the contents of a yaml file in Alexandria
Cathal Mc Ginley
cathal.alexandria at gnostai.org
Sat Feb 23 17:05:13 EST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sat, 23 Feb 2008 13:02:10 +0100
"L.C. Karssen" <lennart at karssen.org> wrote:
> Hi all,
>
> I was looking around the .alexandria directory today (trying to find
> out more about bug #18308) and I came across several yaml files that
> had more than one book in them. I thought that each book was suposed
> to have its own yaml file named after its ISBN (and the opposite,
> each yaml file contains only one book). Is my assumption right and is
> my library corrupt, or am I wrong?
You're right. Each YAML file should have exactly one book in it.
Okay, this would be a major problem. I imagine it's something to do
with the recent changes to the Book and Library classes - Book now
contains an embedded link back to its containing Library. This is
supposed to get nil'ed out before it's serialized to YAML, but this
mightn't be happening everywhere.
Can you send me an example YAML file with this corruption?
If this is the case, we have a serious showstopper bug on our hands
which would require an emergency bugfix release.
I also had a look at the debug log for #18308, and an InvalidISBNError
should not be causing a crash like that :^(
>
> Another thing I noticed is that I have several yaml files that start
> with a - (dash). This makes using tools like grep impossible. Are
> these files there for a reason?
>
Yep, this is an annoyance I've noticed before. When a book doesn't have
an ISBN, it's 'ident' or identifier, is generated by taking the
hash-code of its title (a number generated from the title string,
called a hash-code because it's often used in hashtables). Sometimes
this number is negative. The YAML filename uses the 'ident', so this
sometimes results in filenames beginning with a '-'.
grep does indeed have trouble with this, it thinks you're trying to
specify an option like -77516869.yaml; but you can tell it to stop
expecting options by using -- as follows:
grep -i -- title *.yaml
It's annoying, though, and it's a 'feature' I'd love to remove somehow.
>
> Lennart.
- C.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: GnuPT 2.6.2.1 by EQUIPMENTE.DE
iD8DBQFHwJiifMAUnRdb+8oRAhndAJ9KvwNiTb/+peboYDyR2jbXEPUBRwCfZTot
bDirNpv2OK2Pc+A5cT1R0E4=
=EJPx
-----END PGP SIGNATURE-----
More information about the Alexandria-list
mailing list