[Alexandria-list] What is supposed to be the contents of a yaml file in Alexandria

Tim Malone timothy.malone at gmail.com
Sat Feb 23 17:37:03 EST 2008


oops, I had sent an email in response to this and forgot to cc the
list. Anyway, the problem was something I had fixed a little while ago
after noticing that my yaml files were getting quite large. The
problem was the pointer to the Library was getting written to each
file. It doesn't seem to cause any dire consequences (files load
properly and I've seen no instances of duplicate books getting
loaded). However, with the patch I committed (before 0.6.3), simply
opening a book's properties and then hitting the save button fixes the
file. Lennart replied to my offlist email and confirmed that this was
the problem and that re-saving the file fixed it.
It would be interesting to know if the Library link was in any release
versions of Alexandria. If so we might want to include a check for
affected files when loading a library just in case a problem shows up
with them later on.

Tim

On Sat, Feb 23, 2008 at 5:05 PM, Cathal Mc Ginley
<cathal.alexandria at gnostai.org> wrote:
> -----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-----
>
>
> _______________________________________________
>  Alexandria-list mailing list
>  Alexandria-list at rubyforge.org
>  http://rubyforge.org/mailman/listinfo/alexandria-list
>


More information about the Alexandria-list mailing list