Paquets finaux sur archlinux le retour
Suite au passage à pacman 3.1, le format de la base des paquets à changé légèrement, il n'y a plus de required dans le fichier depends, mon précédent script ne fonctionne donc plus. En revanche, j'avais un bout de C utilisant la libalpm (bout de code fournit pas mimas ici ). Bien sûr entre temps la libalpm a évoluée depuis et ce code ne passe pas tel quel, en revanche quelques petite modifications plus tard et tout refonctionne.
#include <stdio.h> #include <stdlib.h> #include <alpm.h> #include <alpm_list.h> int main(int argc, char** argv) { alpm_list_t *i; pmpkg_t *pkg = NULL; pmdb_t *db_local = NULL; if (alpm_initialize() == -1) { puts ("Erreur: alpm_initialize()"); return 1; } alpm_option_set_root("/"); alpm_option_set_dbpath("/var/lib/pacman"); db_local = alpm_db_register_local(); if (db_local == NULL) { puts ("Erreur: alpm_db_register"); alpm_release(); return 1; } for (i = alpm_db_getpkgcache(db_local); i ; i = alpm_list_next(i)) { pkg = alpm_list_getdata(i); if ( alpm_list_count(alpm_pkg_compute_requiredby(pkg)) == 0 ) { printf("%s\n", alpm_pkg_get_name(pkg)); } } alpm_release(); return 0; }