Je le sous-entend sans vraiment en causer depuis quelques semaines: je bosse sur un clone d’apt(8) pour NetBSD. Le projet n’est pas fini, loin s’en faut, mais j’ai atteint une Milestone aujourd’hui. Démonstration.
Installation :
[~/src/pkg_dry] ./pkg_dry -i eterm
nothing to upgrade.
5 packages to be installed: tiff-3.8.2nb4 jpeg-6bnb4 imlib2-1.4.2nb1 libast-0.6.1nb3 eterm-0.9.4nb1
proceed ? [y/N] y
downloading packages...
downloading tiff-3.8.2nb4.tgz: 100%
downloading jpeg-6bnb4.tgz: 100%
downloading imlib2-1.4.2nb1.tgz: 100%
downloading libast-0.6.1nb3.tgz: 100%
downloading eterm-0.9.4nb1.tgz: 100%
installing packages...
pkg_add: Warning: package `/home/imil/src/pkg_dry/cache/tiff-3.8.2nb4.tgz' was built for a different version of the OS:
pkg_add: NetBSD/i386 5.0_BETA (pkg) vs. NetBSD/i386 5.0_RC3 (this host)
pkg_add: Warning: package `/home/imil/src/pkg_dry/cache/jpeg-6bnb4.tgz' was built for a different version of the OS:
pkg_add: NetBSD/i386 5.0_BETA (pkg) vs. NetBSD/i386 5.0_RC3 (this host)
pkg_add: Warning: package `/home/imil/src/pkg_dry/cache/jpeg-6bnb4.tgz' was built for a different version of the OS:
pkg_add: NetBSD/i386 5.0_BETA (pkg) vs. NetBSD/i386 5.0_RC3 (this host)
pkg_add: other version 'jpeg-6bnb4' already installed
pkg_add: 1 package addition failed
pkg_add: Warning: package `/home/imil/src/pkg_dry/cache/imlib2-1.4.2nb1.tgz' was built for a different version of the OS:
pkg_add: NetBSD/i386 5.0_BETA (pkg) vs. NetBSD/i386 5.0_RC3 (this host)
pkg_add: Warning: package `/home/imil/src/pkg_dry/cache/libast-0.6.1nb3.tgz' was built for a different version of the OS:
pkg_add: NetBSD/i386 5.0_BETA (pkg) vs. NetBSD/i386 5.0_RC3 (this host)
pkg_add: Warning: package `/home/imil/src/pkg_dry/cache/eterm-0.9.4nb1.tgz' was built for a different version of the OS:
pkg_add: NetBSD/i386 5.0_BETA (pkg) vs. NetBSD/i386 5.0_RC3 (this host)
eterm-0.9.4nb1: setting permissions on /usr/pkg/bin/Eterm (o=root, g=wheel, m=4511)
processing local summary...
updating database: 100%
Desinstallation :
[~/src/pkg_dry] ./pkg_dry -r jpeg
5 packages to delete: eterm-0.9.4nb1 libast-0.6.1nb3 imlib2-1.4.2nb1 tiff-3.8.2nb4 jpeg
proceed ? [y/N] y
removing eterm-0.9.4nb1...
removing libast-0.6.1nb3...
removing imlib2-1.4.2nb1...
removing tiff-3.8.2nb4...
removing jpeg...
processing local summary...
updating database: 100%
Ça a l’air de rien comme ça, et c’est pas pour me lamenter, mais gérer les dépendances récursives et l’ordre de ces dernières pour pas que pkg_add(1) et surtout pkg_delete(1) ne gueulent, c’était pas une mince affaire.
En tout cas, ça prend forme. En réalité, l’upgrade doit également fonctionner, mais, à nouveau pour satisfaire les ancestraux outils sus-cités, il faudra un peu d’astuce.
Que reste-t-il à faire ? Evidemment, travailler sur une belle methode d’upgrade. Le moteur semble fonctionner, il faut le mettre en pratique désormais. Et puis quelques tests simples, verifier que ce qui est en REQUIRES pour un package est bien présent sur le systeme; à l’inverse renseigner PROVIDES (notez que ces derniers champs ne sont pas des dépendances en soi). Additionner les tailles de packages pour verifier que la machine dispose bien de l’éspace nécessaire, ajouter la possibilité de merger plusieurs repositories, gérer plusieurs packages passés à la ligne de commande, i.e. :
# pkg_dry -i foo bar baz
Et lorsque tout ceci sera prêt: tester !
J’en suis pas là, on ne s’enflamme pas comme dirait un ami qui se reconnaitra :)
Pour ceux que ça interesse, le code est visible ici et pour ceux que ça interesse encore plus, il est téléchargeable de cette façon :
cvs -d :pserver:anoncvs@cvs.gcu.info:/cvs login
passwd: anoncvs
cvs -d :pserver:anoncvs@cvs.gcu.info:/cvs co pkg_dry
Attention cependant, ce code est très mouvant, et ne nous attendez pas à quelque chose de vraiment utilisable avant.. pfiou je sais pas.
Sur ce, upgrade, à nous deux !
update (12 / 04 / 2009)
<spoil>
[~/src/pkg_dry] ./pkg_dry -i apache22
2 packages to be upgraded: apache-2.0.63nb4 apr-0.9.17.2.0.63nb1
2 packages to be installed: apr-1.3.3 apache-2.2.11
proceed ? [y/N] y
removing apache-2.0.63nb4...
Executing `/bin/rmdir /usr/pkg/libexec/cgi-bin 2>/dev/null || true'
===========================================================================
The following users are no longer being used by apache-2.0.63nb4,
and they can be removed if no other software is using them:
www
===========================================================================
===========================================================================
The following groups are no longer being used by apache-2.0.63nb4,
and they can be removed if no other software is using them:
www
===========================================================================
removing apr-0.9.17.2.0.63nb1...
downloading packages...
installing packages...
pkg_add: Warning: package `/home/imil/src/pkg_dry/cache/apr-1.3.3.tgz' was built for a different version of the OS:
pkg_add: NetBSD/i386 5.0_BETA (pkg) vs. NetBSD/i386 5.0_RC3 (this host)
pkg_add: Warning: package `/home/imil/src/pkg_dry/cache/apache-2.2.11.tgz' was built for a different version of the OS:
pkg_add: NetBSD/i386 5.0_BETA (pkg) vs. NetBSD/i386 5.0_RC3 (this host)
Executing '/bin/mkdir -p /usr/pkg/share/httpd/manual/style/xsl/util'
Executing '/bin/mkdir -p /usr/pkg/share/httpd/manual/style/xsl'
Executing '/bin/mkdir -p /usr/pkg/share/httpd/manual/style/lang'
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-autoindex.conf to /usr/pkg/etc/httpd/httpd-autoindex.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-dav.conf to /usr/pkg/etc/httpd/httpd-dav.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-default.conf to /usr/pkg/etc/httpd/httpd-default.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-info.conf to /usr/pkg/etc/httpd/httpd-info.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-languages.conf to /usr/pkg/etc/httpd/httpd-languages.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-manual.conf to /usr/pkg/etc/httpd/httpd-manual.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-mpm.conf to /usr/pkg/etc/httpd/httpd-mpm.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-multilang-errordoc.conf to /usr/pkg/etc/httpd/httpd-multilang-errordoc.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-ssl.conf to /usr/pkg/etc/httpd/httpd-ssl.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-userdir.conf to /usr/pkg/etc/httpd/httpd-userdir.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/extra/httpd-vhosts.conf to /usr/pkg/etc/httpd/httpd-vhosts.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/httpd.conf to /usr/pkg/etc/httpd/httpd.conf
apache-2.2.11: copying /usr/pkg/share/examples/httpd/magic to /usr/pkg/etc/httpd/magic
apache-2.2.11: copying /usr/pkg/share/examples/httpd/mime.types to /usr/pkg/etc/httpd/mime.types
===========================================================================
The following files should be created for apache-2.2.11:
/etc/rc.d/apache (m=0755)
[/usr/pkg/share/examples/rc.d/apache]
===========================================================================
processing local summary...
updating database: 100%
</spoil>
update (14/04/2009)
REQUIRES vs PROVIDES [done]
[~/src/pkg_dry] ./pkg_dry -i hal
/usr/X11R7/lib/libexpat.so.1, needed by hal-0.5.11nb23 is not present in this system.
/usr/X11R7/lib/libexpat.so.1, needed by policykit-0.9nb3 is not present in this system.
/usr/X11R7/lib/libexpat.so.1, needed by dbus-glib-0.76 is not present in this system.
required files are missing in this system.
ça approche, ça approche…
Recent Comments