Sugar unusable as an e-book reader

david at lang.hm david at lang.hm
Mon Oct 27 07:33:54 EDT 2008


On Mon, 27 Oct 2008, S Page wrote:

> david at lang.hm wrote:
>
> In an ideal world the book would be packaged as a single collection (.xol) 
> file, so downloading it would unpack it in ~/Library and add it to the 
> content navigation in the OLPC Library home page.  You could try 
> http://wiki.laptop.org/go/Creating_a_collection and 
> http://wiki.laptop.org/go/Content_bundle_making_script .

hmm, I modified the script from the second link and used it to create 
bundle .xol files. putting them on the USB stick doesn't seem to work. 
they show up in the journal as unknown file types and hitting start 
doesn't seem to do anything (other than triggering some disk I/O)

the script is below. it looks like it's doing the right thing. the 
resulting zip file has the book + library.info contents.

David Lang

#!/bin/sh
## usage: xolbundle filename
filename=$1

mkdir -p $filename/$filename
cd $filename/$filename
unzip ../../H_$filename.zip
cd ../..

# create the metadata
TARGET_DIR="$filename"/library
mkdir -p ${TARGET_DIR}
# note: this is a stupid script! please fix it!
# see http://wiki.laptop.org/go/Sample_library.info_file
(
echo [Library]
echo name = "$filename"
echo global_name = "$filename"
echo long_name = "$filename"
echo library_version = 1
echo host_version = 1
echo l10n = false
echo locale = en ) > ${TARGET_DIR}/library.info

# zip and rename as bundle
zip -9 -rq "$filename.xol" "$filename"

# delete extra files
rm -rf "$filename"





More information about the Devel mailing list