286 xmlFreeTextWriter(writer); |
287 xmlFreeTextWriter(writer); |
287 |
288 |
288 /* |
289 /* |
289 * Now write the XML recipes |
290 * Now write the XML recipes |
290 */ |
291 */ |
291 if (getenv((char *)"USER") == NULL) { |
292 mypath = xstrcpy(etcpath); |
292 mypath = xstrcpy((char *)"/root"); |
|
293 } else { |
|
294 mypath = xstrcpy(getenv((char *)"HOME")); |
|
295 } |
|
296 mypath = xstrcat(mypath, (char *)"/.brewco/etc/"); |
|
297 mkdirs(mypath, 0755); |
|
298 mypath = xstrcat(mypath, (char *)"recipes.xml"); |
293 mypath = xstrcat(mypath, (char *)"recipes.xml"); |
299 |
294 |
300 if (debug) |
295 if (debug) |
301 fprintf(stdout, "Writing %s\n", mypath); |
296 fprintf(stdout, "Writing %s\n", mypath); |
302 |
297 |
569 char *mypath; |
564 char *mypath; |
570 xmlDocPtr doc; |
565 xmlDocPtr doc; |
571 xmlNodePtr cur; |
566 xmlNodePtr cur; |
572 a_recipe *recipe; |
567 a_recipe *recipe; |
573 |
568 |
574 syslog(LOG_NOTICE, "HOME='%s' USER='%s' LOGNAME='%s'", MBSE_SS(getenv((char *)"HOME")), MBSE_SS(getenv((char *)"USER")), MBSE_SS(getenv((char *)"LOGNAME"))); |
|
575 |
|
576 /* |
569 /* |
577 * Search config file |
570 * Search config file |
578 */ |
571 */ |
579 if (getenv((char *)"USER") == NULL) { |
572 mypath = xstrcpy(etcpath); |
580 mypath = xstrcpy((char *)"/root"); |
|
581 } else { |
|
582 mypath = xstrcpy(getenv((char *)"HOME")); |
|
583 } |
|
584 mypath = xstrcat(mypath, (char *)"/.brewco/etc/"); |
|
585 mkdirs(mypath, 0755); |
|
586 mypath = xstrcat(mypath, (char *)"recipes.xml"); |
573 mypath = xstrcat(mypath, (char *)"recipes.xml"); |
587 |
574 |
588 /* |
575 /* |
589 * Free possible old recipes list |
576 * Free possible old recipes list |
590 */ |
577 */ |