summaryrefslogtreecommitdiff
path: root/lib/libalpm/alpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/alpm.c')
-rw-r--r--lib/libalpm/alpm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 8dc8f0b1..58b7d04d 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -212,6 +212,7 @@ int alpm_db_update(char *treename, char *archive)
ASSERT(treename != NULL && strlen(treename) != 0, RET_ERR(PM_ERR_WRONG_ARGS, -1));
/* ORE
+ Does it make sense to update the 'local' database, or should we prevent it?
stat(archive); */
return(db_update(handle->root, handle->dbpath, treename, archive));
@@ -535,10 +536,26 @@ int alpm_logaction(char *fmt, ...)
char str[LOG_STR_LEN];
va_list args;
+ /* Sanity checks */
+ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
+
va_start(args, fmt);
vsnprintf(str, LOG_STR_LEN, fmt, args);
va_end(args);
+ /* ORE
+ We should add a prefix to log strings depending on who called us.
+ If logaction was called by the frontend:
+ USER: <the frontend log>
+ and if called internally:
+ ALPM: <the library log>
+ Moreover, the frontend should be able to choose its prefix (USER by default?):
+ pacman: "PACMAN"
+ kpacman: "KPACMAN"
+ ...
+ It allows to share the log file between several frontends and to actually
+ know who does what */
+
return(_alpm_log_action(handle->usesyslog, handle->logfd, str));
}