The penultimate week of GSoC was filled with architectural designs and discussions. I've spent a good amount of time researching on apt, pacman and npm, and along with the lessons learned from the previous Package Manager implementation, we're planning out an improved design for making the Package Manager more extensible and robust.

Updated Package Manager API

This new design was inspired by the classic Linux package manager. Here's a diagram:

Diagram

Here, Cache contains the previously downloaded ZIPs only. It can be used to re-install old packages without getting online. It can be cleared any time, just like any good cache storage. PackageDatabase is kinda like the version lists from the last implementation. Its main purpose is to keep track of all packages available in all online repositories and to return the URL for any package that we're searching.

This approach is similar to what Linux package managers do. For example, when you're using pacman (from Arch Linux), the corresponding files are located here:

  • Package database: /var/lib/pacman/sync
  • Cached packages: /var/cache/pacman/pkg

And for apt (from Ubuntu) it should be similar to:

  • Package database: /var/lib/apt/lists
  • Cached packages: /var/cache/apt/archives

This new design will allow the package manager to add support for third party repositories and multiple package identifiers (instead of using an enum of supported packages from last design). This one will be a major part of the 4.0 release, and I'll make a post as soon as it gets ready for a test drive.

Be sure to check out this post on my weekly GSoC forum thread.