From 2f4ee4341d1f97d95a99147556888212d1cd4507 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Sat, 10 Oct 2009 03:11:27 +1000 Subject: Only extract new DB entries This implements FS#15198. The idea apparently came from Csaba Henk creo.hu> which submitted a patch to Frugalware, so thanks to him, even though I did not look at the code :) The idea is to only extract folders for new packages into the package database and clean up the old directories. This is essentially implementing Xyne's "rebase" script within pacman. If using -Syy, just remove and extract everything. If using -Sy : 1. Generate list of directories in DB 2. Generate list of directories in archive 3. Compare both 4. Clean up old directories 5. Extract new directories Original-work-by: Allan McRae Signed-off-by: Xavier Chantry [Dan: fix compile error, s/int/size_t/] Signed-off-by: Dan McGee --- lib/libalpm/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/util.c') diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 27e861e4..d290e71c 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -333,12 +333,13 @@ int _alpm_unpack(const char *archive, const char *prefix, alpm_list_t *list, int char *found = alpm_list_find_str(list, prefix); free(prefix); if(!found) { - _alpm_log(PM_LOG_DEBUG, "skipping: %s\n", entryname); if (archive_read_data_skip(_archive) != ARCHIVE_OK) { ret = 1; goto cleanup; } continue; + } else { + _alpm_log(PM_LOG_DEBUG, "extracting: %s\n", entryname); } } -- cgit v1.2.3-54-g00ecf