[pacman-dev] [PATCH] Turn libarchive warnings into libalpm warnings

Dan McGee dan at archlinux.org
Fri Oct 31 23:49:46 EDT 2008


Rather than hiding these warnings, show them to the user as they happen.
This will prevent things such as hiding full filesystem errors (ENOSPC) from
the user as seen in FS#11639.

Signed-off-by: Dan McGee <dan at archlinux.org>
---

Note: this patch is almost superseded by the next one, but its important to
note we are suddenly going to put more force behind these libarchive warnings.

 lib/libalpm/add.c  |    4 ++--
 lib/libalpm/util.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 5040589..f4caa5c 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -444,7 +444,7 @@ static int extract_single_file(struct archive *archive,
 		ret = archive_read_extract(archive, entry, archive_flags);
 		if(ret == ARCHIVE_WARN) {
 			/* operation succeeded but a non-critical error was encountered */
-			_alpm_log(PM_LOG_DEBUG, "warning extracting %s (%s)\n",
+			_alpm_log(PM_LOG_WARNING, "warning extracting %s (%s)\n",
 					entryname_orig, archive_error_string(archive));
 		} else if(ret != ARCHIVE_OK) {
 			_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)\n"),
@@ -594,7 +594,7 @@ static int extract_single_file(struct archive *archive,
 		ret = archive_read_extract(archive, entry, archive_flags);
 		if(ret == ARCHIVE_WARN) {
 			/* operation succeeded but a non-critical error was encountered */
-			_alpm_log(PM_LOG_DEBUG, "warning extracting %s (%s)\n",
+			_alpm_log(PM_LOG_WARNING, "warning extracting %s (%s)\n",
 					entryname_orig, archive_error_string(archive));
 		} else if(ret != ARCHIVE_OK) {
 			_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)\n"),
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index da3463b..a9330d3 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -333,7 +333,7 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
 		int readret = archive_read_extract(_archive, entry, 0);
 		if(readret == ARCHIVE_WARN) {
 			/* operation succeeded but a non-critical error was encountered */
-			_alpm_log(PM_LOG_DEBUG, "warning extracting %s (%s)\n",
+			_alpm_log(PM_LOG_WARNING, "warning extracting %s (%s)\n",
 					entryname, archive_error_string(_archive));
 		} else if(readret != ARCHIVE_OK) {
 			_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)\n"),
-- 
1.6.0.3




More information about the pacman-dev mailing list