[pacman-dev] Add delta information to libalpm.

Nathan Jones nathanj at insightbb.com
Mon Oct 15 17:51:08 EDT 2007


This patchset adds delta information to repository databases and
libalpm, allowing libalpm to download multiple delta files when
upgrading a package.

I still have some work to do, but I thought I would post this now to get
any suggestions and criticisms that anyone has.

Some things I still need to do:
Add error checking/md5sum to the download function.
Remove some hardcoded stuff (like ".pkg.tar.gz").
Run through valgrind to make sure everything is freed.
Delete delta files and intermediate packages after they are not needed.
Test...

The patches in action:

$ ls -lh wbox*.pkg.tar.gz wbox*.delta
-rw-r--r-- 1 nathanj users  55K 2007-10-15 17:11 wbox-3-1-i686.pkg.tar.gz
-rw-r--r-- 1 nathanj users 7.9K 2007-10-15 17:11 wbox-3-1_to_4-1-i686.delta
-rw-r--r-- 1 nathanj users  56K 2007-10-15 17:11 wbox-4-1-i686.pkg.tar.gz
-rw-r--r-- 1 nathanj users  398 2007-10-15 17:11 wbox-4-1_to_4-2-i686.delta
-rw-r--r-- 1 nathanj users  56K 2007-10-15 17:11 wbox-4-2-i686.pkg.tar.gz

$ repo-add test.db.tar.gz wbox-4-2-i686.pkg.tar.gz
==> Extracting database to a temporary location...
==> Adding package 'wbox-4-2-i686.pkg.tar.gz'
  -> Removing existing package 'wbox-3-1'...
  -> Creating 'desc' db entry...
  -> Computing md5 checksums...
  -> Creating 'depends' db entry...
  -> Creating 'deltas' db entry...
  -> Added delta 'wbox-3-1_to_4-1-i686.delta'
  -> Added delta 'wbox-4-1_to_4-2-i686.delta'
==> Creating updated database file /home/nathanj/pkgs/pkgs/test.db.tar.gz

$ pacman -Q wbox
wbox 3-1

$ sudo pacman -Sy wbox
:: Synchronizing package databases...
 test                       3.4K    8.2M/s 00:00:00 [#####################] 100%
resolving dependencies... done.
looking for inter-conflicts... done.

Targets: wbox-4-2 

Total Package Size:   0.05 MB
Total Download Size   0.01 MB
Total Installed Size:   0.08 MB

Proceed with installation? [Y/n]
:: Retrieving packages from test...
 wbox-3-1_to_4-1-i686...    7.9K   23.3M/s 00:00:00 [#####################] 100%
 wbox-4-1_to_4-2-i686...    0.4K    5.3M/s 00:00:00 [#####################] 100%
Generating wbox-4-1-i686.pkg.tar.gz with wbox-3-1_to_4-1-i686.delta... done.
Generating wbox-4-2-i686.pkg.tar.gz with wbox-4-1_to_4-2-i686.delta... done.
checking package integrity... done.
(1/1) checking for file conflicts                   [#####################] 100%
(1/1) upgrading wbox                                [#####################] 100%




More information about the pacman-dev mailing list