Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=setup/.git;a=commitdiff;h=5b38a43686652dd7b0902d5ef180af6ab97fe2ac

commit 5b38a43686652dd7b0902d5ef180af6ab97fe2ac
Author: VMiklos <[EMAIL PROTECTED]>
Date:   Sun Jul 15 02:26:13 2007 +0200

use the new LOG() and get rid of g_strdup_printfs

diff --git a/src/plugins/select.c b/src/plugins/select.c
index 3db5c8c..a6b95f4 100644
--- a/src/plugins/select.c
+++ b/src/plugins/select.c
@@ -404,7 +404,6 @@ int fw_select(GList **config, int selpkgc, GList *syncs)
int i, j;
GList *cats=NULL;
GList *allpkgs=NULL;
-       char *ptr2;
PM_LIST *x;

dialog_vars.backtitle=gen_backtitle(_("Selecting packages"));
@@ -455,20 +454,16 @@ int fw_select(GList **config, int selpkgc, GList *syncs)
dialog_msgbox(_("Please wait"), _("Searching for missing dependencies..."),
0, 0, 0);
if(pacman_trans_prepare(&junk) == -1) {
-                       ptr2 = g_strdup_printf("pacman-g2 error: %s", 
pacman_strerror(pm_errno));
-                       LOG(ptr2);
-                       free(ptr2);
+                       LOG("pacman-g2 error: %s", pacman_strerror(pm_errno));

/* Well well well, LOG pacman deps error at tty4 */
for(x = pacman_list_first(junk); x; x = pacman_list_next(x))
{
PM_DEPMISS *miss = pacman_list_getdata(x);
-                               ptr2 = g_strdup_printf(":: %s: %s %s",
+                               LOG(":: %s: %s %s",
(char*)pacman_dep_getinfo(miss, PM_DEP_TARGET),
(long)pacman_dep_getinfo(miss, PM_DEP_TYPE) == PM_DEP_TYPE_DEPEND ? "requires" 
: "is required by",
(char*)pacman_dep_getinfo(miss, PM_DEP_NAME));
-                               LOG(ptr2);
-                               free(ptr2);
}
pacman_list_free(junk);
pacman_trans_release();
diff --git a/src/util.c b/src/util.c
index 79fabd3..baf8d27 100644
--- a/src/util.c
+++ b/src/util.c
@@ -673,8 +673,5 @@ int setup_log(char *file, int line, char *fmt, ...)

void cb_log(unsigned short level, char *msg)
{
-       char str[PATH_MAX];
-
-       snprintf(str, PATH_MAX, "[libpacman] %s", msg);
-       LOG(str);
+       LOG("[libpacman, level %d] %s", level, msg);
}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to