index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | src/pacman/conf.c | 108 | ||||
-rw-r--r-- | src/pacman/database.c | 6 | ||||
-rw-r--r-- | src/pacman/package.c | 4 | ||||
-rw-r--r-- | src/pacman/pacman.c | 24 | ||||
-rw-r--r-- | src/pacman/query.c | 28 | ||||
-rw-r--r-- | src/pacman/remove.c | 14 | ||||
-rw-r--r-- | src/pacman/sync.c | 46 | ||||
-rw-r--r-- | src/pacman/upgrade.c | 12 | ||||
-rw-r--r-- | src/pacman/util.c | 24 | ||||
-rw-r--r-- | src/util/cleanupdelta.c | 6 | ||||
-rw-r--r-- | src/util/testdb.c | 4 | ||||
-rw-r--r-- | src/util/testpkg.c | 4 |
diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 50b4988f..838f8e94 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -43,14 +43,14 @@ config_t *config_new(void) { config_t *newconfig = calloc(1, sizeof(config_t)); if(!newconfig) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("malloc failure: could not allocate %zd bytes\n"), sizeof(config_t)); return NULL; } /* defaults which may get overridden later */ newconfig->op = PM_OP_MAIN; - newconfig->logmask = PM_LOG_ERROR | PM_LOG_WARNING; + newconfig->logmask = ALPM_LOG_ERROR | ALPM_LOG_WARNING; newconfig->configfile = strdup(CONFFILE); newconfig->sigverify = PM_PGP_VERIFY_UNKNOWN; @@ -159,27 +159,27 @@ static int download_with_xfercommand(const char *url, const char *localpath, /* save the cwd so we can restore it later */ if(getcwd(cwd, PATH_MAX) == NULL) { - pm_printf(PM_LOG_ERROR, _("could not get current working directory\n")); + pm_printf(ALPM_LOG_ERROR, _("could not get current working directory\n")); } else { restore_cwd = 1; } /* cwd to the download directory */ if(chdir(localpath)) { - pm_printf(PM_LOG_WARNING, _("could not chdir to download directory %s\n"), localpath); + pm_printf(ALPM_LOG_WARNING, _("could not chdir to download directory %s\n"), localpath); ret = -1; goto cleanup; } /* execute the parsed command via /bin/sh -c */ - pm_printf(PM_LOG_DEBUG, "running command: %s\n", parsedcmd); + pm_printf(ALPM_LOG_DEBUG, "running command: %s\n", parsedcmd); retval = system(parsedcmd); if(retval == -1) { - pm_printf(PM_LOG_WARNING, _("running XferCommand: fork failed!\n")); + pm_printf(ALPM_LOG_WARNING, _("running XferCommand: fork failed!\n")); ret = -1; } else if(retval != 0) { /* download failed */ - pm_printf(PM_LOG_DEBUG, "XferCommand command returned non-zero status " + pm_printf(ALPM_LOG_DEBUG, "XferCommand command returned non-zero status " "code (%d)\n", retval); ret = -1; } else { @@ -193,7 +193,7 @@ static int download_with_xfercommand(const char *url, const char *localpath, cleanup: /* restore the old cwd if we have it */ if(restore_cwd && chdir(cwd) != 0) { - pm_printf(PM_LOG_ERROR, _("could not change directory to %s (%s)\n"), + pm_printf(ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"), cwd, strerror(errno)); } @@ -218,7 +218,7 @@ int config_set_arch(const char *arch) } else { config->arch = strdup(arch); } - pm_printf(PM_LOG_DEBUG, "config: arch: %s\n", config->arch); + pm_printf(ALPM_LOG_DEBUG, "config: arch: %s\n", config->arch); return 0; } @@ -234,7 +234,7 @@ static pgp_verify_t option_verifysig(const char *value) } else { level = PM_PGP_VERIFY_UNKNOWN; } - pm_printf(PM_LOG_DEBUG, "config: VerifySig = %s (%d)\n", value, level); + pm_printf(ALPM_LOG_DEBUG, "config: VerifySig = %s (%d)\n", value, level); return level; } @@ -247,7 +247,7 @@ static int process_cleanmethods(alpm_list_t *values) { } else if(strcmp(value, "KeepCurrent") == 0) { config->cleanmethod |= PM_CLEAN_KEEPCUR; } else { - pm_printf(PM_LOG_ERROR, _("invalid value for 'CleanMethod' : '%s'\n"), + pm_printf(ALPM_LOG_ERROR, _("invalid value for 'CleanMethod' : '%s'\n"), value); return 1; } @@ -270,12 +270,12 @@ static void setrepeatingoption(char *ptr, const char *option, while((q = strchr(ptr, ' '))) { *q = '\0'; *list = alpm_list_add(*list, strdup(ptr)); - pm_printf(PM_LOG_DEBUG, "config: %s: %s\n", option, ptr); + pm_printf(ALPM_LOG_DEBUG, "config: %s: %s\n", option, ptr); ptr = q; ptr++; } *list = alpm_list_add(*list, strdup(ptr)); - pm_printf(PM_LOG_DEBUG, "config: %s: %s\n", option, ptr); + pm_printf(ALPM_LOG_DEBUG, "config: %s: %s\n", option, ptr); } static int _parse_options(const char *key, char *value, @@ -285,23 +285,23 @@ static int _parse_options(const char *key, char *value, /* options without settings */ if(strcmp(key, "UseSyslog") == 0) { config->usesyslog = 1; - pm_printf(PM_LOG_DEBUG, "config: usesyslog\n"); + pm_printf(ALPM_LOG_DEBUG, "config: usesyslog\n"); } else if(strcmp(key, "ILoveCandy") == 0) { config->chomp = 1; - pm_printf(PM_LOG_DEBUG, "config: chomp\n"); + pm_printf(ALPM_LOG_DEBUG, "config: chomp\n"); } else if(strcmp(key, "VerbosePkgLists") == 0) { config->verbosepkglists = 1; - pm_printf(PM_LOG_DEBUG, "config: verbosepkglists\n"); + pm_printf(ALPM_LOG_DEBUG, "config: verbosepkglists\n"); } else if(strcmp(key, "UseDelta") == 0) { config->usedelta = 1; - pm_printf(PM_LOG_DEBUG, "config: usedelta\n"); + pm_printf(ALPM_LOG_DEBUG, "config: usedelta\n"); } else if(strcmp(key, "TotalDownload") == 0) { config->totaldownload = 1; - pm_printf(PM_LOG_DEBUG, "config: totaldownload\n"); + pm_printf(ALPM_LOG_DEBUG, "config: totaldownload\n"); } else if(strcmp(key, "CheckSpace") == 0) { config->checkspace = 1; } else { - pm_printf(PM_LOG_WARNING, + pm_printf(ALPM_LOG_WARNING, _("config file %s, line %d: directive '%s' in section '%s' not recognized.\n"), file, linenum, key, "options"); } @@ -329,27 +329,27 @@ static int _parse_options(const char *key, char *value, /* don't overwrite a path specified on the command line */ if(!config->dbpath) { config->dbpath = strdup(value); - pm_printf(PM_LOG_DEBUG, "config: dbpath: %s\n", value); + pm_printf(ALPM_LOG_DEBUG, "config: dbpath: %s\n", value); } } else if(strcmp(key, "RootDir") == 0) { /* don't overwrite a path specified on the command line */ if(!config->rootdir) { config->rootdir = strdup(value); - pm_printf(PM_LOG_DEBUG, "config: rootdir: %s\n", value); + pm_printf(ALPM_LOG_DEBUG, "config: rootdir: %s\n", value); } } else if(strcmp(key, "GPGDir") == 0) { if(!config->gpgdir) { config->gpgdir = strdup(value); - pm_printf(PM_LOG_DEBUG, "config: gpgdir: %s\n", value); + pm_printf(ALPM_LOG_DEBUG, "config: gpgdir: %s\n", value); } } else if(strcmp(key, "LogFile") == 0) { if(!config->logfile) { config->logfile = strdup(value); - pm_printf(PM_LOG_DEBUG, "config: logfile: %s\n", value); + pm_printf(ALPM_LOG_DEBUG, "config: logfile: %s\n", value); } } else if(strcmp(key, "XferCommand") == 0) { config->xfercommand = strdup(value); - pm_printf(PM_LOG_DEBUG, "config: xfercommand: %s\n", value); + pm_printf(ALPM_LOG_DEBUG, "config: xfercommand: %s\n", value); } else if(strcmp(key, "CleanMethod") == 0) { alpm_list_t *methods = NULL; setrepeatingoption(value, "CleanMethod", &methods); @@ -363,13 +363,13 @@ static int _parse_options(const char *key, char *value, if(level != PM_PGP_VERIFY_UNKNOWN) { config->sigverify = level; } else { - pm_printf(PM_LOG_ERROR, + pm_printf(ALPM_LOG_ERROR, _("config file %s, line %d: directive '%s' has invalid value '%s'\n"), file, linenum, key, value); return 1; } } else { - pm_printf(PM_LOG_WARNING, + pm_printf(ALPM_LOG_WARNING, _("config file %s, line %d: directive '%s' in section '%s' not recognized.\n"), file, linenum, key, "options"); } @@ -392,7 +392,7 @@ static int _add_mirror(alpm_db_t *db, char *value) } else { if(strstr(temp, "$arch")) { free(temp); - pm_printf(PM_LOG_ERROR, _("The mirror '%s' contains the $arch" + pm_printf(ALPM_LOG_ERROR, _("The mirror '%s' contains the $arch" " variable, but no Architecture is defined.\n"), value); return 1; } @@ -401,7 +401,7 @@ static int _add_mirror(alpm_db_t *db, char *value) if(alpm_db_add_server(db, server) != 0) { /* pm_errno is set by alpm_db_setserver */ - pm_printf(PM_LOG_ERROR, _("could not add server URL to database '%s': %s (%s)\n"), + pm_printf(ALPM_LOG_ERROR, _("could not add server URL to database '%s': %s (%s)\n"), dbname, server, alpm_strerror(alpm_errno(config->handle))); free(server); return 1; @@ -423,7 +423,7 @@ static int setup_libalpm(void) enum _alpm_errno_t err; alpm_handle_t *handle; - pm_printf(PM_LOG_DEBUG, "setup_libalpm called\n"); + pm_printf(ALPM_LOG_DEBUG, "setup_libalpm called\n"); /* Configure root path first. If it is set and dbpath/logfile were not * set, then set those as well to reside under the root. */ @@ -447,10 +447,10 @@ static int setup_libalpm(void) /* initialize library */ handle = alpm_initialize(config->rootdir, config->dbpath, &err); if(!handle) { - pm_printf(PM_LOG_ERROR, _("failed to initialize alpm library (%s)\n"), + pm_printf(ALPM_LOG_ERROR, _("failed to initialize alpm library (%s)\n"), alpm_strerror(err)); if(err == PM_ERR_DB_VERSION) { - pm_printf(PM_LOG_ERROR, _(" try running pacman-db-upgrade\n")); + pm_printf(ALPM_LOG_ERROR, _(" try running pacman-db-upgrade\n")); } return -1; } @@ -462,7 +462,7 @@ static int setup_libalpm(void) config->logfile = config->logfile ? config->logfile : strdup(LOGFILE); ret = alpm_option_set_logfile(handle, config->logfile); if(ret != 0) { - pm_printf(PM_LOG_ERROR, _("problem setting logfile '%s' (%s)\n"), + pm_printf(ALPM_LOG_ERROR, _("problem setting logfile '%s' (%s)\n"), config->logfile, alpm_strerror(alpm_errno(handle))); return ret; } @@ -472,7 +472,7 @@ static int setup_libalpm(void) config->gpgdir = config->gpgdir ? config->gpgdir : strdup(GPGDIR); ret = alpm_option_set_gpgdir(handle, config->gpgdir); if(ret != 0) { - pm_printf(PM_LOG_ERROR, _("problem setting gpgdir '%s' (%s)\n"), + pm_printf(ALPM_LOG_ERROR, _("problem setting gpgdir '%s' (%s)\n"), config->gpgdir, alpm_strerror(alpm_errno(handle))); return ret; } @@ -537,7 +537,7 @@ static int finish_section(struct section_t *section, int parse_options) alpm_list_t *i; alpm_db_t *db; - pm_printf(PM_LOG_DEBUG, "config: finish section '%s'\n", section->name); + pm_printf(ALPM_LOG_DEBUG, "config: finish section '%s'\n", section->name); /* parsing options (or nothing)- nothing to do except free the pieces */ if(!section->name || parse_options || section->is_options) { @@ -547,7 +547,7 @@ static int finish_section(struct section_t *section, int parse_options) /* if we are not looking at options sections only, register a db */ db = alpm_db_register_sync(config->handle, section->name, section->sigverify); if(db == NULL) { - pm_printf(PM_LOG_ERROR, _("could not register '%s' database (%s)\n"), + pm_printf(ALPM_LOG_ERROR, _("could not register '%s' database (%s)\n"), section->name, alpm_strerror(alpm_errno(config->handle))); ret = 1; goto cleanup; @@ -556,7 +556,7 @@ static int finish_section(struct section_t *section, int parse_options) for(i = section->servers; i; i = alpm_list_next(i)) { char *value = alpm_list_getdata(i); if(_add_mirror(db, value) != 0) { - pm_printf(PM_LOG_ERROR, + pm_printf(ALPM_LOG_ERROR, _("could not add mirror '%s' to database '%s' (%s)\n"), value, section->name, alpm_strerror(alpm_errno(config->handle))); ret = 1; @@ -595,16 +595,16 @@ static int _parseconfig(const char *file, struct section_t *section, const int max_depth = 10; if(depth >= max_depth) { - pm_printf(PM_LOG_ERROR, + pm_printf(ALPM_LOG_ERROR, _("config parsing exceeded max recursion depth of %d.\n"), max_depth); ret = 1; goto cleanup; } - pm_printf(PM_LOG_DEBUG, "config: attempting to read file %s\n", file); + pm_printf(ALPM_LOG_DEBUG, "config: attempting to read file %s\n", file); fp = fopen(file, "r"); if(fp == NULL) { - pm_printf(PM_LOG_ERROR, _("config file %s could not be read.\n"), file); + pm_printf(ALPM_LOG_ERROR, _("config file %s could not be read.\n"), file); ret = 1; goto cleanup; } @@ -629,7 +629,7 @@ static int _parseconfig(const char *file, struct section_t *section, char *name; /* only possibility here is a line == '[]' */ if(line_len <= 2) { - pm_printf(PM_LOG_ERROR, _("config file %s, line %d: bad section name.\n"), + pm_printf(ALPM_LOG_ERROR, _("config file %s, line %d: bad section name.\n"), file, linenum); ret = 1; goto cleanup; @@ -642,7 +642,7 @@ static int _parseconfig(const char *file, struct section_t *section, ret = 1; goto cleanup; } - pm_printf(PM_LOG_DEBUG, "config: new section '%s'\n", name); + pm_printf(ALPM_LOG_DEBUG, "config: new section '%s'\n", name); section->name = name; section->is_options = (strcmp(name, "options") == 0); continue; @@ -657,14 +657,14 @@ static int _parseconfig(const char *file, struct section_t *section, strtrim(value); if(key == NULL) { - pm_printf(PM_LOG_ERROR, _("config file %s, line %d: syntax error in config file- missing key.\n"), + pm_printf(ALPM_LOG_ERROR, _("config file %s, line %d: syntax error in config file- missing key.\n"), file, linenum); ret = 1; goto cleanup; } /* For each directive, compare to the camelcase string. */ if(section->name == NULL) { - pm_printf(PM_LOG_ERROR, _("config file %s, line %d: All directives must belong to a section.\n"), + pm_printf(ALPM_LOG_ERROR, _("config file %s, line %d: All directives must belong to a section.\n"), file, linenum); ret = 1; goto cleanup; @@ -676,7 +676,7 @@ static int _parseconfig(const char *file, struct section_t *section, size_t gindex; if(value == NULL) { - pm_printf(PM_LOG_ERROR, _("config file %s, line %d: directive '%s' needs a value\n"), + pm_printf(ALPM_LOG_ERROR, _("config file %s, line %d: directive '%s' needs a value\n"), file, linenum, key); ret = 1; goto cleanup; @@ -685,23 +685,23 @@ static int _parseconfig(const char *file, struct section_t *section, globret = glob(value, GLOB_NOCHECK, NULL, &globbuf); switch(globret) { case GLOB_NOSPACE: - pm_printf(PM_LOG_DEBUG, + pm_printf(ALPM_LOG_DEBUG, "config file %s, line %d: include globbing out of space\n", file, linenum); break; case GLOB_ABORTED: - pm_printf(PM_LOG_DEBUG, + pm_printf(ALPM_LOG_DEBUG, "config file %s, line %d: include globbing read error for %s\n", file, linenum, value); break; case GLOB_NOMATCH: - pm_printf(PM_LOG_DEBUG, + pm_printf(ALPM_LOG_DEBUG, "config file %s, line %d: no include found for %s\n", file, linenum, value); break; default: for(gindex = 0; gindex < globbuf.gl_pathc; gindex++) { - pm_printf(PM_LOG_DEBUG, "config file %s, line %d: including %s\n", + pm_printf(ALPM_LOG_DEBUG, "config file %s, line %d: including %s\n", file, linenum, globbuf.gl_pathv[gindex]); _parseconfig(globbuf.gl_pathv[gindex], section, parse_options, depth + 1); } @@ -719,7 +719,7 @@ static int _parseconfig(const char *file, struct section_t *section, /* ... or in a repo section */ if(strcmp(key, "Server") == 0) { if(value == NULL) { - pm_printf(PM_LOG_ERROR, _("config file %s, line %d: directive '%s' needs a value\n"), + pm_printf(ALPM_LOG_ERROR, _("config file %s, line %d: directive '%s' needs a value\n"), file, linenum, key); ret = 1; goto cleanup; @@ -730,14 +730,14 @@ static int _parseconfig(const char *file, struct section_t *section, if(level != PM_PGP_VERIFY_UNKNOWN) { section->sigverify = level; } else { - pm_printf(PM_LOG_ERROR, + pm_printf(ALPM_LOG_ERROR, _("config file %s, line %d: directive '%s' has invalid value '%s'\n"), file, linenum, key, value); ret = 1; goto cleanup; } } else { - pm_printf(PM_LOG_WARNING, + pm_printf(ALPM_LOG_WARNING, _("config file %s, line %d: directive '%s' in section '%s' not recognized.\n"), file, linenum, key, section->name); } @@ -750,7 +750,7 @@ static int _parseconfig(const char *file, struct section_t *section, cleanup: fclose(fp); - pm_printf(PM_LOG_DEBUG, "config: finished parsing %s\n", file); + pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s\n", file); return ret; } @@ -768,7 +768,7 @@ int parseconfig(const char *file) * Next, we go back and parse everything but [options]. */ /* call the real parseconfig function with a null section & db argument */ - pm_printf(PM_LOG_DEBUG, "parseconfig: options pass\n"); + pm_printf(ALPM_LOG_DEBUG, "parseconfig: options pass\n"); if((ret = _parseconfig(file, §ion, 1, 0))) { return ret; } @@ -776,7 +776,7 @@ int parseconfig(const char *file) return ret; } /* second pass, repo section parsing */ - pm_printf(PM_LOG_DEBUG, "parseconfig: repo pass\n"); + pm_printf(ALPM_LOG_DEBUG, "parseconfig: repo pass\n"); return _parseconfig(file, §ion, 0, 0); } diff --git a/src/pacman/database.c b/src/pacman/database.c index d39ccf78..6b7bd4e2 100644 --- a/src/pacman/database.c +++ b/src/pacman/database.c @@ -45,7 +45,7 @@ int pacman_database(alpm_list_t *targets) alpm_pkgreason_t reason; if(targets == NULL) { - pm_printf(PM_LOG_ERROR, _("no targets specified (use -h for help)\n")); + pm_printf(ALPM_LOG_ERROR, _("no targets specified (use -h for help)\n")); return 1; } @@ -54,7 +54,7 @@ int pacman_database(alpm_list_t *targets) } else if(config->flags & PM_TRANS_FLAG_ALLEXPLICIT) { /* --asexplicit */ reason = ALPM_PKG_REASON_EXPLICIT; } else { - pm_printf(PM_LOG_ERROR, _("no install reason specified (use -h for help)\n")); + pm_printf(ALPM_LOG_ERROR, _("no install reason specified (use -h for help)\n")); return 1; } @@ -67,7 +67,7 @@ int pacman_database(alpm_list_t *targets) for(i = targets; i; i = alpm_list_next(i)) { char *pkgname = i->data; if(alpm_db_set_pkgreason(db_local, pkgname, reason) == -1) { - pm_printf(PM_LOG_ERROR, _("could not set install reason for package %s (%s)\n"), + pm_printf(ALPM_LOG_ERROR, _("could not set install reason for package %s (%s)\n"), pkgname, alpm_strerror(alpm_errno(config->handle))); retval = 1; } else { diff --git a/src/pacman/package.c b/src/pacman/package.c index 1c4e9766..1a08c0bb 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -163,7 +163,7 @@ static const char *get_backup_file_status(const char *root, char *md5sum = alpm_compute_md5sum(path); if(md5sum == NULL) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("could not calculate checksums for %s\n"), path); return NULL; } @@ -244,7 +244,7 @@ void dump_pkg_changelog(alpm_pkg_t *pkg) void *fp = NULL; if((fp = alpm_pkg_changelog_open(pkg)) == NULL) { - pm_fprintf(stderr, PM_LOG_ERROR, _("no changelog available for '%s'.\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("no changelog available for '%s'.\n"), alpm_pkg_get_name(pkg)); return; } else { diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index ce2ca2d5..18e49896 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -264,7 +264,7 @@ static void setuseragent(void) static void cleanup(int ret) { /* free alpm library resources */ if(config->handle && alpm_release(config->handle) == -1) { - pm_printf(PM_LOG_ERROR, "error releasing alpm library\n"); + pm_printf(ALPM_LOG_ERROR, "error releasing alpm library\n"); } /* free memory */ @@ -408,17 +408,17 @@ static int parsearg_global(int opt) unsigned short debug = (unsigned short)atoi(optarg); switch(debug) { case 2: - config->logmask |= PM_LOG_FUNCTION; /* fall through */ + config->logmask |= ALPM_LOG_FUNCTION; /* fall through */ case 1: - config->logmask |= PM_LOG_DEBUG; + config->logmask |= ALPM_LOG_DEBUG; break; default: - pm_printf(PM_LOG_ERROR, _("'%s' is not a valid debug level\n"), + pm_printf(ALPM_LOG_ERROR, _("'%s' is not a valid debug level\n"), optarg); return 1; } } else { - config->logmask |= PM_LOG_DEBUG; + config->logmask |= ALPM_LOG_DEBUG; } /* progress bars get wonky with debug on, shut them off */ config->noprogressbar = 1; @@ -645,7 +645,7 @@ static int parseargs(int argc, char *argv[]) } if(config->op == 0) { - pm_printf(PM_LOG_ERROR, _("only one operation may be used at a time\n")); + pm_printf(ALPM_LOG_ERROR, _("only one operation may be used at a time\n")); return 1; } if(config->help) { @@ -701,7 +701,7 @@ static int parseargs(int argc, char *argv[]) result = parsearg_global(opt); if(result != 0) { /* global option parsing failed, abort */ - pm_printf(PM_LOG_ERROR, _("invalid option\n")); + pm_printf(ALPM_LOG_ERROR, _("invalid option\n")); return result; } } @@ -833,7 +833,7 @@ int main(int argc, char *argv[]) } /* check for buffer overflow */ if(i >= PATH_MAX) { - pm_printf(PM_LOG_ERROR, _("buffer overflow detected in arg parsing\n")); + pm_printf(ALPM_LOG_ERROR, _("buffer overflow detected in arg parsing\n")); cleanup(EXIT_FAILURE); } @@ -843,7 +843,7 @@ int main(int argc, char *argv[]) pm_targets = alpm_list_add(pm_targets, strdup(line)); } if(!freopen(ctermid(NULL), "r", stdin)) { - pm_printf(PM_LOG_ERROR, _("failed to reopen stdin for reading: (%s)\n"), + pm_printf(ALPM_LOG_ERROR, _("failed to reopen stdin for reading: (%s)\n"), strerror(errno)); } } @@ -865,13 +865,13 @@ int main(int argc, char *argv[]) config->flags |= PM_TRANS_FLAG_NOCONFLICTS; config->flags |= PM_TRANS_FLAG_NOLOCK; /* Display only errors */ - config->logmask &= ~PM_LOG_WARNING; + config->logmask &= ~ALPM_LOG_WARNING; } #if defined(HAVE_GETEUID) && !defined(CYGWIN) /* check if we have sufficient permission for the requested operation */ if(myuid > 0 && needs_root()) { - pm_printf(PM_LOG_ERROR, _("you cannot perform this operation unless you are root.\n")); + pm_printf(ALPM_LOG_ERROR, _("you cannot perform this operation unless you are root.\n")); cleanup(EXIT_FAILURE); } #endif @@ -918,7 +918,7 @@ int main(int argc, char *argv[]) ret = pacman_deptest(pm_targets); break; default: - pm_printf(PM_LOG_ERROR, _("no operation specified (use -h for help)\n")); + pm_printf(ALPM_LOG_ERROR, _("no operation specified (use -h for help)\n")); ret = EXIT_FAILURE; } diff --git a/src/pacman/query.c b/src/pacman/query.c index 6500c2da..df4f7f19 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -117,7 +117,7 @@ static int query_fileowner(alpm_list_t *targets) /* This code is here for safety only */ if(targets == NULL) { - pm_fprintf(stderr, PM_LOG_ERROR, _("no file was specified for --owns\n")); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("no file was specified for --owns\n")); return 1; } @@ -144,14 +144,14 @@ static int query_fileowner(alpm_list_t *targets) /* if it is not a path but a program name, then check in PATH */ if(strchr(filename, '/') == NULL) { if(search_path(&filename, &buf) == -1) { - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to find '%s' in PATH: %s\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to find '%s' in PATH: %s\n"), filename, strerror(errno)); ret++; free(filename); continue; } } else { - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to read file '%s': %s\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to read file '%s': %s\n"), filename, strerror(errno)); ret++; free(filename); @@ -160,7 +160,7 @@ static int query_fileowner(alpm_list_t *targets) } if(S_ISDIR(buf.st_mode)) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("cannot determine ownership of directory '%s'\n"), filename); ret++; free(filename); @@ -176,7 +176,7 @@ static int query_fileowner(alpm_list_t *targets) rpath = resolve_path(dname); if(!rpath) { - pm_fprintf(stderr, PM_LOG_ERROR, _("cannot determine real path for '%s': %s\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("cannot determine real path for '%s': %s\n"), filename, strerror(errno)); free(filename); free(dname); @@ -208,7 +208,7 @@ static int query_fileowner(alpm_list_t *targets) } if(strlen(pkgfile) > max_length) { - pm_fprintf(stderr, PM_LOG_ERROR, _("path too long: %s%s\n"), root, pkgfile); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("path too long: %s%s\n"), root, pkgfile); } /* concatenate our file and the root path */ strcpy(append, pkgfile); @@ -225,7 +225,7 @@ static int query_fileowner(alpm_list_t *targets) } } if(!found) { - pm_fprintf(stderr, PM_LOG_ERROR, _("No package owns %s\n"), filename); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("No package owns %s\n"), filename); ret++; } free(filename); @@ -327,7 +327,7 @@ static int query_group(alpm_list_t *targets) } } } else { - pm_fprintf(stderr, PM_LOG_ERROR, _("group \"%s\" was not found\n"), grpname); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("group \"%s\" was not found\n"), grpname); ret++; } } @@ -408,7 +408,7 @@ static int check(alpm_pkg_t *pkg) rootlen = strlen(root); if(rootlen + 1 > PATH_MAX) { /* we are in trouble here */ - pm_fprintf(stderr, PM_LOG_ERROR, _("path too long: %s%s\n"), root, ""); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("path too long: %s%s\n"), root, ""); return 1; } strcpy(f, root); @@ -419,7 +419,7 @@ static int check(alpm_pkg_t *pkg) const char *path = alpm_list_getdata(i); if(rootlen + 1 + strlen(path) > PATH_MAX) { - pm_fprintf(stderr, PM_LOG_WARNING, _("path too long: %s%s\n"), root, path); + pm_fprintf(stderr, ALPM_LOG_WARNING, _("path too long: %s%s\n"), root, path); continue; } strcpy(f + rootlen, path); @@ -429,7 +429,7 @@ static int check(alpm_pkg_t *pkg) if(config->quiet) { printf("%s %s\n", pkgname, f); } else { - pm_printf(PM_LOG_WARNING, "%s: %s (%s)\n", + pm_printf(ALPM_LOG_WARNING, "%s: %s (%s)\n", pkgname, f, strerror(errno)); } errors++; @@ -503,7 +503,7 @@ int pacman_query(alpm_list_t *targets) /* ensure we have at least one valid sync db set up */ alpm_list_t *sync_dbs = alpm_option_get_syncdbs(config->handle); if(sync_dbs == NULL) { - pm_printf(PM_LOG_ERROR, _("no usable package repositories configured.\n")); + pm_printf(ALPM_LOG_ERROR, _("no usable package repositories configured.\n")); return 1; } } @@ -515,7 +515,7 @@ int pacman_query(alpm_list_t *targets) * invalid: isfile, owns */ if(targets == NULL) { if(config->op_q_isfile || config->op_q_owns) { - pm_printf(PM_LOG_ERROR, _("no targets specified (use -h for help)\n")); + pm_printf(ALPM_LOG_ERROR, _("no targets specified (use -h for help)\n")); return 1; } @@ -555,7 +555,7 @@ int pacman_query(alpm_list_t *targets) } if(pkg == NULL) { - pm_fprintf(stderr, PM_LOG_ERROR, _("package \"%s\" not found\n"), strname); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("package \"%s\" not found\n"), strname); ret = 1; continue; } diff --git a/src/pacman/remove.c b/src/pacman/remove.c index 4a23ab2e..1221904d 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -39,7 +39,7 @@ static int remove_target(const char *target) if((info = alpm_db_get_pkg(db_local, target)) != NULL) { if(alpm_remove_pkg(config->handle, info) == -1) { - pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target, + pm_fprintf(stderr, ALPM_LOG_ERROR, "'%s': %s\n", target, alpm_strerror(alpm_errno(config->handle))); return -1; } @@ -49,13 +49,13 @@ static int remove_target(const char *target) /* fallback to group */ alpm_group_t *grp = alpm_db_readgroup(db_local, target); if(grp == NULL) { - pm_fprintf(stderr, PM_LOG_ERROR, "'%s': target not found\n", target); + pm_fprintf(stderr, ALPM_LOG_ERROR, "'%s': target not found\n", target); return -1; } for(p = grp->packages; p; p = alpm_list_next(p)) { alpm_pkg_t *pkg = alpm_list_getdata(p); if(alpm_remove_pkg(config->handle, pkg) == -1) { - pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target, + pm_fprintf(stderr, ALPM_LOG_ERROR, "'%s': %s\n", target, alpm_strerror(alpm_errno(config->handle))); return -1; } @@ -76,7 +76,7 @@ int pacman_remove(alpm_list_t *targets) alpm_list_t *i, *data = NULL; if(targets == NULL) { - pm_printf(PM_LOG_ERROR, _("no targets specified (use -h for help)\n")); + pm_printf(ALPM_LOG_ERROR, _("no targets specified (use -h for help)\n")); return 1; } @@ -103,7 +103,7 @@ int pacman_remove(alpm_list_t *targets) /* Step 2: prepare the transaction based on its type, targets and flags */ if(alpm_trans_prepare(config->handle, &data) == -1) { enum _alpm_errno_t err = alpm_errno(config->handle); - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), alpm_strerror(err)); switch(err) { case PM_ERR_PKG_INVALID_ARCH: @@ -133,7 +133,7 @@ int pacman_remove(alpm_list_t *targets) for(i = alpm_trans_get_remove(config->handle); i; i = alpm_list_next(i)) { alpm_pkg_t *pkg = alpm_list_getdata(i); if(alpm_list_find_str(config->holdpkg, alpm_pkg_get_name(pkg))) { - pm_printf(PM_LOG_WARNING, _("%s is designated as a HoldPkg.\n"), + pm_printf(ALPM_LOG_WARNING, _("%s is designated as a HoldPkg.\n"), alpm_pkg_get_name(pkg)); holdpkg = 1; } @@ -164,7 +164,7 @@ int pacman_remove(alpm_list_t *targets) } if(alpm_trans_commit(config->handle, &data) == -1) { - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to commit transaction (%s)\n"), alpm_strerror(alpm_errno(config->handle))); retval = 1; } diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 03150489..7e47204e 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -47,7 +47,7 @@ static int sync_cleandb(const char *dbpath, int keep_used) dir = opendir(dbpath); if(dir == NULL) { - pm_fprintf(stderr, PM_LOG_ERROR, _("could not access database directory\n")); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("could not access database directory\n")); return 1; } @@ -82,7 +82,7 @@ static int sync_cleandb(const char *dbpath, int keep_used) len = strlen(path); if(S_ISDIR(buf.st_mode) || strcmp(path + len - 3, ".db") != 0) { if(rmrf(path)) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("could not remove %s\n"), path); closedir(dir); return 1; @@ -108,7 +108,7 @@ static int sync_cleandb(const char *dbpath, int keep_used) } if(rmrf(path)) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("could not remove %s\n"), path); closedir(dir); return 1; @@ -184,7 +184,7 @@ static int sync_cleancache(int level) struct dirent *ent; if(dir == NULL) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("could not access cache directory %s\n"), cachedir); ret++; continue; @@ -240,7 +240,7 @@ static int sync_cleancache(int level) if(pkg != NULL && alpm_pkg_vercmp(local_version, alpm_pkg_get_version(pkg)) == 0) { /* package was found in local DB and version matches, keep it */ - pm_printf(PM_LOG_DEBUG, "pkg %s-%s found in local db\n", + pm_printf(ALPM_LOG_DEBUG, "pkg %s-%s found in local db\n", local_name, local_version); delete = 0; } @@ -254,7 +254,7 @@ static int sync_cleancache(int level) if(pkg != NULL && alpm_pkg_vercmp(local_version, alpm_pkg_get_version(pkg)) == 0) { /* package was found in a sync DB and version matches, keep it */ - pm_printf(PM_LOG_DEBUG, "pkg %s-%s found in sync db\n", + pm_printf(ALPM_LOG_DEBUG, "pkg %s-%s found in sync db\n", local_name, local_version); delete = 0; } @@ -288,7 +288,7 @@ static int sync_synctree(int level, alpm_list_t *syncs) ret = alpm_db_update((level < 2 ? 0 : 1), db); if(ret < 0) { - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to update %s (%s)\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to update %s (%s)\n"), alpm_db_get_name(db), alpm_strerror(alpm_errno(config->handle))); } else if(ret == 1) { printf(_(" %s is up to date\n"), alpm_db_get_name(db)); @@ -303,7 +303,7 @@ static int sync_synctree(int level, alpm_list_t *syncs) * expected */ if(!success) { - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to synchronize any databases\n")); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to synchronize any databases\n")); } return (success > 0); } @@ -465,7 +465,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) } if(!db) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("repository '%s' does not exist\n"), repo); return 1; } @@ -481,7 +481,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) } if(!foundpkg) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("package '%s' was not found in repository '%s'\n"), pkgstr, repo); ret++; } @@ -502,7 +502,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) } } if(!foundpkg) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("package '%s' was not found\n"), pkgstr); ret++; } @@ -542,7 +542,7 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) } if(db == NULL) { - pm_fprintf(stderr, PM_LOG_ERROR, + pm_fprintf(stderr, ALPM_LOG_ERROR, _("repository \"%s\" was not found.\n"),repo); alpm_list_free(ls); return 1; @@ -619,10 +619,10 @@ static int process_pkg(alpm_pkg_t *pkg) if(err == PM_ERR_TRANS_DUP_TARGET || err == PM_ERR_PKG_IGNORED) { /* just skip duplicate or ignored targets */ - pm_printf(PM_LOG_WARNING, _("skipping target: %s\n"), alpm_pkg_get_name(pkg)); + pm_printf(ALPM_LOG_WARNING, _("skipping target: %s\n"), alpm_pkg_get_name(pkg)); return 0; } else { - pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", alpm_pkg_get_name(pkg), + pm_fprintf(stderr, ALPM_LOG_ERROR, "'%s': %s\n", alpm_pkg_get_name(pkg), alpm_strerror(err)); return 1; } @@ -638,7 +638,7 @@ static int process_group(alpm_list_t *dbs, char *group) int count = alpm_list_count(pkgs); if(!count) { - pm_fprintf(stderr, PM_LOG_ERROR, _("target not found: %s\n"), group); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("target not found: %s\n"), group); return 1; } @@ -682,7 +682,7 @@ static int process_targname(alpm_list_t *dblist, char *targname) /* #FS#23342 - skip ignored packages when user says no */ if(alpm_errno(config->handle) == PM_ERR_PKG_IGNORED) { - pm_printf(PM_LOG_WARNING, _("skipping target: %s\n"), targname); + pm_printf(ALPM_LOG_WARNING, _("skipping target: %s\n"), targname); /* TODO how to do this, we shouldn't be fucking with it from the frontend */ /* pm_errno = 0; */ return 0; @@ -712,7 +712,7 @@ static int process_target(char *target) dbname = targstring; db = get_db(dbname); if(!db) { - pm_fprintf(stderr, PM_LOG_ERROR, _("database not found: %s\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("database not found: %s\n"), dbname); ret = 1; goto cleanup; @@ -755,7 +755,7 @@ static int sync_trans(alpm_list_t *targets) printf(_(":: Starting full system upgrade...\n")); alpm_logaction(config->handle, "starting full system upgrade\n"); if(alpm_sync_sysupgrade(config->handle, config->op_s_upgrade >= 2) == -1) { - pm_fprintf(stderr, PM_LOG_ERROR, "%s\n", alpm_strerror(alpm_errno(config->handle))); + pm_fprintf(stderr, ALPM_LOG_ERROR, "%s\n", alpm_strerror(alpm_errno(config->handle))); retval = 1; goto cleanup; } @@ -764,7 +764,7 @@ static int sync_trans(alpm_list_t *targets) /* Step 2: "compute" the transaction based on targets and flags */ if(alpm_trans_prepare(config->handle, &data) == -1) { enum _alpm_errno_t err = alpm_errno(config->handle); - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), alpm_strerror(err)); switch(err) { case PM_ERR_PKG_INVALID_ARCH: @@ -831,7 +831,7 @@ static int sync_trans(alpm_list_t *targets) if(alpm_trans_commit(config->handle, &data) == -1) { enum _alpm_errno_t err = alpm_errno(config->handle); - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to commit transaction (%s)\n"), alpm_strerror(err)); switch(err) { case PM_ERR_FILE_CONFLICTS: @@ -903,7 +903,7 @@ int pacman_sync(alpm_list_t *targets) /* ensure we have at least one valid sync db set up */ sync_dbs = alpm_option_get_syncdbs(config->handle); if(sync_dbs == NULL) { - pm_printf(PM_LOG_ERROR, _("no usable package repositories configured.\n")); + pm_printf(ALPM_LOG_ERROR, _("no usable package repositories configured.\n")); return 1; } @@ -944,7 +944,7 @@ int pacman_sync(alpm_list_t *targets) } else { /* don't proceed here unless we have an operation that doesn't require a * target list */ - pm_printf(PM_LOG_ERROR, _("no targets specified (use -h for help)\n")); + pm_printf(ALPM_LOG_ERROR, _("no targets specified (use -h for help)\n")); return 1; } } @@ -971,7 +971,7 @@ int pacman_sync(alpm_list_t *targets) } printf("\n"); } else { - pm_printf(PM_LOG_DEBUG, "skipping SyncFirst dialog\n"); + pm_printf(ALPM_LOG_DEBUG, "skipping SyncFirst dialog\n"); FREELIST(packages); } } diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index 258db609..2f814b0a 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -46,7 +46,7 @@ int pacman_upgrade(alpm_list_t *targets) int retval = 0; if(targets == NULL) { - pm_printf(PM_LOG_ERROR, _("no targets specified (use -h for help)\n")); + pm_printf(ALPM_LOG_ERROR, _("no targets specified (use -h for help)\n")); return 1; } @@ -56,7 +56,7 @@ int pacman_upgrade(alpm_list_t *targets) if(strstr(i->data, "://")) { char *str = alpm_fetch_pkgurl(config->handle, i->data); if(str == NULL) { - pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", + pm_fprintf(stderr, ALPM_LOG_ERROR, "'%s': %s\n", (char *)i->data, alpm_strerror(alpm_errno(config->handle))); return 1; } else { @@ -77,13 +77,13 @@ int pacman_upgrade(alpm_list_t *targets) alpm_pkg_t *pkg; if(alpm_pkg_load(config->handle, targ, 1, check_sig, &pkg) != 0) { - pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", + pm_fprintf(stderr, ALPM_LOG_ERROR, "'%s': %s\n", targ, alpm_strerror(alpm_errno(config->handle))); trans_release(); return 1; } if(alpm_add_pkg(config->handle, pkg) == -1) { - pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", + pm_fprintf(stderr, ALPM_LOG_ERROR, "'%s': %s\n", targ, alpm_strerror(alpm_errno(config->handle))); alpm_pkg_free(pkg); trans_release(); @@ -95,7 +95,7 @@ int pacman_upgrade(alpm_list_t *targets) /* TODO: No, compute nothing. This is stupid. */ if(alpm_trans_prepare(config->handle, &data) == -1) { enum _alpm_errno_t err = alpm_errno(config->handle); - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), alpm_strerror(err)); switch(err) { case PM_ERR_PKG_INVALID_ARCH: @@ -163,7 +163,7 @@ int pacman_upgrade(alpm_list_t *targets) if(alpm_trans_commit(config->handle, &data) == -1) { enum _alpm_errno_t err = alpm_errno(config->handle); - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to commit transaction (%s)\n"), alpm_strerror(err)); switch(err) { case PM_ERR_FILE_CONFLICTS: diff --git a/src/pacman/util.c b/src/pacman/util.c index 6a93f6df..a77643d1 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -61,7 +61,7 @@ int trans_init(alpm_transflag_t flags) if(ret == -1) { enum _alpm_errno_t err = alpm_errno(config->handle); - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to init transaction (%s)\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to init transaction (%s)\n"), alpm_strerror(err)); if(err == PM_ERR_HANDLE_LOCK) { fprintf(stderr, _(" if you're sure a package manager is not already\n" @@ -77,7 +77,7 @@ int trans_init(alpm_transflag_t flags) int trans_release(void) { if(alpm_trans_release(config->handle) == -1) { - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to release transaction (%s)\n"), + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to release transaction (%s)\n"), alpm_strerror(alpm_errno(config->handle))); return -1; } @@ -1228,7 +1228,7 @@ int pm_asprintf(char **string, const char *format, ...) /* print the message using va_arg list */ va_start(args, format); if(vasprintf(string, format, args) == -1) { - pm_fprintf(stderr, PM_LOG_ERROR, _("failed to allocate string\n")); + pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to allocate string\n")); ret = -1; } va_end(args); @@ -1251,16 +1251,16 @@ int pm_vasprintf(char **string, alpm_loglevel_t level, const char *format, va_li /* print a prefix to the message */ switch(level) { - case PM_LOG_ERROR: + case ALPM_LOG_ERROR: pm_asprintf(string, _("error: %s"), msg); break; - case PM_LOG_WARNING: + case ALPM_LOG_WARNING: pm_asprintf(string, _("warning: %s"), msg); break; - case PM_LOG_DEBUG: + case ALPM_LOG_DEBUG: pm_asprintf(string, "debug: %s", msg); break; - case PM_LOG_FUNCTION: + case ALPM_LOG_FUNCTION: pm_asprintf(string, "function: %s", msg); break; default: @@ -1283,7 +1283,7 @@ int pm_vfprintf(FILE *stream, alpm_loglevel_t level, const char *format, va_list #if defined(PACMAN_DEBUG) /* If debug is on, we'll timestamp the output */ - if(config->logmask & PM_LOG_DEBUG) { + if(config->logmask & ALPM_LOG_DEBUG) { time_t t; struct tm *tmp; char timestr[10] = {0}; @@ -1299,16 +1299,16 @@ int pm_vfprintf(FILE *stream, alpm_loglevel_t level, const char *format, va_list /* print a prefix to the message */ switch(level) { - case PM_LOG_ERROR: + case ALPM_LOG_ERROR: fprintf(stream, _("error: ")); break; - case PM_LOG_WARNING: + case ALPM_LOG_WARNING: fprintf(stream, _("warning: ")); break; - case PM_LOG_DEBUG: + case ALPM_LOG_DEBUG: fprintf(stream, "debug: "); break; - case PM_LOG_FUNCTION: + case ALPM_LOG_FUNCTION: fprintf(stream, "function: "); break; default: diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index 70fb7607..08d8a557 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -43,9 +43,9 @@ static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args) { if(strlen(fmt)) { switch(level) { - case PM_LOG_ERROR: printf("error: "); break; - case PM_LOG_WARNING: printf("warning: "); break; - //case PM_LOG_DEBUG: printf("debug: "); break; + case ALPM_LOG_ERROR: printf("error: "); break; + case ALPM_LOG_WARNING: printf("warning: "); break; + //case ALPM_LOG_DEBUG: printf("debug: "); break; default: return; } vprintf(fmt, args); diff --git a/src/util/testdb.c b/src/util/testdb.c index b8ab33ca..642890b6 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -45,8 +45,8 @@ static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args) { if(strlen(fmt)) { switch(level) { - case PM_LOG_ERROR: printf("error: "); break; - case PM_LOG_WARNING: printf("warning: "); break; + case ALPM_LOG_ERROR: printf("error: "); break; + case ALPM_LOG_WARNING: printf("warning: "); break; default: return; } vprintf(fmt, args); diff --git a/src/util/testpkg.c b/src/util/testpkg.c index a745984d..cfde486a 100644 --- a/src/util/testpkg.c +++ b/src/util/testpkg.c @@ -30,8 +30,8 @@ static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args) return; } switch(level) { - case PM_LOG_ERROR: printf("error: "); break; - case PM_LOG_WARNING: printf("warning: "); break; + case ALPM_LOG_ERROR: printf("error: "); break; + case ALPM_LOG_WARNING: printf("warning: "); break; default: return; /* skip other messages */ } vprintf(fmt, args); |