summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-07-27 10:18:35 -0500
committerDan McGee <dan@archlinux.org>2010-07-27 10:18:35 -0500
commitddc4130c978decc5b2498b24d3b20e0c4efbc3cf (patch)
tree4c15921873c853c9636e63b563392610b6e25e03 /lib
parenta83559949622992faafb628b742893891ead8390 (diff)
parent0d6efb35ce445747cdc37b4f58cdf63463de6e1a (diff)
downloadpacman-ddc4130c978decc5b2498b24d3b20e0c4efbc3cf.tar.xz
Merge branch 'maint'
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/po/kk.po2
-rw-r--r--lib/libalpm/sync.c18
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/libalpm/po/kk.po b/lib/libalpm/po/kk.po
index bcb194bb..a43f99b0 100644
--- a/lib/libalpm/po/kk.po
+++ b/lib/libalpm/po/kk.po
@@ -208,7 +208,7 @@ msgstr "'%s' файлын %s адресінен алу қатемен аяқт
#, c-format
msgid "%s appears to be truncated: %jd/%jd bytes\n"
-msgstr "%s қысқартылады: %jd/%jd байт\n"
+msgstr "%s қысқартылған сияқты: %jd/%jd байт\n"
#, c-format
msgid "failed to download %s\n"
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 68ee8dc7..f8193962 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -202,7 +202,7 @@ int SYMEXPORT alpm_sync_sysupgrade(int enable_downgrade)
return(0);
}
-int _alpm_sync_pkg(pmpkg_t *spkg)
+static int sync_pkg(pmpkg_t *spkg, alpm_list_t *pkg_list)
{
pmtrans_t *trans;
pmdb_t *db_local;
@@ -213,7 +213,7 @@ int _alpm_sync_pkg(pmpkg_t *spkg)
trans = handle->trans;
db_local = handle->db_local;
- if(_alpm_pkg_find(trans->add, alpm_pkg_get_name(spkg))) {
+ if(_alpm_pkg_find(pkg_list, alpm_pkg_get_name(spkg))) {
RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1);
}
@@ -248,9 +248,10 @@ int _alpm_sync_pkg(pmpkg_t *spkg)
return(0);
}
-int _alpm_sync_target(alpm_list_t *dbs_sync, char *target)
+static int sync_target(alpm_list_t *dbs_sync, char *target)
{
alpm_list_t *i, *j;
+ alpm_list_t *known_pkgs = NULL;
pmpkg_t *spkg;
pmdepend_t *dep; /* provisions and dependencies are also allowed */
pmgrp_t *grp;
@@ -267,7 +268,7 @@ int _alpm_sync_target(alpm_list_t *dbs_sync, char *target)
_alpm_dep_free(dep);
if(spkg != NULL) {
- return(_alpm_sync_pkg(spkg));
+ return(sync_pkg(spkg, handle->trans->add));
}
_alpm_log(PM_LOG_DEBUG, "%s package not found, searching for group...\n", target);
@@ -278,17 +279,20 @@ int _alpm_sync_target(alpm_list_t *dbs_sync, char *target)
found = 1;
for(j = alpm_grp_get_pkgs(grp); j; j = j->next) {
pmpkg_t *pkg = j->data;
- if(_alpm_sync_pkg(pkg) == -1) {
+ if(sync_pkg(pkg, known_pkgs) == -1) {
if(pm_errno == PM_ERR_TRANS_DUP_TARGET || pm_errno == PM_ERR_PKG_IGNORED) {
/* just skip duplicate or ignored targets */
continue;
} else {
+ alpm_list_free(known_pkgs);
return(-1);
}
}
+ known_pkgs = alpm_list_add(known_pkgs, pkg);
}
}
}
+ alpm_list_free(known_pkgs);
if(!found) {
/* pass through any 'found but ignored' errors */
@@ -329,7 +333,7 @@ int SYMEXPORT alpm_sync_dbtarget(char *dbname, char *target)
if(dbs == NULL) {
RET_ERR(PM_ERR_PKG_REPO_NOT_FOUND, -1);
}
- return(_alpm_sync_target(dbs, target));
+ return(sync_target(dbs, target));
}
/** Add a sync target to the transaction.
@@ -346,7 +350,7 @@ int SYMEXPORT alpm_sync_target(char *target)
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
dbs_sync = handle->dbs_sync;
- return(_alpm_sync_target(dbs_sync,target));
+ return(sync_target(dbs_sync,target));
}
/** Compute the size of the files that will be downloaded to install a