From 6c78f0d56007ae5bbbaf9f15f6399e6e2967dd76 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 14 Feb 2012 12:12:24 -0600 Subject: Update SIGPIPE signal handler comment Signed-off-by: Dan McGee --- lib/libalpm/dload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 414d5d76..ee95e8a7 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -436,8 +436,8 @@ static int curl_download_internal(struct dload_payload *payload, curl_easy_setopt(curl, CURLOPT_WRITEDATA, localf); - /* ignore any SIGPIPE signals- these may occur if our FTP socket dies or - * something along those lines. Store the old signal handler first. */ + /* Ignore any SIGPIPE signals. With libcurl, these shouldn't be happening, + * but better safe than sorry. Store the old signal handler first. */ mask_signal(SIGPIPE, SIG_IGN, &orig_sig_pipe); mask_signal(SIGINT, &inthandler, &orig_sig_int); -- cgit v1.2.3-24-g4f1b From 85712814cdbfa301e5827fafd6bfb8ac0886079c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 15 Feb 2012 15:40:01 -0600 Subject: Revert "Add -S --recursive operation" This reverts commit f3fa77bcf1d792971c314f8c0de255866e89f3f3 along with making other necessary changes to fully back this (mis)feature out until we can do it correctly. The quick summary here is this was not implemented correctly; provides are not fully taken into account in this logic, and making that happen exposes a lot of other flaws in this code that are covered up later on in the dependency resolving process by several other pieces of convoluted and conditional logic. Tests have been adjusted accordingly. Some test EXISTS conditions have been removed as we already know the package is installed locally, and we also are checking the VERSION condition anyway. With these two related revert commits, we do have some changes in test pass/fail results: * upgrade078.py: does not pass, this is due to --recursive getting removed for -U/-S operations after this commit. * sync302.py: the version checks have been disabled, so this test continues to pass but has been scaled back in scope. * sync303.py: now passes, was failing before. * sync304.py: still failing, was failing before. * sync305.py: now passes, was failing before. * sync306.py: still passes, was passing before. Signed-off-by: Dan McGee --- lib/libalpm/deps.c | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 89f6d691..0c0a054e 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -723,12 +723,6 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, return 0; } - if(handle->trans->flags & ALPM_TRANS_FLAG_RECURSE) { - /* removing local packages from the equation causes the entire dep chain to - * get pulled for each target- e.g., pactree -u output */ - localpkgs = NULL; - } - /* Create a copy of the packages list, so that it can be restored on error */ packages_copy = alpm_list_copy(*packages); @@ -781,29 +775,6 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_list_free(deps); } - if(handle->trans->flags & ALPM_TRANS_FLAG_NEEDED) { - /* remove any deps that were pulled that match installed version */ - /* odd loop syntax so we can modify the list as we iterate */ - i = *packages; - while(i) { - alpm_pkg_t *tpkg = i->data; - alpm_pkg_t *local = _alpm_db_get_pkgfromcache( - handle->db_local, tpkg->name); - if(local && _alpm_pkg_compare_versions(tpkg, local) == 0) { - /* with the NEEDED flag, packages up to date are not reinstalled */ - _alpm_log(handle, ALPM_LOG_DEBUG, - "not adding dep %s-%s as it is not needed, same version\n", - local->name, local->version); - j = i; - i = i->next; - *packages = alpm_list_remove_item(*packages, j); - free(j); - } else { - i = i->next; - } - } - } - if(ret != 0) { alpm_list_free(*packages); *packages = packages_copy; -- cgit v1.2.3-24-g4f1b From 4899b5bd864919830fe4ce5786d37a00ab5a0da3 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 19 Feb 2012 23:04:12 -0600 Subject: diskspace: ensure we match only full path components If one had a mountpoint at '/e' (don't ask), a file being installed to '/etc' would map to it incorrectly. Ensure we do more than just prefix matching on paths by doing some more sanity checks once the simple strncmp() call succeeds. Signed-off-by: Dan McGee --- lib/libalpm/diskspace.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index d0f52a63..45908b22 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -179,8 +179,20 @@ static alpm_mountpoint_t *match_mount_point(const alpm_list_t *mount_points, for(mp = mount_points; mp != NULL; mp = mp->next) { alpm_mountpoint_t *data = mp->data; + /* first, check if the prefix matches */ if(strncmp(data->mount_dir, real_path, data->mount_dir_len) == 0) { - return data; + /* now, the hard work- a file like '/etc/myconfig' shouldn't map to a + * mountpoint '/e', but only '/etc'. If the mountpoint ends in a trailing + * slash, we know we didn't have a mismatch, otherwise we have to do some + * more sanity checks. */ + if(data->mount_dir[data->mount_dir_len - 1] == '/') { + return data; + } else if(strlen(real_path) >= data->mount_dir_len) { + const char next = real_path[data->mount_dir_len]; + if(next == '/' || next == '\0') { + return data; + } + } } } -- cgit v1.2.3-24-g4f1b From 78adb71f20ee335dff49e34d33f04817a40002b6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 21 Dec 2011 16:42:47 -0600 Subject: Don't check diskspace when using --dbonly Mostly a waste of time. Sure, we no longer make sure your pacman database partition has enough space, but if you are using this option you better know what you are doing anyway. Signed-off-by: Dan McGee (cherry picked from commit ee969006056c86e88d5f179a7575d64f23d5b252) --- lib/libalpm/sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index a946a7df..185878aa 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -1137,7 +1137,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) } /* check available disk space */ - if(handle->checkspace) { + if(handle->checkspace && !(trans->flags & ALPM_TRANS_FLAG_DBONLY)) { EVENT(handle, ALPM_EVENT_DISKSPACE_START, NULL, NULL); _alpm_log(handle, ALPM_LOG_DEBUG, "checking available disk space\n"); -- cgit v1.2.3-24-g4f1b