summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorChantry Xavier <shiningxc@gmail.com>2007-11-04 20:53:34 +0100
committerDan McGee <dan@archlinux.org>2007-11-05 01:04:43 +0100
commit0686fec8399e01adacd1633d6ad624ee2d5b6d9c (patch)
tree3cf0459c4a86d61d476f5598396a09bde1bb1547 /lib/libalpm
parentb55abdce7aebb142ce79da3aa3645afe7693a3c4 (diff)
downloadpacman-0686fec8399e01adacd1633d6ad624ee2d5b6d9c.tar.gz
pacman-0686fec8399e01adacd1633d6ad624ee2d5b6d9c.tar.xz
Remove the newline automatically added by alpm_logaction.
This way, _alpm_logaction behaves like _alpm_log, and gives more control. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/add.c26
-rw-r--r--lib/libalpm/trans.c2
-rw-r--r--lib/libalpm/util.c5
3 files changed, 16 insertions, 17 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index a76f0266..277293f6 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -348,7 +348,7 @@ static int extract_single_file(struct archive *archive,
if(alpm_list_find_str(handle->noextract, entryname)) {
_alpm_log(PM_LOG_DEBUG, "%s is in NoExtract, skipping extraction\n",
entryname);
- alpm_logaction("note: %s is in NoExtract, skipping extraction",
+ alpm_logaction("note: %s is in NoExtract, skipping extraction\n",
entryname);
archive_read_data_skip(archive);
return(0);
@@ -397,7 +397,7 @@ static int extract_single_file(struct archive *archive,
"filesystem: %o package: %o\n"), entryname, lsbuf.st_mode & mask,
entrymode & mask);
alpm_logaction("warning: directory permissions differ on %s\n"
- "filesystem: %o package: %o", entryname, lsbuf.st_mode & mask,
+ "filesystem: %o package: %o\n", entryname, lsbuf.st_mode & mask,
entrymode & mask);
}
_alpm_log(PM_LOG_DEBUG, "extract: skipping dir extraction of %s\n",
@@ -482,7 +482,7 @@ static int extract_single_file(struct archive *archive,
} else if(ret != ARCHIVE_OK) {
_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)\n"),
entryname, archive_error_string(archive));
- alpm_logaction("error: could not extract %s (%s)",
+ alpm_logaction("error: could not extract %s (%s)\n",
entryname, archive_error_string(archive));
unlink(tempfile);
FREE(hash_orig);
@@ -532,19 +532,19 @@ static int extract_single_file(struct archive *archive,
if(rename(filename, newpath)) {
archive_entry_set_pathname(entry, filename);
_alpm_log(PM_LOG_ERROR, _("could not rename %s (%s)\n"), filename, strerror(errno));
- alpm_logaction("error: could not rename %s (%s)", filename, strerror(errno));
+ alpm_logaction("error: could not rename %s (%s)\n", filename, strerror(errno));
errors++;
} else {
/* copy the tempfile we extracted to the real path */
if(_alpm_copyfile(tempfile, filename)) {
archive_entry_set_pathname(entry, filename);
_alpm_log(PM_LOG_ERROR, _("could not copy tempfile to %s (%s)\n"), filename, strerror(errno));
- alpm_logaction("error: could not copy tempfile to %s (%s)", filename, strerror(errno));
+ alpm_logaction("error: could not copy tempfile to %s (%s)\n", filename, strerror(errno));
errors++;
} else {
archive_entry_set_pathname(entry, filename);
_alpm_log(PM_LOG_WARNING, _("%s saved as %s\n"), filename, newpath);
- alpm_logaction("warning: %s saved as %s", filename, newpath);
+ alpm_logaction("warning: %s saved as %s\n", filename, newpath);
}
}
}
@@ -583,10 +583,10 @@ static int extract_single_file(struct archive *archive,
snprintf(newpath, PATH_MAX, "%s.pacnew", filename);
if(_alpm_copyfile(tempfile, newpath)) {
_alpm_log(PM_LOG_ERROR, _("could not install %s as %s: %s\n"), filename, newpath, strerror(errno));
- alpm_logaction("error: could not install %s as %s: %s", filename, newpath, strerror(errno));
+ alpm_logaction("error: could not install %s as %s: %s\n", filename, newpath, strerror(errno));
} else {
_alpm_log(PM_LOG_WARNING, _("%s installed as %s\n"), filename, newpath);
- alpm_logaction("warning: %s installed as %s", filename, newpath);
+ alpm_logaction("warning: %s installed as %s\n", filename, newpath);
}
}
}
@@ -603,7 +603,7 @@ static int extract_single_file(struct archive *archive,
/* change the path to a .pacnew extension */
_alpm_log(PM_LOG_DEBUG, "%s is in NoUpgrade -- skipping\n", filename);
_alpm_log(PM_LOG_WARNING, _("extracting %s as %s.pacnew\n"), filename, filename);
- alpm_logaction("warning: extracting %s as %s.pacnew", filename, filename);
+ alpm_logaction("warning: extracting %s as %s.pacnew\n", filename, filename);
strncat(filename, ".pacnew", PATH_MAX - strlen(filename));
} else {
_alpm_log(PM_LOG_DEBUG, "extracting %s\n", filename);
@@ -626,7 +626,7 @@ static int extract_single_file(struct archive *archive,
} else if(ret != ARCHIVE_OK) {
_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)\n"),
entryname, archive_error_string(archive));
- alpm_logaction("error: could not extract %s (%s)",
+ alpm_logaction("error: could not extract %s (%s)\n",
entryname, archive_error_string(archive));
return(1);
}
@@ -793,12 +793,12 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
if(is_upgrade) {
_alpm_log(PM_LOG_ERROR, _("problem occurred while upgrading %s\n"),
newpkg->name);
- alpm_logaction("error: problem occurred while upgrading %s",
+ alpm_logaction("error: problem occurred while upgrading %s\n",
newpkg->name);
} else {
_alpm_log(PM_LOG_ERROR, _("problem occurred while installing %s\n"),
newpkg->name);
- alpm_logaction("error: problem occurred while installing %s",
+ alpm_logaction("error: problem occurred while installing %s\n",
newpkg->name);
}
}
@@ -817,7 +817,7 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
if(_alpm_db_write(db, newpkg, INFRQ_ALL)) {
_alpm_log(PM_LOG_ERROR, _("could not update database entry %s-%s\n"),
alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg));
- alpm_logaction("error: could not update database entry %s-%s",
+ alpm_logaction("error: could not update database entry %s-%s\n",
alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg));
RET_ERR(PM_ERR_DB_WRITE, -1);
}
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index a5033dee..a5fba845 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -214,7 +214,7 @@ int SYMEXPORT alpm_trans_release()
if(_alpm_lckrm()) {
_alpm_log(PM_LOG_WARNING, _("could not remove lock file %s\n"),
alpm_option_get_lockfile());
- alpm_logaction("warning: could not remove lock file %s",
+ alpm_logaction("warning: could not remove lock file %s\n",
alpm_option_get_lockfile());
}
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 5df3a025..8ca6350b 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -485,7 +485,6 @@ int _alpm_logaction(unsigned short usesyslog, FILE *f, const char *fmt, va_list
tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
tm->tm_hour, tm->tm_min);
ret = vfprintf(f, fmt, args);
- fprintf(f, "\n");
fflush(f);
}
@@ -574,7 +573,7 @@ const char *_alpm_filecache_setup(void)
/* cache directory does not exist.... try creating it */
_alpm_log(PM_LOG_WARNING, _("no %s cache exists, creating...\n"),
cachedir);
- alpm_logaction("warning: no %s cache exists, creating...",
+ alpm_logaction("warning: no %s cache exists, creating...\n",
cachedir);
if(_alpm_makepath(cachedir) == 0) {
_alpm_log(PM_LOG_DEBUG, "using cachedir: %s\n", cachedir);
@@ -593,7 +592,7 @@ const char *_alpm_filecache_setup(void)
alpm_option_set_cachedirs(tmp);
_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");
+ alpm_logaction("warning: couldn't create package cache, using /tmp instead\n");
return(alpm_list_getdata(tmp));
}