diff options
author | Dan McGee <dan@archlinux.org> | 2011-06-16 13:16:49 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-07-03 14:29:30 -0500 |
commit | 6a6fc3107f477e579b0dd21553d48e073e3efdf4 (patch) | |
tree | a7c5ad4c723f7d2ceea76ebc7ff8214257ae8fe5 /src/pacman | |
parent | a2995f586e492e0d2cb85e7e9ebb5f3857891465 (diff) |
Move alpm filelists to a struct object
This allows us to capture size and mode data when building filelists
from package files. Future patches will take advantage of this newly
available information, and frontends can use it as well.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman')
-rw-r--r-- | src/pacman/package.c | 8 | ||||
-rw-r--r-- | src/pacman/query.c | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c index 6b480873..c394bf9a 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -218,7 +218,7 @@ void dump_pkg_backups(alpm_pkg_t *pkg) */ void dump_pkg_files(alpm_pkg_t *pkg, int quiet) { - const char *pkgname, *root, *filestr; + const char *pkgname, *root; alpm_list_t *i, *pkgfiles; pkgname = alpm_pkg_get_name(pkg); @@ -226,11 +226,11 @@ void dump_pkg_files(alpm_pkg_t *pkg, int quiet) root = alpm_option_get_root(config->handle); for(i = pkgfiles; i; i = alpm_list_next(i)) { - filestr = alpm_list_getdata(i); + const alpm_file_t *file = alpm_list_getdata(i); if(!quiet){ - fprintf(stdout, "%s %s%s\n", pkgname, root, filestr); + fprintf(stdout, "%s %s%s\n", pkgname, root, file->name); } else { - fprintf(stdout, "%s%s\n", root, filestr); + fprintf(stdout, "%s%s\n", root, file->name); } } diff --git a/src/pacman/query.c b/src/pacman/query.c index 826c2262..1547c247 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -193,7 +193,8 @@ static int query_fileowner(alpm_list_t *targets) for(j = alpm_pkg_get_files(info); j && !found; j = alpm_list_next(j)) { char *ppath, *pdname; - const char *pkgfile = alpm_list_getdata(j); + const alpm_file_t *file = alpm_list_getdata(j); + const char *pkgfile = file->name; /* avoid the costly resolve_path usage if the basenames don't match */ if(strcmp(mbasename(pkgfile), bname) != 0) { @@ -416,7 +417,8 @@ static int check(alpm_pkg_t *pkg) const char *pkgname = alpm_pkg_get_name(pkg); for(i = alpm_pkg_get_files(pkg); i; i = alpm_list_next(i)) { struct stat st; - const char *path = alpm_list_getdata(i); + const alpm_file_t *file = alpm_list_getdata(i); + const char *path = file->name; if(rootlen + 1 + strlen(path) > PATH_MAX) { pm_fprintf(stderr, PM_LOG_WARNING, _("path too long: %s%s\n"), root, path); |