summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-18 18:33:55 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-03-18 18:33:55 +0000
commitc0f681a0aeb251af27ed8dc2b7c3062855ab5f59 (patch)
tree10040f8a421fcad8e3c4ddc2366bfb66a9ed831a
parent7a01ed50b903f24ba44ce9bb9a591460b6a2be64 (diff)
One more sanity check, and one more ORE tag
-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));
}