libxbps: share code for removing pkg files in remove.c and purge.c.

A new function has been created, xbps_remove_pkg_files() that accepts
a dictionary internalized from files.plist and a key to remove
links, dirs, files and conf_files.

As result of this, now when purging a package those directories that
were used in configuration files will also be removed if they are empty.

Bump XBPS_RELVER to 20091207.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091207053006-egw65u6y1jcuraje
This commit is contained in:
Juan RP
2009-12-07 06:30:06 +01:00
parent f5744b0d3d
commit 972af411d1
3 changed files with 90 additions and 191 deletions

View File

@ -40,7 +40,7 @@
#include <archive_entry.h>
/* Current release version */
#define XBPS_RELVER "20091202"
#define XBPS_RELVER "20091207"
/* Default root PATH for xbps to store metadata info. */
#define XBPS_META_PATH "/var/db/xbps"
@ -186,6 +186,7 @@ void SYMEXPORT xbps_regpkgs_dictionary_release(void);
/* From lib/remove.c */
int SYMEXPORT xbps_remove_pkg(const char *, const char *, bool);
int SYMEXPORT xbps_remove_pkg_files(prop_dictionary_t, const char *);
/* From lib/remove_obsoletes.c */
int xbps_remove_obsoletes(prop_dictionary_t, prop_dictionary_t);