[Draft] New debtags update algorithm

Enrico Zini enrico at enricozini.org
Thu Aug 31 21:20:09 UTC 2006


On Thu, Aug 31, 2006 at 05:50:21PM +0200, Enrico Zini wrote:

>  4. When the library is initialised, check if there are newer files in
>     the sources directory, and if yes, rebuild the index.  If it's
>     running as root, rebuild the central index, otherwise rebuild the
>     user index.

Now let's see how to choose what index to read, and what index to
update.

 * For vocabulary and tag indexes
 
 1. If there are user sources, then completely ignore the system indexes
     - If the user index is newer than the newest of the user and system
       sources, read it
     - Else, read all the sources to regenerate the user index

 2. Else, try the system index first
     - If the system index is newer than the newest of the system
       sources, then use it.  If the user index exists, delete it.
     - Else, check if we are root
	- If we are root, read all the sources to regenerate the system
	  index
	- Else, read all the sources to regenerate the user index

 * For the support index pkgidx

There cannot be user sources for pkgidx, as it solely depends on
libapt-pkg's internal indexes.  Therefore:

 - If the system index is newer than the newest of the system
   sources, then use it.  If the user index exists, delete it.
 - Else, check if we are root
    - If we are root, scan the APT index to generate the system pkgidx.
    - Else, scan the APT index to regenerate the user index.

...and now, let's implement this as well.


Ciao,

Enrico

-- 
GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <enrico at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/debtags-devel/attachments/20060831/22348e5f/attachment.pgp


More information about the Debtags-devel mailing list