summaryrefslogtreecommitdiffstats
path: root/src/pacman/query.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-12-09 06:42:04 +0100
committerDan McGee <dan@archlinux.org>2007-12-09 18:33:08 +0100
commit7249c08bdf6beacc087607db558ef16d3527b9b6 (patch)
tree4083daddba67c0864d2b6dce5c9b4587caa94b65 /src/pacman/query.c
parent815a2ead3ef2b8daedb9e93e5e141356d5003e6e (diff)
downloadpacman-7249c08bdf6beacc087607db558ef16d3527b9b6.tar.gz
pacman-7249c08bdf6beacc087607db558ef16d3527b9b6.tar.xz
Improve changelog handling through addition of open/read/close functions
Thanks to Allan for inspiring all this work on what was one little TODO item in the codebase. :) Change changelog handling so we can now dump a changelog from both installed packages and package files (fixes FS#7371). We do this by moving all of the machinery to the backend where it should have been in the first place. The changelog reading is now done through a open/read/close interface similar to the fopen/fread/fclose functions (can you guess how it is done?). It is buffered by the frontend, so programs using the library can read as much or as little as they want at a time. Unfortunately, I could not implement a changelog_feof function due to some shortcomings of libarchive. However, I left the stub code in there, commented out, in case it becomes possible later or anyone wants to take a stab at it. Original-work-by: Allan McRae <mcrae_allan@hotmail.com> Improved-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/query.c')
-rw-r--r--src/pacman/query.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index 8a8765b6..13070772 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -312,14 +312,7 @@ static void display(pmpkg_t *pkg)
dump_pkg_files(pkg);
}
if(config->op_q_changelog) {
- char changelog[PATH_MAX];
- /* TODO should be done in the backend- no raw DB stuff up front */
- snprintf(changelog, PATH_MAX, "%s/%s/%s-%s/changelog",
- alpm_option_get_dbpath(),
- alpm_db_get_name(db_local),
- alpm_pkg_get_name(pkg),
- alpm_pkg_get_version(pkg));
- dump_pkg_changelog(changelog, alpm_pkg_get_name(pkg));
+ dump_pkg_changelog(pkg);
}
if(!config->op_q_info && !config->op_q_list && !config->op_q_changelog) {
if (!config->quiet) {