TODO
author Kristian H?gsberg <krh@redhat.com>
Tue Sep 04 23:52:59 2007 -0400 (2007-09-04)
changeset 6 4eeed5fbe6b7
parent 1 38be5ee4d231
child 8 7820b7d94662
permissions -rw-r--r--
Factor out array code.
     1 - pkg manifest is list of files
     2 
     3 	/usr/bin/bash 1321321372198798
     4 
     5   plus provides, requires and version?
     6 
     7 - keep history of installed packages/journal of package transaction,
     8   so we can roll back to yesterday, or see what got installed in the
     9   latest yum update.
    10 
    11 - we build a cache of the currently installed set to service
    12   dependency inquiries fast:
    13 
    14 	map from property to pkg (as hash) providing it
    15 	map from property to pkgs requiring it
    16 	map from pkg name to manifest
    17 	map from string to string pool index
    18 
    19 	no implicit provides? not even pkgname?
    20 
    21 - properties are strings, stored in a string table
    22 
    23 - on disk maps are binary files of (string table index, hash) pairs
    24 
    25 - at run time, we mmap the map, and keep changes in memory in a splay
    26   tree or similar.  if searching the splay tree fails we punt to the
    27   mmap.  once the transaction is done, we merge the map and the splay
    28   tree and write it back out.
    29 
    30 - the on-disk string pool is sorted and we keep a list of indices into
    31   the string pool in sorted order so we can bsearch the list with a
    32   string to get its string pool index.  maybe a hash table is better,
    33   less I/O as we will expect to find the string within the block we
    34   look up with the hash function.
    35 
    36 - represent all files as a breadth first traversal of the tree of all
    37   files.  each entry has its name (string pool index), the number of
    38   immediate children, total number of children, and owning package.
    39   for files both these numbers are zero.  a file is identified by its
    40   index in this flattened tree.
    41 
    42   to get the file name from an index, we search through the list.  by
    43   summing up the number of children, we know when to skip a directory
    44   and when to descend into one.  as we go we accumulate the path
    45   elements.
    46 
    47   hmm, dropping number of immediate children and using a sentinel drops
    48   a word from every entry.
    49 
    50 - signed pkgs
    51 - gzip pkg xml files somehow?