diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/add.c | 83 | ||||
-rw-r--r-- | lib/libalpm/alpm.c | 3 | ||||
-rw-r--r-- | lib/libalpm/be_files.c | 22 | ||||
-rw-r--r-- | lib/libalpm/cache.c | 18 | ||||
-rw-r--r-- | lib/libalpm/conflict.c | 19 | ||||
-rw-r--r-- | lib/libalpm/db.c | 41 | ||||
-rw-r--r-- | lib/libalpm/deps.c | 47 | ||||
-rw-r--r-- | lib/libalpm/error.h | 2 | ||||
-rw-r--r-- | lib/libalpm/handle.c | 5 | ||||
-rw-r--r-- | lib/libalpm/md5driver.c | 2 | ||||
-rw-r--r-- | lib/libalpm/package.c | 10 | ||||
-rw-r--r-- | lib/libalpm/remove.c | 39 | ||||
-rw-r--r-- | lib/libalpm/server.c | 19 | ||||
-rw-r--r-- | lib/libalpm/sha1.c | 2 | ||||
-rw-r--r-- | lib/libalpm/sync.c | 82 | ||||
-rw-r--r-- | lib/libalpm/trans.c | 16 | ||||
-rw-r--r-- | lib/libalpm/util.c | 2 | ||||
-rw-r--r-- | lib/libalpm/versioncmp.c | 4 |
18 files changed, 223 insertions, 193 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index df01cb43..b4345e91 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -70,7 +70,7 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(name != NULL && strlen(name) != 0, RET_ERR(PM_ERR_WRONG_ARGS, -1)); - _alpm_log(PM_LOG_DEBUG, _("loading target '%s'"), name); + _alpm_log(PM_LOG_DEBUG, "loading target '%s'", name); /* TODO FS#5120 we need a better way to check if a package is a valid package, * and read the metadata instead of relying on the filename for package name @@ -131,7 +131,7 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) } } - _alpm_log(PM_LOG_DEBUG, _("reading '%s' metadata"), pkgname); + _alpm_log(PM_LOG_DEBUG, "reading '%s' metadata", pkgname); info = _alpm_pkg_load(name); if(info == NULL) { /* pm_errno is already set by pkg_load() */ @@ -181,7 +181,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL); /* look for unsatisfied dependencies */ - _alpm_log(PM_LOG_DEBUG, _("looking for unsatisfied dependencies")); + _alpm_log(PM_LOG_DEBUG, "looking for unsatisfied dependencies"); lp = _alpm_checkdeps(db, trans->type, trans->packages); if(lp != NULL) { if(data) { @@ -193,7 +193,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) } /* no unsatisfied deps, so look for conflicts */ - _alpm_log(PM_LOG_DEBUG, _("looking for conflicts")); + _alpm_log(PM_LOG_DEBUG, "looking for conflicts"); lp = _alpm_checkconflicts(db, trans->packages); for(i = lp; i; i = i->next) { pmdepmissing_t *miss = i->data; @@ -240,7 +240,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) } /* re-order w.r.t. dependencies */ - _alpm_log(PM_LOG_DEBUG, _("sorting by dependencies")); + _alpm_log(PM_LOG_DEBUG, "sorting by dependencies"); lp = _alpm_sortbydeps(trans->packages, PM_TRANS_TYPE_ADD); /* free the old alltargs */ alpm_list_free(trans->packages); @@ -253,7 +253,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) if(!(trans->flags & PM_TRANS_FLAG_FORCE)) { EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL); - _alpm_log(PM_LOG_DEBUG, _("looking for file conflicts")); + _alpm_log(PM_LOG_DEBUG, "looking for file conflicts"); lp = _alpm_db_find_conflicts(db, trans, handle->root); if(lp != NULL) { if(data) { @@ -319,7 +319,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) is_upgrade = 1; EVENT(trans, PM_TRANS_EVT_UPGRADE_START, newpkg, NULL); - _alpm_log(PM_LOG_DEBUG, _("upgrading package %s-%s"), newpkg->name, newpkg->version); + _alpm_log(PM_LOG_DEBUG, "upgrading package %s-%s", + newpkg->name, newpkg->version); /* we'll need to save some record for backup checks later */ oldpkg = _alpm_pkg_new(local->name, local->version); @@ -343,7 +344,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) is_upgrade = 0; EVENT(trans, PM_TRANS_EVT_ADD_START, newpkg, NULL); - _alpm_log(PM_LOG_DEBUG, _("adding package %s-%s"), newpkg->name, newpkg->version); + _alpm_log(PM_LOG_DEBUG, "adding package %s-%s", + newpkg->name, newpkg->version); /* pre_install scriptlet */ if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) { @@ -356,7 +358,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) * NEW transaction, unrelated to handle->trans, and instantiate a "remove" * with the type PM_TRANS_TYPE_UPGRADE. TODO: kill this weird behavior. */ pmtrans_t *tr = _alpm_trans_new(); - _alpm_log(PM_LOG_DEBUG, _("removing old package first (%s-%s)"), oldpkg->name, oldpkg->version); + _alpm_log(PM_LOG_DEBUG, "removing old package first (%s-%s)", + oldpkg->name, oldpkg->version); if(!tr) { RET_ERR(PM_ERR_TRANS_ABORT, -1); @@ -386,7 +389,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) alpm_list_t *old_noupgrade = alpm_list_strdup(handle->noupgrade); for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) { const char *backup = b->data; - _alpm_log(PM_LOG_DEBUG, _("adding %s to the NoUpgrade array temporarily"), backup); + _alpm_log(PM_LOG_DEBUG, "adding %s to the NoUpgrade array temporarily", + backup); handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(backup)); } @@ -406,7 +410,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) } if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) { - _alpm_log(PM_LOG_DEBUG, _("extracting files")); + _alpm_log(PM_LOG_DEBUG, "extracting files"); if ((archive = archive_read_new()) == NULL) { RET_ERR(PM_ERR_LIBARCHIVE_ERROR, -1); @@ -448,7 +452,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) * (missing metadata sizes) */ unsigned long pos = archive_position_compressed(archive); percent = (double)pos / (double)newpkg->size; - _alpm_log(PM_LOG_DEBUG, "decompression progress: %f%% (%ld / %ld)", percent*100.0, pos, newpkg->size); + _alpm_log(PM_LOG_DEBUG, "decompression progress: %f%% (%ld / %ld)", + percent*100.0, pos, newpkg->size); if(percent >= 1.0) { percent = 1.0; } @@ -474,7 +479,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) } else if(*entryname == '.') { /* for now, ignore all files starting with '.' that haven't * already been handled (for future possibilities) */ - _alpm_log(PM_LOG_DEBUG, _("skipping extraction of '%s'"), entryname); + _alpm_log(PM_LOG_DEBUG, "skipping extraction of '%s'", entryname); archive_read_data_skip(archive); continue; } else { @@ -484,7 +489,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) /* if a file is in NoExtract then we never extract it */ if(alpm_list_find_str(handle->noextract, entryname)) { - _alpm_log(PM_LOG_DEBUG, _("%s is in NoExtract, skipping extraction"), entryname); + _alpm_log(PM_LOG_DEBUG, "%s is in NoExtract, skipping extraction", + entryname); alpm_logaction("note: %s is in NoExtract, skipping extraction", entryname); archive_read_data_skip(archive); continue; @@ -492,7 +498,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) /* if a file is in the add skiplist we never extract it */ if(alpm_list_find_str(trans->skip_add, filename)) { - _alpm_log(PM_LOG_DEBUG, _("%s is in trans->skip_add, skipping extraction"), entryname); + _alpm_log(PM_LOG_DEBUG, "%s is in trans->skip_add, skipping extraction", entryname); archive_read_data_skip(archive); continue; } @@ -540,10 +546,10 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) int ret = archive_read_extract(archive, entry, archive_flags); if(ret == ARCHIVE_WARN) { /* operation succeeded but a non-critical error was encountered */ - _alpm_log(PM_LOG_DEBUG, _("warning extracting %s (%s)"), + _alpm_log(PM_LOG_DEBUG, "warning extracting %s (%s)", entryname, archive_error_string(archive)); } else if(ret != ARCHIVE_OK) { - _alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)"), + _alpm_log(PM_LOG_ERROR, "could not extract %s (%s)", entryname, archive_error_string(archive)); alpm_logaction("error: could not extract %s (%s)", entryname, archive_error_string(archive)); @@ -592,13 +598,13 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) } if(use_md5) { - _alpm_log(PM_LOG_DEBUG, _("checking md5 hashes for %s"), entryname); + _alpm_log(PM_LOG_DEBUG, "checking md5 hashes for %s", entryname); } else { - _alpm_log(PM_LOG_DEBUG, _("checking sha1 hashes for %s"), entryname); + _alpm_log(PM_LOG_DEBUG, "checking sha1 hashes for %s", entryname); } - _alpm_log(PM_LOG_DEBUG, _("current: %s"), hash_local); - _alpm_log(PM_LOG_DEBUG, _("new: %s"), hash_pkg); - _alpm_log(PM_LOG_DEBUG, _("original: %s"), hash_orig); + _alpm_log(PM_LOG_DEBUG, "current: %s", hash_local); + _alpm_log(PM_LOG_DEBUG, "new: %s", hash_pkg); + _alpm_log(PM_LOG_DEBUG, "original: %s", hash_orig); if(!is_upgrade) { /* looks like we have a local file that has a different hash as the @@ -633,7 +639,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) if(strcmp(hash_orig, hash_local) == 0) { /* installed file has NOT been changed by user */ if(strcmp(hash_orig, hash_pkg) != 0) { - _alpm_log(PM_LOG_DEBUG, _("action: installing new file: %s"), entryname); + _alpm_log(PM_LOG_DEBUG, "action: installing new file: %s", + entryname); if(_alpm_copyfile(tempfile, filename)) { _alpm_log(PM_LOG_ERROR, _("could not copy tempfile to %s (%s)"), filename, strerror(errno)); @@ -643,21 +650,21 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) } else { /* there's no sense in installing the same file twice, install * ONLY is the original and package hashes differ */ - _alpm_log(PM_LOG_DEBUG, _("action: leaving existing file in place")); + _alpm_log(PM_LOG_DEBUG, "action: leaving existing file in place"); } } else if(strcmp(hash_orig, hash_pkg) == 0) { /* originally installed file and new file are the same - this * implies the case above failed - i.e. the file was changed by a * user */ - _alpm_log(PM_LOG_DEBUG, _("action: leaving existing file in place")); + _alpm_log(PM_LOG_DEBUG, "action: leaving existing file in place"); } else if(strcmp(hash_local, hash_pkg) == 0) { /* this would be magical. The above two cases failed, but the * user changes just so happened to make the new file exactly the * same as the one in the package... skip it */ - _alpm_log(PM_LOG_DEBUG, _("action: leaving existing file in place")); + _alpm_log(PM_LOG_DEBUG, "action: leaving existing file in place"); } else { char newpath[PATH_MAX]; - _alpm_log(PM_LOG_DEBUG, _("action: keeping current file and installing new one with .pacnew ending")); + _alpm_log(PM_LOG_DEBUG, "action: keeping current file and installing new one with .pacnew ending"); snprintf(newpath, PATH_MAX, "%s.pacnew", filename); if(_alpm_copyfile(tempfile, newpath)) { _alpm_log(PM_LOG_ERROR, _("could not install %s as %s: %s"), filename, newpath, strerror(errno)); @@ -678,12 +685,12 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) } else { /* ! needbackup */ if(notouch) { - _alpm_log(PM_LOG_DEBUG, _("%s is in NoUpgrade -- skipping"), filename); + _alpm_log(PM_LOG_DEBUG, "%s is in NoUpgrade -- skipping", filename); _alpm_log(PM_LOG_WARNING, _("extracting %s as %s.pacnew"), filename, filename); alpm_logaction("warning: extracting %s as %s.pacnew", filename, filename); strncat(filename, ".pacnew", PATH_MAX); } else { - _alpm_log(PM_LOG_DEBUG, _("extracting %s"), filename); + _alpm_log(PM_LOG_DEBUG, "extracting %s", filename); } if(trans->flags & PM_TRANS_FLAG_FORCE) { @@ -708,7 +715,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) int ret = archive_read_extract(archive, entry, archive_flags | ARCHIVE_EXTRACT_NO_OVERWRITE); if(ret == ARCHIVE_WARN) { /* operation succeeded but a non-critical error was encountered */ - _alpm_log(PM_LOG_DEBUG, _("warning extracting %s (%s)"), + _alpm_log(PM_LOG_DEBUG, "warning extracting %s (%s)", entryname, archive_error_string(archive)); } else if(ret != ARCHIVE_OK) { _alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)"), @@ -729,7 +736,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) if(!oldbackup || strcmp(oldbackup, entryname) != 0) { continue; } - _alpm_log(PM_LOG_DEBUG, _("appending backup entry for %s"), filename); + _alpm_log(PM_LOG_DEBUG, "appending backup entry for %s", filename); if(use_md5) { backup_len += 32; /* MD5s are 32 chars in length */ @@ -788,7 +795,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) _alpm_str_cmp); for(prov = provdiff; prov; prov = prov->next) { const char *provname = prov->data; - _alpm_log(PM_LOG_DEBUG, _("provision '%s' has been removed from package %s (%s => %s)"), + _alpm_log(PM_LOG_DEBUG, "provision '%s' has been removed from package %s (%s => %s)", provname, alpm_pkg_get_name(oldpkg), alpm_pkg_get_version(oldpkg), alpm_pkg_get_version(newpkg)); @@ -800,11 +807,13 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) * TODO figure out a way to find a "correct" provision */ pmpkg_t *provpkg = p->data; const char *pkgname = alpm_pkg_get_name(provpkg); - _alpm_log(PM_LOG_DEBUG, _("updating '%s' due to provision change (%s)"), pkgname, provname); + _alpm_log(PM_LOG_DEBUG, "updating '%s' due to provision change (%s)", + pkgname, provname); _alpm_pkg_update_requiredby(provpkg); if(_alpm_db_write(db, provpkg, INFRQ_DEPENDS)) { - _alpm_log(PM_LOG_ERROR, _("could not update provision '%s' from '%s'"), provname, pkgname); + _alpm_log(PM_LOG_ERROR, _("could not update provision '%s' from '%s'"), + provname, pkgname); alpm_logaction("error: could not update provision '%s' from '%s'", provname, pkgname); RET_ERR(PM_ERR_DB_WRITE, -1); @@ -819,8 +828,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) /* remove the extra line feed appended by asctime() */ newpkg->installdate[strlen(newpkg->installdate)-1] = 0; - _alpm_log(PM_LOG_DEBUG, _("updating database")); - _alpm_log(PM_LOG_DEBUG, _("adding database entry '%s'"), newpkg->name); + _alpm_log(PM_LOG_DEBUG, "updating database"); + _alpm_log(PM_LOG_DEBUG, "adding database entry '%s'", newpkg->name); if(_alpm_db_write(db, newpkg, INFRQ_ALL)) { _alpm_log(PM_LOG_ERROR, _("could not update database entry %s-%s"), @@ -861,7 +870,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) /* run ldconfig if it exists */ if(handle->trans->state != STATE_INTERRUPTED) { - _alpm_log(PM_LOG_DEBUG, _("running \"ldconfig -r %s\""), handle->root); + _alpm_log(PM_LOG_DEBUG, "running \"ldconfig -r %s\"", handle->root); _alpm_ldconfig(handle->root); } diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 11d00d4d..e3ad211d 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -76,7 +76,8 @@ int SYMEXPORT alpm_release(void) /* and also sync ones */ while((dbs_left = alpm_list_count(handle->dbs_sync)) > 0) { pmdb_t *db = (pmdb_t *)handle->dbs_sync->data; - _alpm_log(PM_LOG_DEBUG, _("removing DB %s, %d remaining..."), db->treename, dbs_left); + _alpm_log(PM_LOG_DEBUG, "removing DB %s, %d remaining...", + db->treename, dbs_left); alpm_db_unregister(db); db = NULL; } diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c index 83b6072c..f0c0d5ef 100644 --- a/lib/libalpm/be_files.c +++ b/lib/libalpm/be_files.c @@ -56,7 +56,7 @@ int _alpm_db_install(pmdb_t *db, const char *dbfile) /* TODO we should not simply unpack the archive, but better parse it and * db_write each entry (see sync_load_dbarchive to get archive content) */ - _alpm_log(PM_LOG_DEBUG, _("unpacking database '%s'"), dbfile); + _alpm_log(PM_LOG_DEBUG, "unpacking database '%s'", dbfile); if(_alpm_unpack(dbfile, db->path, NULL)) { RET_ERR(PM_ERR_SYSTEM, -1); @@ -105,7 +105,7 @@ int _alpm_db_open(pmdb_t *db) RET_ERR(PM_ERR_DB_NULL, -1); } - _alpm_log(PM_LOG_DEBUG, _("opening database from path '%s'"), db->path); + _alpm_log(PM_LOG_DEBUG, "opening database from path '%s'", db->path); db->handle = opendir(db->path); if(db->handle == NULL) { RET_ERR(PM_ERR_DB_OPEN, -1); @@ -209,7 +209,7 @@ pmpkg_t *_alpm_db_scan(pmdb_t *db, const char *target) pkg = _alpm_pkg_new(NULL, NULL); if(pkg == NULL) { - _alpm_log(PM_LOG_DEBUG, _("db scan could not find package: %s"), target); + _alpm_log(PM_LOG_DEBUG, "db scan could not find package: %s", target); return(NULL); } if(_alpm_pkg_splitname(ent->d_name, pkg->name, pkg->version, 0) == -1) { @@ -250,12 +250,12 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) } if(info == NULL || info->name[0] == 0 || info->version[0] == 0) { - _alpm_log(PM_LOG_DEBUG, _("invalid package entry provided to _alpm_db_read, skipping")); + _alpm_log(PM_LOG_DEBUG, "invalid package entry provided to _alpm_db_read, skipping"); return(-1); } if(info->origin == PKG_FROM_FILE) { - _alpm_log(PM_LOG_DEBUG, _("request to read database info for a file-based package '%s', skipping..."), info->name); + _alpm_log(PM_LOG_DEBUG, "request to read database info for a file-based package '%s', skipping...", info->name); return(-1); } @@ -276,7 +276,8 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) snprintf(path, PATH_MAX, "%s/%s-%s", db->path, info->name, info->version); if(stat(path, &buf)) { /* directory doesn't exist or can't be opened */ - _alpm_log(PM_LOG_DEBUG, _("cannot find '%s-%s' in db '%s'"), info->name, info->version, db->treename); + _alpm_log(PM_LOG_DEBUG, "cannot find '%s-%s' in db '%s'", + info->name, info->version, db->treename); return(-1); } @@ -541,7 +542,8 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) /* DESC */ if(inforeq & INFRQ_DESC) { - _alpm_log(PM_LOG_DEBUG, _("writing %s-%s DESC information back to db"), info->name, info->version); + _alpm_log(PM_LOG_DEBUG, "writing %s-%s DESC information back to db", + info->name, info->version); snprintf(path, PATH_MAX, "%s/%s-%s/desc", db->path, info->name, info->version); if((fp = fopen(path, "w")) == NULL) { _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno)); @@ -631,7 +633,8 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) /* FILES */ if(local && (inforeq & INFRQ_FILES)) { - _alpm_log(PM_LOG_DEBUG, _("writing %s-%s FILES information back to db"), info->name, info->version); + _alpm_log(PM_LOG_DEBUG, "writing %s-%s FILES information back to db", + info->name, info->version); snprintf(path, PATH_MAX, "%s/%s-%s/files", db->path, info->name, info->version); if((fp = fopen(path, "w")) == NULL) { _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno)); @@ -658,7 +661,8 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) /* DEPENDS */ if(inforeq & INFRQ_DEPENDS) { - _alpm_log(PM_LOG_DEBUG, _("writing %s-%s DEPENDS information back to db"), info->name, info->version); + _alpm_log(PM_LOG_DEBUG, "writing %s-%s DEPENDS information back to db", + info->name, info->version); snprintf(path, PATH_MAX, "%s/%s-%s/depends", db->path, info->name, info->version); if((fp = fopen(path, "w")) == NULL) { _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno)); diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c index 0a3cd1e2..4852f0fc 100644 --- a/lib/libalpm/cache.c +++ b/lib/libalpm/cache.c @@ -55,7 +55,7 @@ int _alpm_db_load_pkgcache(pmdb_t *db) _alpm_db_free_pkgcache(db); - _alpm_log(PM_LOG_DEBUG, _("loading package cache for repository '%s'"), + _alpm_log(PM_LOG_DEBUG, "loading package cache for repository '%s'", db->treename); _alpm_db_rewind(db); @@ -81,7 +81,7 @@ void _alpm_db_free_pkgcache(pmdb_t *db) return; } - _alpm_log(PM_LOG_DEBUG, _("freeing package cache for repository '%s'"), + _alpm_log(PM_LOG_DEBUG, "freeing package cache for repository '%s'", db->treename); alpm_list_t *tmp; @@ -109,7 +109,7 @@ alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db) /* hmmm, still NULL ?*/ if(!db->pkgcache) { - _alpm_log(PM_LOG_DEBUG, _("error: pkgcache is NULL for db '%s'"), db->treename); + _alpm_log(PM_LOG_DEBUG, "error: pkgcache is NULL for db '%s'", db->treename); } return(db->pkgcache); @@ -129,7 +129,7 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg) if(newpkg == NULL) { return(-1); } - _alpm_log(PM_LOG_DEBUG, _("adding entry '%s' in '%s' cache"), + _alpm_log(PM_LOG_DEBUG, "adding entry '%s' in '%s' cache", alpm_pkg_get_name(newpkg), db->treename); db->pkgcache = alpm_list_add_sorted(db->pkgcache, newpkg, _alpm_pkg_cmp); @@ -149,14 +149,14 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg) return(-1); } - _alpm_log(PM_LOG_DEBUG, _("removing entry '%s' from '%s' cache"), + _alpm_log(PM_LOG_DEBUG, "removing entry '%s' from '%s' cache", alpm_pkg_get_name(pkg), db->treename); db->pkgcache = alpm_list_remove(db->pkgcache, pkg, _alpm_pkg_cmp, &vdata); data = vdata; if(data == NULL) { /* package not found */ - _alpm_log(PM_LOG_DEBUG, _("cannot remove entry '%s' from '%s' cache: not found"), + _alpm_log(PM_LOG_DEBUG, "cannot remove entry '%s' from '%s' cache: not found", alpm_pkg_get_name(pkg), db->treename); return(-1); } @@ -178,7 +178,8 @@ pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target) alpm_list_t *pkgcache = _alpm_db_get_pkgcache(db); if(!pkgcache) { - _alpm_log(PM_LOG_DEBUG, _("error: failed to get '%s' from NULL pkgcache"), target); + _alpm_log(PM_LOG_DEBUG, "error: failed to get '%s' from NULL pkgcache", + target); return(NULL); } @@ -201,7 +202,8 @@ int _alpm_db_load_grpcache(pmdb_t *db) _alpm_db_load_pkgcache(db); } - _alpm_log(PM_LOG_DEBUG, _("loading group cache for repository '%s'"), db->treename); + _alpm_log(PM_LOG_DEBUG, "loading group cache for repository '%s'", + db->treename); for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) { const alpm_list_t *i; diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index adaba1a9..8737688b 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -65,7 +65,8 @@ static pmdepmissing_t *does_conflict(const char *target, const char *depname, /* check the actual package name, easy */ if(strcmp(alpm_pkg_get_name(pkg), conflict) == 0) { - _alpm_log(PM_LOG_DEBUG, _(" found conflict '%s' : package '%s'"), conflict, target); + _alpm_log(PM_LOG_DEBUG, " found conflict '%s' : package '%s'", + conflict, target); return(_alpm_depmiss_new(target, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, depname, NULL)); } else { @@ -74,7 +75,7 @@ static pmdepmissing_t *does_conflict(const char *target, const char *depname, const char *provision = i->data; if(strcmp(provision, conflict) == 0) { - _alpm_log(PM_LOG_DEBUG, _(" found conflict '%s' : package '%s' provides '%s'"), + _alpm_log(PM_LOG_DEBUG, " found conflict '%s' : package '%s' provides '%s'", conflict, target, provision); return(_alpm_depmiss_new(target, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, depname, NULL)); @@ -97,13 +98,13 @@ static alpm_list_t *chk_pkg_vs_db(alpm_list_t *baddeps, pmpkg_t *pkg, pmdb_t *db if(strcmp(pkgname, conflict) == 0) { /* a package cannot conflict with itself -- that's just not nice */ - _alpm_log(PM_LOG_DEBUG, _("package '%s' conflicts with itself - packaging error"), + _alpm_log(PM_LOG_DEBUG, "package '%s' conflicts with itself - packaging error", pkgname); continue; } /* CHECK 1: check targets against database */ - _alpm_log(PM_LOG_DEBUG, _("checkconflicts: target '%s' vs db"), pkgname); + _alpm_log(PM_LOG_DEBUG, "checkconflicts: target '%s' vs db", pkgname); for(j = _alpm_db_get_pkgcache(db); j; j = j->next) { pmpkg_t *dbpkg = j->data; @@ -139,13 +140,13 @@ static alpm_list_t *chk_pkg_vs_targets(alpm_list_t *baddeps, if(strcmp(pkgname, conflict) == 0) { /* a package cannot conflict with itself -- that's just not nice */ - _alpm_log(PM_LOG_DEBUG, _("package '%s' conflicts with itself - packaging error"), + _alpm_log(PM_LOG_DEBUG, "package '%s' conflicts with itself - packaging error", pkgname); continue; } /* CHECK 2: check targets against targets */ - _alpm_log(PM_LOG_DEBUG, _("checkconflicts: target '%s' vs all targets"), pkgname); + _alpm_log(PM_LOG_DEBUG, "checkconflicts: target '%s' vs all targets", pkgname); for(j = targets; j; j = j->next) { const char *targetname; @@ -177,7 +178,7 @@ static alpm_list_t *chk_db_vs_targets(alpm_list_t *baddeps, pmpkg_t *pkg, pkgname = alpm_pkg_get_name(pkg); - _alpm_log(PM_LOG_DEBUG, _("checkconflicts: db vs target '%s'"), pkgname); + _alpm_log(PM_LOG_DEBUG, "checkconflicts: db vs target '%s'", pkgname); for(i = _alpm_db_get_pkgcache(db); i; i = i->next) { alpm_list_t *conflicts = NULL; @@ -197,7 +198,7 @@ static alpm_list_t *chk_db_vs_targets(alpm_list_t *baddeps, pmpkg_t *pkg, for(j = targets; j; j = j->next) { pmpkg_t *targ = j->data; if(strcmp(alpm_pkg_get_name(targ), dbpkgname) == 0) { - _alpm_log(PM_LOG_DEBUG, _("target '%s' is also in target list, using NEW conflicts"), + _alpm_log(PM_LOG_DEBUG, "target '%s' is also in target list, using NEW conflicts", dbpkgname); conflicts = alpm_pkg_get_conflicts(targ); use_newconflicts = 1; @@ -253,7 +254,7 @@ alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages) /* debug loop */ for(i = baddeps; i; i = i->next) { pmdepmissing_t *miss = i->data; - _alpm_log(PM_LOG_DEBUG, _("\tCONFLICTS:: %s conflicts with %s"), miss->target, miss->depend.name); + _alpm_log(PM_LOG_DEBUG, "\tCONFLICTS:: %s conflicts with %s", miss->target, miss->depend.name); } return(baddeps); diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 95a1ecb3..cc489396 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -101,12 +101,12 @@ int SYMEXPORT alpm_db_unregister(pmdb_t *db) RET_ERR(PM_ERR_DB_NOT_FOUND, -1); } - _alpm_log(PM_LOG_DEBUG, _("unregistering database '%s'"), db->treename); + _alpm_log(PM_LOG_DEBUG, "unregistering database '%s'", db->treename); /* Cleanup */ _alpm_db_free_pkgcache(db); - _alpm_log(PM_LOG_DEBUG, _("closing database '%s'"), db->treename); + _alpm_log(PM_LOG_DEBUG, "closing database '%s'", db->treename); _alpm_db_close(db); _alpm_db_free(db); @@ -152,11 +152,11 @@ int SYMEXPORT alpm_db_setserver(pmdb_t *db, const char *url) return(-1); } db->servers = alpm_list_add(db->servers, server); - _alpm_log(PM_LOG_DEBUG, _("adding new server to database '%s': protocol '%s', server '%s', path '%s'"), + _alpm_log(PM_LOG_DEBUG, "adding new server to database '%s': protocol '%s', server '%s', path '%s'", db->treename, server->s_url->scheme, server->s_url->host, server->s_url->doc); } else { FREELIST(db->servers); - _alpm_log(PM_LOG_DEBUG, _("serverlist flushed for '%s'"), db->treename); + _alpm_log(PM_LOG_DEBUG, "serverlist flushed for '%s'", db->treename); } return(0); @@ -200,7 +200,7 @@ int SYMEXPORT alpm_db_update(int force, pmdb_t *db) /* get the lastupdate time */ _alpm_db_getlastupdate(db, lastupdate); if(strlen(lastupdate) == 0) { - _alpm_log(PM_LOG_DEBUG, _("failed to get lastupdate time for %s (no big deal)"), db->treename); + _alpm_log(PM_LOG_DEBUG, "failed to get lastupdate time for %s (no big deal)", db->treename); } } @@ -219,17 +219,19 @@ int SYMEXPORT alpm_db_update(int force, pmdb_t *db) } else if(ret == -1) { /* we use downloadLastErrString and downloadLastErrCode here, error returns from * libdownload */ - _alpm_log(PM_LOG_DEBUG, _("failed to sync db: %s [%d]"), downloadLastErrString, downloadLastErrCode); + _alpm_log(PM_LOG_DEBUG, "failed to sync db: %s [%d]", + downloadLastErrString, downloadLastErrCode); RET_ERR(PM_ERR_DB_SYNC, -1); } else { if(strlen(newmtime)) { - _alpm_log(PM_LOG_DEBUG, _("sync: new mtime for %s: %s"), db->treename, newmtime); + _alpm_log(PM_LOG_DEBUG, "sync: new mtime for %s: %s", + db->treename, newmtime); _alpm_db_setlastupdate(db, newmtime); } snprintf(path, PATH_MAX, "%s%s" DBEXT, dbpath, db->treename); /* remove the old dir */ - _alpm_log(PM_LOG_DEBUG, _("flushing database %s%s"), db->path); + _alpm_log(PM_LOG_DEBUG, "flushing database %s%s", db->path); for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) { pmpkg_t *pkg = lp->data; if(pkg && _alpm_db_remove(db, pkg) == -1) { @@ -413,7 +415,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_upgrades() /* TODO holy nested loops, Batman! */ /* check for "recommended" package replacements */ - _alpm_log(PM_LOG_DEBUG, _("checking for package replacements")); + _alpm_log(PM_LOG_DEBUG, "checking for package replacements"); for(i = handle->dbs_sync; i; i = i->next) { for(j = _alpm_db_get_pkgcache(i->data); j; j = j->next) { pmpkg_t *spkg = j->data; @@ -424,8 +426,8 @@ alpm_list_t SYMEXPORT *alpm_db_get_upgrades() pmpkg_t *lpkg = m->data; if(strcmp(k->data, alpm_pkg_get_name(lpkg)) == 0) { - _alpm_log(PM_LOG_DEBUG, _("checking replacement '%s' for package '%s'"), k->data, - alpm_pkg_get_name(spkg)); + _alpm_log(PM_LOG_DEBUG, "checking replacement '%s' for package '%s'", + k->data, alpm_pkg_get_name(spkg)); if(alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(lpkg))) { _alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (to be replaced by %s-%s)"), alpm_pkg_get_name(lpkg), alpm_pkg_get_version(lpkg), @@ -457,7 +459,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_upgrades() sync->data = alpm_list_add(NULL, dummy); syncpkgs = alpm_list_add(syncpkgs, sync); } - _alpm_log(PM_LOG_DEBUG, _("%s-%s elected for upgrade (to be replaced by %s-%s)"), + _alpm_log(PM_LOG_DEBUG, "%s-%s elected for upgrade (to be replaced by %s-%s)", alpm_pkg_get_name(lpkg), alpm_pkg_get_version(lpkg), alpm_pkg_get_name(spkg), alpm_pkg_get_version(spkg)); } @@ -479,7 +481,8 @@ alpm_list_t SYMEXPORT *alpm_db_get_upgrades() spkg = _alpm_db_get_pkgfromcache(j->data, alpm_pkg_get_name(local)); } if(spkg == NULL) { - _alpm_log(PM_LOG_DEBUG, _("'%s' not found in sync db -- skipping"), alpm_pkg_get_name(local)); + _alpm_log(PM_LOG_DEBUG, "'%s' not found in sync db -- skipping", + alpm_pkg_get_name(local)); continue; } @@ -493,13 +496,13 @@ alpm_list_t SYMEXPORT *alpm_db_get_upgrades() } } if(replace) { - _alpm_log(PM_LOG_DEBUG, _("'%s' is already elected for removal -- skipping"), + _alpm_log(PM_LOG_DEBUG, "'%s' is already elected for removal -- skipping", alpm_pkg_get_name(local)); continue; } if(alpm_pkg_compare_versions(local, spkg)) { - _alpm_log(PM_LOG_DEBUG, _("%s elected for upgrade (%s => %s)"), + _alpm_log(PM_LOG_DEBUG, "%s elected for upgrade (%s => %s)", alpm_pkg_get_name(local), alpm_pkg_get_version(local), alpm_pkg_get_version(spkg)); @@ -663,13 +666,13 @@ pmdb_t *_alpm_db_register(const char *treename) for(i = handle->dbs_sync; i; i = i->next) { pmdb_t *sdb = i->data; if(strcmp(treename, sdb->treename) == 0) { - _alpm_log(PM_LOG_DEBUG, _("attempt to re-register the '%s' database, using existing"), sdb->treename); + _alpm_log(PM_LOG_DEBUG, "attempt to re-register the '%s' database, using existing", sdb->treename); return sdb; } } } - _alpm_log(PM_LOG_DEBUG, _("registering database '%s'"), treename); + _alpm_log(PM_LOG_DEBUG, "registering database '%s'", treename); /* make sure the database directory exists */ dbpath = alpm_option_get_dbpath(); @@ -679,7 +682,7 @@ pmdb_t *_alpm_db_register(const char *treename) } snprintf(path, PATH_MAX, "%s%s", dbpath, treename); if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) { - _alpm_log(PM_LOG_DEBUG, _("database directory '%s' does not exist, creating it"), + _alpm_log(PM_LOG_DEBUG, "database dir '%s' does not exist, creating it", path); if(_alpm_makepath(path) != 0) { RET_ERR(PM_ERR_SYSTEM, NULL); @@ -691,7 +694,7 @@ pmdb_t *_alpm_db_register(const char *treename) RET_ERR(PM_ERR_DB_CREATE, NULL); } - _alpm_log(PM_LOG_DEBUG, _("opening database '%s'"), db->treename); + _alpm_log(PM_LOG_DEBUG, "opening database '%s'", db->treename); if(_alpm_db_open(db) == -1) { _alpm_db_free(db); RET_ERR(PM_ERR_DB_OPEN, NULL); diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 794fbdbc..591e5a87 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -140,7 +140,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode) return(NULL); } - _alpm_log(PM_LOG_DEBUG, _("started sorting dependencies")); + _alpm_log(PM_LOG_DEBUG, "started sorting dependencies"); /* We create the vertices */ for(i = targets; i; i = i->next) { @@ -203,7 +203,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode) } } - _alpm_log(PM_LOG_DEBUG, _("sorting dependencies finished")); + _alpm_log(PM_LOG_DEBUG, "sorting dependencies finished"); if(mode == PM_TRANS_TYPE_REMOVE) { /* we're removing packages, so reverse the order */ @@ -246,12 +246,12 @@ alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op, pmpkg_t *newpkg = i->data; pmpkg_t *oldpkg; if(newpkg == NULL) { - _alpm_log(PM_LOG_DEBUG, _("null package found in package list")); + _alpm_log(PM_LOG_DEBUG, "null package found in package list"); continue; } if((oldpkg = _alpm_db_get_pkgfromcache(db, alpm_pkg_get_name(newpkg))) == NULL) { - _alpm_log(PM_LOG_DEBUG, _("cannot find package installed '%s'"), + _alpm_log(PM_LOG_DEBUG, "cannot find package installed '%s'", alpm_pkg_get_name(newpkg)); continue; } @@ -284,7 +284,7 @@ alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op, pmpkg_t *pkg = l->data; if(alpm_depcmp(pkg, depend)) { - _alpm_log(PM_LOG_DEBUG, _("checkdeps: dependency '%s' has moved from '%s' to '%s'"), + _alpm_log(PM_LOG_DEBUG, "checkdeps: dependency '%s' has moved from '%s' to '%s'", depend->name, alpm_pkg_get_name(oldpkg), alpm_pkg_get_name(pkg)); satisfied = 1; break; @@ -300,7 +300,7 @@ alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op, if(alpm_depcmp(pkg, depend) && !_alpm_pkg_find(alpm_pkg_get_name(pkg), packages)) { /* we ignore packages that will be updated because we know * that the updated ones don't satisfy depend */ - _alpm_log(PM_LOG_DEBUG, _("checkdeps: dependency '%s' satisfied by installed package '%s'"), + _alpm_log(PM_LOG_DEBUG, "checkdeps: dependency '%s' satisfied by installed package '%s'", depend->name, alpm_pkg_get_name(pkg)); satisfied = 1; break; @@ -309,7 +309,7 @@ alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op, } if(!satisfied) { - _alpm_log(PM_LOG_DEBUG, _("checkdeps: updated '%s' won't satisfy a dependency of '%s'"), + _alpm_log(PM_LOG_DEBUG, "checkdeps: updated '%s' won't satisfy a dependency of '%s'", alpm_pkg_get_name(oldpkg), alpm_pkg_get_name(p)); miss = _alpm_depmiss_new(p->name, PM_DEP_TYPE_DEPEND, depend->mod, depend->name, depend->version); @@ -330,7 +330,7 @@ alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op, for(i = packages; i; i = i->next) { pmpkg_t *tp = i->data; if(tp == NULL) { - _alpm_log(PM_LOG_DEBUG, _("null package found in package list")); + _alpm_log(PM_LOG_DEBUG, "null package found in package list"); continue; } @@ -358,7 +358,7 @@ alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op, /* else if still not found... */ if(!found) { - _alpm_log(PM_LOG_DEBUG, _("missing dependency '%s' for package '%s'"), + _alpm_log(PM_LOG_DEBUG, "missing dependency '%s' for package '%s'", depend->name, alpm_pkg_get_name(tp)); miss = _alpm_depmiss_new(alpm_pkg_get_name(tp), PM_DEP_TYPE_DEPEND, depend->mod, depend->name, depend->version); @@ -377,7 +377,7 @@ alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op, pmpkg_t *rmpkg = alpm_list_getdata(i); if(rmpkg == NULL) { - _alpm_log(PM_LOG_DEBUG, _("null package found in package list")); + _alpm_log(PM_LOG_DEBUG, "null package found in package list"); continue; } for(j = alpm_pkg_get_requiredby(rmpkg); j; j = j->next) { @@ -404,7 +404,7 @@ alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op, for(l = _alpm_db_get_pkgcache(db); l; l = l->next) { pmpkg_t *pkg = l->data; if(alpm_depcmp(pkg, depend) && !_alpm_pkg_find(alpm_pkg_get_name(pkg), packages)) { - _alpm_log(PM_LOG_DEBUG, _("checkdeps: dependency '%s' satisfied by installed package '%s'"), + _alpm_log(PM_LOG_DEBUG, "checkdeps: dependency '%s' satisfied by installed package '%s'", depend->name, alpm_pkg_get_name(pkg)); satisfied = 1; break; @@ -412,7 +412,7 @@ alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op, } if(!satisfied) { - _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s which requires %s"), + _alpm_log(PM_LOG_DEBUG, "checkdeps: found %s which requires %s", alpm_pkg_get_name(p), alpm_pkg_get_name(rmpkg)); miss = _alpm_depmiss_new(alpm_pkg_get_name(p), PM_DEP_TYPE_DEPEND, depend->mod, depend->name, @@ -495,7 +495,8 @@ static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets) /* see if it was explicitly installed */ if(alpm_pkg_get_reason(pkg) == PM_PKG_REASON_EXPLICIT) { - _alpm_log(PM_LOG_DEBUG, _("excluding %s -- explicitly installed"), alpm_pkg_get_name(pkg)); + _alpm_log(PM_LOG_DEBUG, "excluding %s -- explicitly installed", + alpm_pkg_get_name(pkg)); return(0); } @@ -542,7 +543,7 @@ alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs) alpm_list_t *provides = _alpm_db_whatprovides(db, depend->name); if(!provides) { /* Not found, that's fine, carry on */ - _alpm_log(PM_LOG_DEBUG, _("cannot find package \"%s\" or anything that provides it!"), depend->name); + _alpm_log(PM_LOG_DEBUG, "cannot find package \"%s\" or anything that provides it!", depend->name); continue; } for(k = provides; k; k = k->next) { @@ -550,7 +551,8 @@ alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs) if(can_remove_package(db, provpkg, newtargs)) { pmpkg_t *pkg = _alpm_pkg_dup(provpkg); - _alpm_log(PM_LOG_DEBUG, _("adding '%s' to the targets"), alpm_pkg_get_name(pkg)); + _alpm_log(PM_LOG_DEBUG, "adding '%s' to the targets", + alpm_pkg_get_name(pkg)); /* add it to the target list */ newtargs = alpm_list_add(newtargs, pkg); @@ -561,7 +563,8 @@ alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs) } else if(can_remove_package(db, deppkg, newtargs)) { pmpkg_t *pkg = _alpm_pkg_dup(deppkg); - _alpm_log(PM_LOG_DEBUG, _("adding '%s' to the targets"), alpm_pkg_get_name(pkg)); + _alpm_log(PM_LOG_DEBUG, "adding '%s' to the targets", + alpm_pkg_get_name(pkg)); /* add it to the target list */ newtargs = alpm_list_add(newtargs, pkg); @@ -593,7 +596,7 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, return(-1); } - _alpm_log(PM_LOG_DEBUG, _("started resolving dependencies")); + _alpm_log(PM_LOG_DEBUG, "started resolving dependencies"); targ = alpm_list_add(NULL, syncpkg); deps = _alpm_checkdeps(local, PM_TRANS_TYPE_ADD, targ); alpm_list_free(targ); @@ -611,7 +614,7 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, for(j = list; j && !found; j = j->next) { pmpkg_t *sp = j->data; if(alpm_list_find_str(alpm_pkg_get_provides(sp), miss->depend.name)) { - _alpm_log(PM_LOG_DEBUG, _("%s provides dependency %s -- skipping"), + _alpm_log(PM_LOG_DEBUG, "%s provides dependency %s -- skipping", alpm_pkg_get_name(sp), miss->depend.name); found = 1; } @@ -657,7 +660,7 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, } if(_alpm_pkg_find(alpm_pkg_get_name(sync), list)) { /* this dep is already in the target list */ - _alpm_log(PM_LOG_DEBUG, _("dependency %s is already in the target list -- skipping"), + _alpm_log(PM_LOG_DEBUG, "dependency %s is already in the target list -- skipping", alpm_pkg_get_name(sync)); continue; } @@ -677,7 +680,7 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, if(_alpm_resolvedeps(local, dbs_sync, sync, list, trail, trans, data)) { goto error; } - _alpm_log(PM_LOG_DEBUG, _("pulling dependency %s (needed by %s)"), + _alpm_log(PM_LOG_DEBUG, "pulling dependency %s (needed by %s)", alpm_pkg_get_name(sync), alpm_pkg_get_name(syncpkg)); list = alpm_list_add(list, sync); } else { @@ -697,11 +700,11 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, } } else { /* cycle detected -- skip it */ - _alpm_log(PM_LOG_DEBUG, _("dependency cycle detected: %s"), sync->name); + _alpm_log(PM_LOG_DEBUG, "dependency cycle detected: %s", sync->name); } } - _alpm_log(PM_LOG_DEBUG, _("finished resolving dependencies")); + _alpm_log(PM_LOG_DEBUG, "finished resolving dependencies"); FREELIST(deps); diff --git a/lib/libalpm/error.h b/lib/libalpm/error.h index 6294f05b..e21a5f60 100644 --- a/lib/libalpm/error.h +++ b/lib/libalpm/error.h @@ -22,7 +22,7 @@ #define _ALPM_ERROR_H #define RET_ERR(err, ret) do { pm_errno = (err); \ - _alpm_log(PM_LOG_DEBUG, _("returning error %d from %s : %s\n"), err, __func__, alpm_strerror(err)); \ + _alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerror(err)); \ return(ret); } while(0) #endif /* _ALPM_ERROR_H */ diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index b1fd45f2..759c14cf 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -153,6 +153,7 @@ void SYMEXPORT alpm_option_set_root(const char *root) if(realroot) { free(realroot); } + _alpm_log(PM_LOG_DEBUG, "option 'root' = %s", handle->root); } void SYMEXPORT alpm_option_set_dbpath(const char *dbpath) @@ -170,11 +171,13 @@ void SYMEXPORT alpm_option_set_dbpath(const char *dbpath) handle->dbpath = calloc(dbpathlen+1, sizeof(char)); strncpy(handle->dbpath, dbpath, dbpathlen); handle->dbpath[dbpathlen-1] = '/'; + _alpm_log(PM_LOG_DEBUG, "option 'dbpath' = %s", handle->dbpath); const char *lf = "db.lck"; int lockfilelen = strlen(handle->dbpath) + strlen(lf); handle->lockfile = calloc(lockfilelen + 1, sizeof(char)); snprintf(handle->lockfile, lockfilelen, "%s%s", handle->dbpath, lf); + _alpm_log(PM_LOG_DEBUG, "option 'lockfile' = %s", handle->lockfile); } } @@ -194,7 +197,7 @@ void SYMEXPORT alpm_option_add_cachedir(const char *cachedir) strncpy(newcachedir, cachedir, cachedirlen); newcachedir[cachedirlen-1] = '/'; handle->cachedirs = alpm_list_add(handle->cachedirs, newcachedir); - _alpm_log(PM_LOG_DEBUG, _("option 'cachedir' = %s"), newcachedir); + _alpm_log(PM_LOG_DEBUG, "option 'cachedir' = %s", newcachedir); } } diff --git a/lib/libalpm/md5driver.c b/lib/libalpm/md5driver.c index e2821bf0..caeddc14 100644 --- a/lib/libalpm/md5driver.c +++ b/lib/libalpm/md5driver.c @@ -84,7 +84,7 @@ char* _alpm_MDFile(char *filename) strncat(ret, hex, 2); } - _alpm_log(PM_LOG_DEBUG, _("md5(%s) = %s"), filename, ret); + _alpm_log(PM_LOG_DEBUG, "md5(%s) = %s", filename, ret); return(ret); } return(NULL); diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 8a3f6ea1..eb12ae1a 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -132,7 +132,7 @@ int alpm_pkg_checksha1sum(pmpkg_t *pkg) retval = -1; } else { if(strcmp(sha1sum, alpm_pkg_get_sha1sum(pkg)) == 0) { - _alpm_log(PM_LOG_DEBUG, _("sha1sums for package %s-%s match"), + _alpm_log(PM_LOG_DEBUG, "sha1sums for package %s-%s match", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg)); } else { _alpm_log(PM_LOG_ERROR, _("sha1sums do not match for package %s-%s"), @@ -183,7 +183,7 @@ int alpm_pkg_checkmd5sum(pmpkg_t *pkg) retval = -1; } else { if(strcmp(md5sum, alpm_pkg_get_md5sum(pkg)) == 0) { - _alpm_log(PM_LOG_DEBUG, _("md5sums for package %s-%s match"), + _alpm_log(PM_LOG_DEBUG, "md5sums for package %s-%s match", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg)); } else { _alpm_log(PM_LOG_ERROR, _("md5sums do not match for package %s-%s"), @@ -430,7 +430,7 @@ static int parse_descfile(const char *descfile, pmpkg_t *info) ptr = line; key = strsep(&ptr, "="); if(key == NULL || ptr == NULL) { - _alpm_log(PM_LOG_DEBUG, _("%s: syntax error in description file line %d"), + _alpm_log(PM_LOG_DEBUG, "%s: syntax error in description file line %d", info->name[0] != '\0' ? info->name : "error", linenum); } else { _alpm_strtrim(key); @@ -487,7 +487,7 @@ static int parse_descfile(const char *descfile, pmpkg_t *info) } else if(!strcmp(key, "BACKUP")) { info->backup = alpm_list_add(info->backup, strdup(ptr)); } else { - _alpm_log(PM_LOG_DEBUG, _("%s: syntax error in description file line %d"), + _alpm_log(PM_LOG_DEBUG, "%s: syntax error in description file line %d", info->name[0] != '\0' ? info->name : "error", linenum); } } @@ -780,7 +780,7 @@ void _alpm_pkg_update_requiredby(pmpkg_t *pkg) free(dep); if(satisfies) { alpm_list_t *reqs = alpm_pkg_get_requiredby(pkg); - _alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s'"), + _alpm_log(PM_LOG_DEBUG, "adding '%s' in requiredby field for '%s'", cachepkgname, pkg->name); reqs = alpm_list_add(reqs, strdup(cachepkgname)); pkg->requiredby = reqs; diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 1a0b2d5e..57e452d6 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -68,7 +68,7 @@ int _alpm_remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) if((info = _alpm_db_scan(db, name)) == NULL) { /* Unimportant - just ignore it if we can't find it */ - _alpm_log(PM_LOG_DEBUG, _("could not find %s in database"), name); + _alpm_log(PM_LOG_DEBUG, "could not find %s in database", name); RET_ERR(PM_ERR_PKG_NOT_FOUND, -1); } @@ -82,7 +82,7 @@ int _alpm_remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) } } - _alpm_log(PM_LOG_DEBUG, _("adding %s in the targets list"), info->name); + _alpm_log(PM_LOG_DEBUG, "adding %s in the targets list", info->name); trans->packages = alpm_list_add(trans->packages, info); return(0); @@ -100,7 +100,7 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) if(!(trans->flags & (PM_TRANS_FLAG_NODEPS)) && (trans->type != PM_TRANS_TYPE_UPGRADE)) { EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL); - _alpm_log(PM_LOG_DEBUG, _("looking for unsatisfied dependencies")); + _alpm_log(PM_LOG_DEBUG, "looking for unsatisfied dependencies"); lp = _alpm_checkdeps(db, trans->type, trans->packages); if(lp != NULL) { if(trans->flags & PM_TRANS_FLAG_CASCADE) { @@ -110,7 +110,8 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) pmdepmissing_t *miss = (pmdepmissing_t *)i->data; pmpkg_t *info = _alpm_db_scan(db, miss->target); if(info) { - _alpm_log(PM_LOG_DEBUG, _("pulling %s in the targets list"), alpm_pkg_get_name(info)); + _alpm_log(PM_LOG_DEBUG, "pulling %s in the targets list", + alpm_pkg_get_name(info)); trans->packages = alpm_list_add(trans->packages, info); } else { _alpm_log(PM_LOG_ERROR, _("could not find %s in database -- skipping"), @@ -131,12 +132,12 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) } if(trans->flags & PM_TRANS_FLAG_RECURSE) { - _alpm_log(PM_LOG_DEBUG, _("finding removable dependencies")); + _alpm_log(PM_LOG_DEBUG, "finding removable dependencies"); trans->packages = _alpm_removedeps(db, trans->packages); } /* re-order w.r.t. dependencies */ - _alpm_log(PM_LOG_DEBUG, _("sorting by dependencies")); + _alpm_log(PM_LOG_DEBUG, "sorting by dependencies"); lp = _alpm_sortbydeps(trans->packages, PM_TRANS_TYPE_REMOVE); /* free the old alltargs */ alpm_list_free(trans->packages); @@ -204,29 +205,29 @@ static void unlink_file(pmpkg_t *info, alpm_list_t *lp, alpm_list_t *targ, if(trans->type == PM_TRANS_TYPE_UPGRADE) { /* check noupgrade */ if(alpm_list_find_str(handle->noupgrade, lp->data)) { - _alpm_log(PM_LOG_DEBUG, _("Skipping removal of '%s' due to NoUpgrade"), file); + _alpm_log(PM_LOG_DEBUG, "Skipping removal of '%s' due to NoUpgrade", file); return; } } if(lstat(file, &buf)) { - _alpm_log(PM_LOG_DEBUG, _("file %s does not exist"), file); + _alpm_log(PM_LOG_DEBUG, "file %s does not exist", file); return; } if(S_ISDIR(buf.st_mode)) { if(rmdir(file)) { /* this is okay, other pakcages are probably using it (like /usr) */ - _alpm_log(PM_LOG_DEBUG, _("keeping directory %s"), file); + _alpm_log(PM_LOG_DEBUG, "keeping directory %s", file); } else { - _alpm_log(PM_LOG_DEBUG, _("removing directory %s"), file); + _alpm_log(PM_LOG_DEBUG, "removing directory %s", file); } } else { /* check the remove skip list before removing the file. * see the big comment block in db_find_conflicts() for an * explanation. */ if(alpm_list_find_str(trans->skip_remove, file)) { - _alpm_log(PM_LOG_DEBUG, _("%s is in trans->skip_remove, skipping removal"), file); + _alpm_log(PM_LOG_DEBUG, "%s is in trans->skip_remove, skipping removal", file); return; } else if(needbackup) { /* if the file is flagged, back it up to .pacsave */ @@ -240,11 +241,11 @@ static void unlink_file(pmpkg_t *info, alpm_list_t *lp, alpm_list_t *targ, _alpm_log(PM_LOG_WARNING, _("%s saved as %s"), file, newpath); return; } else { - _alpm_log(PM_LOG_DEBUG, _("transaction is set to NOSAVE, not backing up '%s'"), file); + _alpm_log(PM_LOG_DEBUG, "transaction is set to NOSAVE, not backing up '%s'", file); } } } - _alpm_log(PM_LOG_DEBUG, _("unlinking %s"), file); + _alpm_log(PM_LOG_DEBUG, "unlinking %s", file); int list_count = alpm_list_count(trans->packages); /* this way we don't have to call alpm_list_count twice during PROGRESS */ PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, (double)(percent * 100), list_count, (list_count - alpm_list_count(targ) + 1)); @@ -284,7 +285,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db) if(trans->type != PM_TRANS_TYPE_UPGRADE) { EVENT(trans, PM_TRANS_EVT_REMOVE_START, info, NULL); - _alpm_log(PM_LOG_DEBUG, _("removing package %s-%s"), + _alpm_log(PM_LOG_DEBUG, "removing package %s-%s", pkgname, alpm_pkg_get_version(info)); /* run the pre-remove scriptlet if it exists */ @@ -299,14 +300,14 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db) if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) { for(lp = files; lp; lp = lp->next) { if(!can_remove_file(trans, lp->data)) { - _alpm_log(PM_LOG_DEBUG, _("not removing package '%s', can't remove all files"), + _alpm_log(PM_LOG_DEBUG, "not removing package '%s', can't remove all files", pkgname); RET_ERR(PM_ERR_PKG_CANT_REMOVE, -1); } } int filenum = alpm_list_count(files); - _alpm_log(PM_LOG_DEBUG, _("removing %d files"), filenum); + _alpm_log(PM_LOG_DEBUG, "removing %d files", filenum); /* iterate through the list backwards, unlinking files */ for(lp = alpm_list_last(files); lp; lp = lp->prev) { @@ -331,8 +332,8 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db) infodup = _alpm_pkg_dup(info); /* remove the package from the database */ - _alpm_log(PM_LOG_DEBUG, _("updating database")); - _alpm_log(PM_LOG_DEBUG, _("removing database entry '%s'"), pkgname); + _alpm_log(PM_LOG_DEBUG, "updating database"); + _alpm_log(PM_LOG_DEBUG, "removing database entry '%s'", pkgname); if(_alpm_db_remove(db, info) == -1) { _alpm_log(PM_LOG_ERROR, _("could not remove database entry %s-%s"), pkgname, alpm_pkg_get_version(info)); @@ -355,7 +356,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db) /* run ldconfig if it exists */ if((trans->type != PM_TRANS_TYPE_UPGRADE) && (handle->trans->state != STATE_INTERRUPTED)) { - _alpm_log(PM_LOG_DEBUG, _("running \"ldconfig -r %s\""), handle->root); + _alpm_log(PM_LOG_DEBUG, "running \"ldconfig -r %s\"", handle->root); _alpm_ldconfig(handle->root); } diff --git a/lib/libalpm/server.c b/lib/libalpm/server.c index 5b41a808..ddc6674a 100644 --- a/lib/libalpm/server.c +++ b/lib/libalpm/server.c @@ -117,7 +117,8 @@ static char *strip_filename(pmserver_t *server) p = strrchr(server->s_url->doc, '/'); if(p && *(++p)) { fname = strdup(p); - _alpm_log(PM_LOG_DEBUG, _("stripping '%s' from '%s'"), fname, server->s_url->doc); + _alpm_log(PM_LOG_DEBUG, "stripping '%s' from '%s'", + fname, server->s_url->doc); *p = 0; } @@ -216,7 +217,7 @@ int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath, /* just use the raw filename if we can't find crap */ strncpy(pkgname, fn, PKG_NAME_LEN); } - _alpm_log(PM_LOG_DEBUG, _("using '%s' for download progress"), pkgname); + _alpm_log(PM_LOG_DEBUG, "using '%s' for download progress", pkgname); snprintf(realfile, PATH_MAX, "%s%s", localpath, fn); snprintf(output, PATH_MAX, "%s%s.part", localpath, fn); @@ -232,7 +233,7 @@ int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath, int chk_resume = 0; if(stat(output, &st) == 0 && st.st_size > 0) { - _alpm_log(PM_LOG_DEBUG, _("existing file found, using it")); + _alpm_log(PM_LOG_DEBUG, "existing file found, using it"); fileurl->offset = (off_t)st.st_size; dltotal_bytes = st.st_size; localf = fopen(output, "a"); @@ -259,14 +260,14 @@ int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath, /* try the next server */ continue; } else { - _alpm_log(PM_LOG_DEBUG, _("connected to %s successfully"), fileurl->host); + _alpm_log(PM_LOG_DEBUG, "connected to %s successfully", fileurl->host); } if(ust.mtime && mtime1) { char strtime[15]; _alpm_time2string(ust.mtime, strtime); if(strcmp(mtime1, strtime) == 0) { - _alpm_log(PM_LOG_DEBUG, _("mtimes are identical, skipping %s"), fn); + _alpm_log(PM_LOG_DEBUG, "mtimes are identical, skipping %s", fn); complete = alpm_list_add(complete, fn); if(localf != NULL) { fclose(localf); @@ -383,14 +384,14 @@ int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath, return(PM_ERR_CONNECT_FAILED); } /* execute the parsed command via /bin/sh -c */ - _alpm_log(PM_LOG_DEBUG, _("running command: %s"), parsedCmd); + _alpm_log(PM_LOG_DEBUG, "running command: %s", parsedCmd); ret = system(parsedCmd); if(ret == -1) { _alpm_log(PM_LOG_WARNING, _("running XferCommand: fork failed!")); return(PM_ERR_FORK_FAILED); } else if(ret != 0) { /* download failed */ - _alpm_log(PM_LOG_DEBUG, _("XferCommand command returned non-zero status code (%d)"), ret); + _alpm_log(PM_LOG_DEBUG, "XferCommand command returned non-zero status code (%d)", ret); } else { /* download was successful */ complete = alpm_list_add(complete, fn); @@ -433,7 +434,7 @@ char *_alpm_fetch_pkgurl(const char *target) /* do not download the file if it exists in the current dir */ if(stat(filename, &st) == 0) { - _alpm_log(PM_LOG_DEBUG, _("%s has already been downloaded"), filename); + _alpm_log(PM_LOG_DEBUG, "%s has already been downloaded", filename); } else { alpm_list_t *servers = alpm_list_add(NULL, server); alpm_list_t *files = alpm_list_add(NULL, filename); @@ -442,7 +443,7 @@ char *_alpm_fetch_pkgurl(const char *target) _alpm_log(PM_LOG_WARNING, _("failed to download %s"), target); return(NULL); } - _alpm_log(PM_LOG_DEBUG, _("successfully downloaded %s"), filename); + _alpm_log(PM_LOG_DEBUG, "successfully downloaded %s", filename); alpm_list_free(files); alpm_list_free(servers); } diff --git a/lib/libalpm/sha1.c b/lib/libalpm/sha1.c index 1adf067b..a164a893 100644 --- a/lib/libalpm/sha1.c +++ b/lib/libalpm/sha1.c @@ -421,7 +421,7 @@ char* _alpm_SHAFile(char *filename) { snprintf(hex, 3, "%02x", digest[i]); strncat(ret, hex, 2); } - _alpm_log(PM_LOG_DEBUG, _("sha1(%s) = %s"), filename, ret); + _alpm_log(PM_LOG_DEBUG, "sha1(%s) = %s", filename, ret); return(ret); } diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index d50d6cfa..e5f00bd6 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -104,7 +104,7 @@ static int find_replacements(pmtrans_t *trans, pmdb_t *db_local, ALPM_LOG_FUNC; /* check for "recommended" package replacements */ - _alpm_log(PM_LOG_DEBUG, _("checking for package replacements")); + _alpm_log(PM_LOG_DEBUG, "checking for package replacements"); for(i = dbs_sync; i; i = i->next) { pmdb_t *db = i->data; @@ -120,7 +120,8 @@ static int find_replacements(pmtrans_t *trans, pmdb_t *db_local, continue; } - _alpm_log(PM_LOG_DEBUG, _("checking replacement '%s' for package '%s'"), replacement, spkg->name); + _alpm_log(PM_LOG_DEBUG, "checking replacement '%s' for package '%s'", + replacement, spkg->name); /* ignore if EITHER the local or replacement package are to be ignored */ if(alpm_list_find_str(handle->ignorepkg, spkg->name) || alpm_list_find_str(handle->ignorepkg, lpkg->name)) { @@ -159,7 +160,7 @@ static int find_replacements(pmtrans_t *trans, pmdb_t *db_local, sync->data = alpm_list_add(NULL, dummy); trans->packages = alpm_list_add(trans->packages, sync); } - _alpm_log(PM_LOG_DEBUG, _("%s-%s elected for upgrade (to be replaced by %s-%s)"), + _alpm_log(PM_LOG_DEBUG, "%s-%s elected for upgrade (to be replaced by %s-%s)", alpm_pkg_get_name(lpkg), alpm_pkg_get_version(lpkg), alpm_pkg_get_name(spkg), alpm_pkg_get_version(spkg)); } @@ -182,7 +183,7 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s /* check for "recommended" package replacements */ if(find_replacements(trans, db_local, dbs_sync) == 0) { /* match installed packages with the sync dbs and compare versions */ - _alpm_log(PM_LOG_DEBUG, _("checking for package upgrades")); + _alpm_log(PM_LOG_DEBUG, "checking for package upgrades"); for(i = _alpm_db_get_pkgcache(db_local); i; i = i->next) { int replace=0; pmpkg_t *local = i->data; @@ -193,7 +194,8 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s spkg = _alpm_db_get_pkgfromcache(j->data, alpm_pkg_get_name(local)); } if(spkg == NULL) { - _alpm_log(PM_LOG_DEBUG, _("'%s' not found in sync db -- skipping"), alpm_pkg_get_name(local)); + _alpm_log(PM_LOG_DEBUG, "'%s' not found in sync db -- skipping", + alpm_pkg_get_name(local)); continue; } @@ -207,14 +209,14 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s } } if(replace) { - _alpm_log(PM_LOG_DEBUG, _("'%s' is already elected for removal -- skipping"), + _alpm_log(PM_LOG_DEBUG, "'%s' is already elected for removal -- skipping", alpm_pkg_get_name(local)); continue; } /* compare versions and see if we need to upgrade */ if(alpm_pkg_compare_versions(local, spkg)) { - _alpm_log(PM_LOG_DEBUG, _("%s-%s elected for upgrade (%s => %s)"), + _alpm_log(PM_LOG_DEBUG, "%s-%s elected for upgrade (%s => %s)", alpm_pkg_get_name(local), alpm_pkg_get_version(local), alpm_pkg_get_name(spkg), alpm_pkg_get_version(spkg)); if(!_alpm_sync_find(trans->packages, alpm_pkg_get_name(spkg))) { @@ -269,7 +271,7 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy if(targ) { *targ = '\0'; targ++; - _alpm_log(PM_LOG_DEBUG, _("searching for target in repo '%s'"), targ); + _alpm_log(PM_LOG_DEBUG, "searching for target in repo '%s'", targ); for(j = dbs_sync; j && !spkg; j = j->next) { pmdb_t *db = j->data; if(strcmp(db->treename, targline) == 0) { @@ -277,12 +279,12 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy spkg = _alpm_db_get_pkgfromcache(db, targ); if(spkg == NULL) { /* Search provides */ - _alpm_log(PM_LOG_DEBUG, _("target '%s' not found -- looking for provisions"), targ); + _alpm_log(PM_LOG_DEBUG, "target '%s' not found -- looking for provisions", targ); alpm_list_t *p = _alpm_db_whatprovides(db, targ); if(!p) { RET_ERR(PM_ERR_PKG_NOT_FOUND, -1); } - _alpm_log(PM_LOG_DEBUG, _("found '%s' as a provision for '%s'"), p->data, targ); + _alpm_log(PM_LOG_DEBUG, "found '%s' as a provision for '%s'", p->data, targ); spkg = _alpm_db_get_pkgfromcache(db, p->data); alpm_list_free(p); } @@ -300,12 +302,12 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy } if(spkg == NULL) { /* Search provides */ - _alpm_log(PM_LOG_DEBUG, _("target '%s' not found -- looking for provisions"), targ); + _alpm_log(PM_LOG_DEBUG, "target '%s' not found -- looking for provisions", targ); for(j = dbs_sync; j && !spkg; j = j->next) { pmdb_t *db = j->data; alpm_list_t *p = _alpm_db_whatprovides(db, targ); if(p) { - _alpm_log(PM_LOG_DEBUG, _("found '%s' as a provision for '%s'"), p->data, targ); + _alpm_log(PM_LOG_DEBUG, "found '%s' as a provision for '%s'", p->data, targ); spkg = _alpm_db_get_pkgfromcache(db, p->data); alpm_list_free(p); } @@ -353,7 +355,7 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy _alpm_pkg_free(dummy); RET_ERR(PM_ERR_MEMORY, -1); } - _alpm_log(PM_LOG_DEBUG, _("adding target '%s' to the transaction set"), + _alpm_log(PM_LOG_DEBUG, "adding target '%s' to the transaction set", alpm_pkg_get_name(spkg)); trans->packages = alpm_list_add(trans->packages, sync); } @@ -400,7 +402,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { /* Resolve targets dependencies */ EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_START, NULL, NULL); - _alpm_log(PM_LOG_DEBUG, _("resolving target's dependencies")); + _alpm_log(PM_LOG_DEBUG, "resolving target's dependencies"); for(i = trans->packages; i; i = i->next) { pmpkg_t *spkg = ((pmsyncpkg_t *)i->data)->pkg; if(_alpm_resolvedeps(db_local, dbs_sync, spkg, list, @@ -421,7 +423,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync goto cleanup; } trans->packages = alpm_list_add(trans->packages, sync); - _alpm_log(PM_LOG_DEBUG, _("adding package %s-%s to the transaction targets"), + _alpm_log(PM_LOG_DEBUG, "adding package %s-%s to the transaction targets", alpm_pkg_get_name(spkg), alpm_pkg_get_version(spkg)); } else { /* remove the original targets from the list if requested */ @@ -461,7 +463,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_DONE, NULL, NULL); - _alpm_log(PM_LOG_DEBUG, _("looking for unresolvable dependencies")); + _alpm_log(PM_LOG_DEBUG, "looking for unresolvable dependencies"); deps = _alpm_checkdeps(db_local, PM_TRANS_TYPE_UPGRADE, list); if(deps) { if(data) { @@ -481,7 +483,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync /* check for inter-conflicts and whatnot */ EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL); - _alpm_log(PM_LOG_DEBUG, _("looking for conflicts")); + _alpm_log(PM_LOG_DEBUG, "looking for conflicts"); deps = _alpm_checkconflicts(db_local, list); if(deps) { int errorout = 0; @@ -492,7 +494,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync pmsyncpkg_t *sync; pmpkg_t *found = NULL; - _alpm_log(PM_LOG_DEBUG, _("package '%s' conflicts with '%s'"), + _alpm_log(PM_LOG_DEBUG, "package '%s' conflicts with '%s'", miss->target, miss->depend.name); /* check if the conflicting package is about to be removed/replaced. * if so, then just ignore it. */ @@ -503,14 +505,14 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync } } if(found) { - _alpm_log(PM_LOG_DEBUG, _("'%s' is already elected for removal -- skipping"), + _alpm_log(PM_LOG_DEBUG, "'%s' is already elected for removal -- skipping", alpm_pkg_get_name(found)); continue; } sync = _alpm_sync_find(trans->packages, miss->target); if(sync == NULL) { - _alpm_log(PM_LOG_DEBUG, _("'%s' not found in transaction set -- skipping"), + _alpm_log(PM_LOG_DEBUG, "'%s' not found in transaction set -- skipping", miss->target); continue; } @@ -520,7 +522,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync miss->depend.name)) { /* treat like a replaces item so requiredby fields are * inherited properly. */ - _alpm_log(PM_LOG_DEBUG, _("package '%s' provides its own conflict"), + _alpm_log(PM_LOG_DEBUG, "package '%s' provides its own conflict", miss->target); if(!local) { char *rmpkg = NULL; @@ -541,12 +543,12 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync target = alpm_list_find_str(trans->targets, miss->target); depend = alpm_list_find_str(trans->targets, miss->depend.name); if(depend && !target) { - _alpm_log(PM_LOG_DEBUG, _("'%s' is in the target list -- keeping it"), + _alpm_log(PM_LOG_DEBUG, "'%s' is in the target list -- keeping it", miss->depend.name); /* remove miss->target */ rmpkg = miss->target; } else if(target && !depend) { - _alpm_log(PM_LOG_DEBUG, _("'%s' is in the target list -- keeping it"), + _alpm_log(PM_LOG_DEBUG, "'%s' is in the target list -- keeping it", miss->target); /* remove miss->depend.name */ rmpkg = miss->depend.name; @@ -558,7 +560,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync if(rmpkg) { pmsyncpkg_t *rsync = _alpm_sync_find(trans->packages, rmpkg); void *vpkg; - _alpm_log(PM_LOG_DEBUG, _("removing '%s' from target list"), + _alpm_log(PM_LOG_DEBUG, "removing '%s' from target list", rsync->pkg->name); trans->packages = alpm_list_remove(trans->packages, rsync, syncpkg_cmp, &vpkg); @@ -568,7 +570,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync } } /* It's a conflict -- see if they want to remove it */ - _alpm_log(PM_LOG_DEBUG, _("resolving package '%s' conflict"), + _alpm_log(PM_LOG_DEBUG, "resolving package '%s' conflict", miss->target); if(local) { int doremove = 0; @@ -586,7 +588,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync sync->data = NULL; } /* append to the replaces list */ - _alpm_log(PM_LOG_DEBUG, _("electing '%s' for removal"), + _alpm_log(PM_LOG_DEBUG, "electing '%s' for removal", miss->depend.name); sync->data = alpm_list_add(sync->data, q); /* see if the package is in the current target list */ @@ -595,7 +597,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync if(rsync) { /* remove it from the target list */ void *vpkg; - _alpm_log(PM_LOG_DEBUG, _("removing '%s' from target list"), + _alpm_log(PM_LOG_DEBUG, "removing '%s' from target list", miss->depend.name); trans->packages = alpm_list_remove(trans->packages, rsync, syncpkg_cmp, &vpkg); @@ -672,7 +674,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync } } if(list) { - _alpm_log(PM_LOG_DEBUG, _("checking dependencies of packages designated for removal")); + _alpm_log(PM_LOG_DEBUG, "checking dependencies of packages designated for removal"); deps = _alpm_checkdeps(db_local, PM_TRANS_TYPE_REMOVE, list); if(deps) { /* Check if broken dependencies are fixed by packages we are installing */ @@ -686,7 +688,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync pmsyncpkg_t *sp = l->data; pmpkg_t *sppkg = sp->pkg; if(alpm_depcmp(sppkg, &(miss->depend))) { - _alpm_log(PM_LOG_DEBUG, _("sync: dependency '%s' satisfied by package '%s'"), + _alpm_log(PM_LOG_DEBUG, "sync: dependency '%s' satisfied by package '%s'", miss->depend.name, alpm_pkg_get_name(sppkg)); satisfied = 1; } @@ -753,7 +755,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) fname); if(stat(path, &buf) == 0) { found = 1; - _alpm_log(PM_LOG_DEBUG, _("found cached pkg: %s"), path); + _alpm_log(PM_LOG_DEBUG, "found cached pkg: %s", path); break; } } @@ -778,13 +780,13 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) alpm_logaction("warning: no %s cache exists, creating...", cachedir); if(_alpm_makepath(cachedir) == 0) { - _alpm_log(PM_LOG_DEBUG, _("setting main cachedir: %s"), cachedir); + _alpm_log(PM_LOG_DEBUG, "setting main cachedir: %s", cachedir); maincachedir = cachedir; validcache = 1; break; } } else if(S_ISDIR(buf.st_mode) && (buf.st_mode & S_IWUSR)) { - _alpm_log(PM_LOG_DEBUG, _("setting main cachedir: %s"), cachedir); + _alpm_log(PM_LOG_DEBUG, "setting main cachedir: %s", cachedir); maincachedir = cachedir; validcache = 1; break; @@ -797,7 +799,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) alpm_list_t *cachetmp = alpm_list_add(NULL, strdup("/tmp/")); FREELIST(oldcachedirs); alpm_option_set_cachedirs(cachetmp); - _alpm_log(PM_LOG_DEBUG, _("setting main cachedir: %s"), "/tmp/"); + _alpm_log(PM_LOG_DEBUG, "setting main cachedir: %s", "/tmp/"); maincachedir = alpm_list_getdata(cachetmp); _alpm_log(PM_LOG_WARNING, _("couldn't create package cache, using /tmp instead")); alpm_logaction("warning: couldn't create package cache, using /tmp instead"); @@ -844,7 +846,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) for(j = alpm_option_get_cachedirs(); j; j = alpm_list_next(j)) { snprintf(str, PATH_MAX, "%s%s", (char*)alpm_list_getdata(j), pkgname); if(stat(str, &buf) == 0) { - _alpm_log(PM_LOG_DEBUG, _("package found for integrity check: %s"), + _alpm_log(PM_LOG_DEBUG, "package found for integrity check: %s", str); break; } @@ -922,7 +924,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) } } if(replaces) { - _alpm_log(PM_LOG_DEBUG, _("removing conflicting and to-be-replaced packages")); + _alpm_log(PM_LOG_DEBUG, "removing conflicting and to-be-replaced packages"); if(_alpm_trans_prepare(tr, data) == -1) { _alpm_log(PM_LOG_ERROR, _("could not prepare removal transaction")); goto error; @@ -938,7 +940,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) tr = NULL; /* install targets */ - _alpm_log(PM_LOG_DEBUG, _("installing packages")); + _alpm_log(PM_LOG_DEBUG, "installing packages"); tr = _alpm_trans_new(); if(tr == NULL) { _alpm_log(PM_LOG_ERROR, _("could not create transaction")); @@ -988,7 +990,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) /* propagate replaced packages' requiredby fields to their new owners */ if(replaces) { - _alpm_log(PM_LOG_DEBUG, _("updating database for replaced packages' dependencies")); + _alpm_log(PM_LOG_DEBUG, "updating database for replaced packages' dependencies"); for(i = trans->packages; i; i = i->next) { pmsyncpkg_t *sync = i->data; if(sync->type == PM_SYNC_TYPE_REPLACE) { @@ -1042,7 +1044,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) /* run ldconfig if it exists */ if(handle->trans->state != STATE_INTERRUPTED) { - _alpm_log(PM_LOG_DEBUG, _("running \"ldconfig -r %s\""), handle->root); + _alpm_log(PM_LOG_DEBUG, "running \"ldconfig -r %s\"", handle->root); _alpm_ldconfig(handle->root); } @@ -1067,13 +1069,13 @@ pmsyncpkg_t *_alpm_sync_find(alpm_list_t *syncpkgs, const char* pkgname) pmpkg_t *pkg = alpm_sync_get_pkg(syncpkg); if(strcmp(alpm_pkg_get_name(pkg), pkgname) == 0) { - _alpm_log(PM_LOG_DEBUG, _("found package '%s-%s' in sync"), + _alpm_log(PM_LOG_DEBUG, "found package '%s-%s' in sync", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg)); return(syncpkg); } } - _alpm_log(PM_LOG_DEBUG, _("package '%s' not found in sync"), pkgname); + _alpm_log(PM_LOG_DEBUG, "package '%s' not found in sync", pkgname); return(NULL); /* not found */ } diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index d0deb5ca..2078a5de 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -440,10 +440,10 @@ int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg) depends = alpm_pkg_get_depends(pkg); if(depends) { - _alpm_log(PM_LOG_DEBUG, _("updating dependency packages 'requiredby' fields for %s-%s"), + _alpm_log(PM_LOG_DEBUG, "updating dependency packages 'requiredby' fields for %s-%s", pkgname, pkg->version); } else { - _alpm_log(PM_LOG_DEBUG, _("package has no dependencies, no other packages to update")); + _alpm_log(PM_LOG_DEBUG, "package has no dependencies, no other packages to update"); } localdb = alpm_option_get_localdb(); @@ -480,7 +480,7 @@ int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg) /* this is cheating... we call this function to populate the package */ alpm_list_t *rqdby = alpm_pkg_get_requiredby(deppkg); - _alpm_log(PM_LOG_DEBUG, _("updating 'requiredby' field for package '%s'"), + _alpm_log(PM_LOG_DEBUG, "updating 'requiredby' field for package '%s'", alpm_pkg_get_name(deppkg)); if(trans->type == PM_TRANS_TYPE_REMOVE) { void *data = NULL; @@ -502,7 +502,7 @@ int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg) alpm_list_free(provides); if(!found_provides) { - _alpm_log(PM_LOG_DEBUG, _("could not find dependency '%s'"), dep->name); + _alpm_log(PM_LOG_DEBUG, "could not find dependency '%s'", dep->name); continue; } } @@ -510,7 +510,7 @@ int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg) /* this is cheating... we call this function to populate the package */ alpm_list_t *rqdby = alpm_pkg_get_requiredby(deppkg); - _alpm_log(PM_LOG_DEBUG, _("updating 'requiredby' field for package '%s'"), + _alpm_log(PM_LOG_DEBUG, "updating 'requiredby' field for package '%s'", alpm_pkg_get_name(deppkg)); if(trans->type == PM_TRANS_TYPE_REMOVE) { void *data = NULL; @@ -617,7 +617,7 @@ int _alpm_runscriptlet(const char *root, const char *installfn, goto cleanup; } - _alpm_log(PM_LOG_DEBUG, _("executing %s script..."), script); + _alpm_log(PM_LOG_DEBUG, "executing %s script...", script); if(oldver) { snprintf(cmdline, PATH_MAX, "source %s %s %s %s", @@ -636,7 +636,7 @@ int _alpm_runscriptlet(const char *root, const char *installfn, } if(pid == 0) { - _alpm_log(PM_LOG_DEBUG, _("chrooting in %s"), root); + _alpm_log(PM_LOG_DEBUG, "chrooting in %s", root); if(chroot(root) != 0) { _alpm_log(PM_LOG_ERROR, _("could not change the root directory (%s)"), strerror(errno)); exit(1); @@ -646,7 +646,7 @@ int _alpm_runscriptlet(const char *root, const char *installfn, exit(1); } umask(0022); - _alpm_log(PM_LOG_DEBUG, _("executing \"%s\""), cmdline); + _alpm_log(PM_LOG_DEBUG, "executing \"%s\"", cmdline); execl("/bin/sh", "sh", "-c", cmdline, (char *)NULL); exit(0); } else { diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 72c17bf9..20e2017b 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -340,7 +340,7 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn) int ret = archive_read_extract(_archive, entry, archive_flags); if(ret == ARCHIVE_WARN) { /* operation succeeded but a non-critical error was encountered */ - _alpm_log(PM_LOG_DEBUG, _("warning extracting %s (%s)\n"), + _alpm_log(PM_LOG_DEBUG, "warning extracting %s (%s)\n", entryname, archive_error_string(_archive)); } else if(ret != ARCHIVE_OK) { _alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)\n"), diff --git a/lib/libalpm/versioncmp.c b/lib/libalpm/versioncmp.c index 79dfaac9..ae9ff90d 100644 --- a/lib/libalpm/versioncmp.c +++ b/lib/libalpm/versioncmp.c @@ -275,12 +275,12 @@ int SYMEXPORT alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep) } if(strlen(dep->version) > 0) { - _alpm_log(PM_LOG_DEBUG, _("depcmp: %s-%s %s %s-%s => %s"), + _alpm_log(PM_LOG_DEBUG, "depcmp: %s-%s %s %s-%s => %s", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg), mod, dep->name, dep->version, (equal ? "match" : "no match")); } else { - _alpm_log(PM_LOG_DEBUG, _("depcmp: %s-%s %s %s => %s"), + _alpm_log(PM_LOG_DEBUG, "depcmp: %s-%s %s %s => %s", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg), mod, dep->name, (equal ? "match" : "no match")); |