From 5c9eec5570c145c07660bd2ba207b579eda0f26c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 23 Aug 2007 22:26:55 -0400 Subject: libalpm: add newlines to all strings passed to log callback This allows us to remove the hack in the frontend where we added a newline to everything coming out of the pm_printf functions, and instead let the developer put newlines where they want them. This should be the last hangover of that auto-newline stuff. Signed-off-by: Dan McGee --- lib/libalpm/util.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/libalpm/util.c') diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 9986b49c..b1c3a402 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -201,7 +201,7 @@ int _alpm_makepath(const char *path) if(mkdir(full, 0755)) { FREE(orig); umask(oldmask); - _alpm_log(PM_LOG_ERROR, _("failed to make path '%s' : %s"), + _alpm_log(PM_LOG_ERROR, _("failed to make path '%s' : %s\n"), path, strerror(errno)); return(1); } @@ -400,7 +400,8 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn) if(archive_read_open_filename(_archive, archive, ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) { - _alpm_log(PM_LOG_ERROR, _("could not open %s: %s\n"), archive, archive_error_string(_archive)); + _alpm_log(PM_LOG_ERROR, _("could not open %s: %s\n"), archive, + archive_error_string(_archive)); RET_ERR(PM_ERR_PKG_OPEN, -1); } @@ -561,7 +562,7 @@ char *_alpm_filecache_find(const char* filename) if(stat(path, &buf) == 0) { /* TODO maybe check to make sure it is readable? */ retpath = strdup(path); - _alpm_log(PM_LOG_DEBUG, "found cached pkg: %s", retpath); + _alpm_log(PM_LOG_DEBUG, "found cached pkg: %s\n", retpath); return(retpath); } } @@ -589,11 +590,11 @@ const char *_alpm_filecache_setup(void) alpm_logaction("warning: no %s cache exists, creating...", cachedir); if(_alpm_makepath(cachedir) == 0) { - _alpm_log(PM_LOG_DEBUG, "using cachedir: %s", cachedir); + _alpm_log(PM_LOG_DEBUG, "using cachedir: %s\n", cachedir); return(cachedir); } } else if(S_ISDIR(buf.st_mode) && (buf.st_mode & S_IWUSR)) { - _alpm_log(PM_LOG_DEBUG, "using cachedir: %s", cachedir); + _alpm_log(PM_LOG_DEBUG, "using cachedir: %s\n", cachedir); return(cachedir); } } @@ -603,8 +604,8 @@ const char *_alpm_filecache_setup(void) tmp = alpm_list_add(NULL, strdup("/tmp/")); FREELIST(i); alpm_option_set_cachedirs(tmp); - _alpm_log(PM_LOG_DEBUG, "using cachedir: %s", "/tmp/"); - _alpm_log(PM_LOG_WARNING, _("couldn't create package cache, using /tmp instead")); + _alpm_log(PM_LOG_DEBUG, "using cachedir: %s", "/tmp/\n"); + _alpm_log(PM_LOG_WARNING, _("couldn't create package cache, using /tmp instead\n")); alpm_logaction("warning: couldn't create package cache, using /tmp instead"); return(alpm_list_getdata(tmp)); } @@ -645,7 +646,7 @@ char SYMEXPORT *alpm_get_md5sum(const char *filename) } md5sum[32] = '\0'; - _alpm_log(PM_LOG_DEBUG, "md5(%s) = %s", filename, md5sum); + _alpm_log(PM_LOG_DEBUG, "md5(%s) = %s\n", filename, md5sum); return(md5sum); } -- cgit v1.2.3-24-g4f1b