Merge branch 'maint'
This commit is contained in:
commit
ddc4130c97
7 changed files with 72 additions and 13 deletions
|
@ -75,8 +75,8 @@ _pacman() {
|
||||||
|
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
_arch_ptr2comp core
|
_arch_ptr2comp core
|
||||||
elif ! [[ $prev =~ ^-\w*[Vbhr] ||
|
elif [[ ! $prev =~ ^-\w*[Vbhr] &&
|
||||||
$prev = --@(cachedir|config|dbpath|help|logfile|root|version) ]]
|
! $prev = --@(cachedir|config|dbpath|help|logfile|root|version) ]]
|
||||||
then
|
then
|
||||||
[[ $cur = -* ]] && _arch_ptr2comp ${o#* } common ||
|
[[ $cur = -* ]] && _arch_ptr2comp ${o#* } common ||
|
||||||
case ${o% *} in
|
case ${o% *} in
|
||||||
|
|
|
@ -208,7 +208,7 @@ msgstr "'%s' файлын %s адресінен алу қатемен аяқт
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s appears to be truncated: %jd/%jd bytes\n"
|
msgid "%s appears to be truncated: %jd/%jd bytes\n"
|
||||||
msgstr "%s қысқартылады: %jd/%jd байт\n"
|
msgstr "%s қысқартылған сияқты: %jd/%jd байт\n"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "failed to download %s\n"
|
msgid "failed to download %s\n"
|
||||||
|
|
|
@ -202,7 +202,7 @@ int SYMEXPORT alpm_sync_sysupgrade(int enable_downgrade)
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _alpm_sync_pkg(pmpkg_t *spkg)
|
static int sync_pkg(pmpkg_t *spkg, alpm_list_t *pkg_list)
|
||||||
{
|
{
|
||||||
pmtrans_t *trans;
|
pmtrans_t *trans;
|
||||||
pmdb_t *db_local;
|
pmdb_t *db_local;
|
||||||
|
@ -213,7 +213,7 @@ int _alpm_sync_pkg(pmpkg_t *spkg)
|
||||||
trans = handle->trans;
|
trans = handle->trans;
|
||||||
db_local = handle->db_local;
|
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);
|
RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,9 +248,10 @@ int _alpm_sync_pkg(pmpkg_t *spkg)
|
||||||
return(0);
|
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 *i, *j;
|
||||||
|
alpm_list_t *known_pkgs = NULL;
|
||||||
pmpkg_t *spkg;
|
pmpkg_t *spkg;
|
||||||
pmdepend_t *dep; /* provisions and dependencies are also allowed */
|
pmdepend_t *dep; /* provisions and dependencies are also allowed */
|
||||||
pmgrp_t *grp;
|
pmgrp_t *grp;
|
||||||
|
@ -267,7 +268,7 @@ int _alpm_sync_target(alpm_list_t *dbs_sync, char *target)
|
||||||
_alpm_dep_free(dep);
|
_alpm_dep_free(dep);
|
||||||
|
|
||||||
if(spkg != NULL) {
|
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);
|
_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;
|
found = 1;
|
||||||
for(j = alpm_grp_get_pkgs(grp); j; j = j->next) {
|
for(j = alpm_grp_get_pkgs(grp); j; j = j->next) {
|
||||||
pmpkg_t *pkg = j->data;
|
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) {
|
if(pm_errno == PM_ERR_TRANS_DUP_TARGET || pm_errno == PM_ERR_PKG_IGNORED) {
|
||||||
/* just skip duplicate or ignored targets */
|
/* just skip duplicate or ignored targets */
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
alpm_list_free(known_pkgs);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
known_pkgs = alpm_list_add(known_pkgs, pkg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
alpm_list_free(known_pkgs);
|
||||||
|
|
||||||
if(!found) {
|
if(!found) {
|
||||||
/* pass through any 'found but ignored' errors */
|
/* pass through any 'found but ignored' errors */
|
||||||
|
@ -329,7 +333,7 @@ int SYMEXPORT alpm_sync_dbtarget(char *dbname, char *target)
|
||||||
if(dbs == NULL) {
|
if(dbs == NULL) {
|
||||||
RET_ERR(PM_ERR_PKG_REPO_NOT_FOUND, -1);
|
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.
|
/** 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));
|
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||||
dbs_sync = handle->dbs_sync;
|
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
|
/** Compute the size of the files that will be downloaded to install a
|
||||||
|
|
|
@ -73,7 +73,7 @@ HOLDVER=0
|
||||||
BUILDFUNC=0
|
BUILDFUNC=0
|
||||||
PKGFUNC=0
|
PKGFUNC=0
|
||||||
SPLITPKG=0
|
SPLITPKG=0
|
||||||
PKGLIST=""
|
PKGLIST=()
|
||||||
|
|
||||||
# Forces the pkgver of the current PKGBUILD. Used by the fakeroot call
|
# Forces the pkgver of the current PKGBUILD. Used by the fakeroot call
|
||||||
# when dealing with svn/cvs/etc PKGBUILDs.
|
# when dealing with svn/cvs/etc PKGBUILDs.
|
||||||
|
@ -1604,7 +1604,7 @@ while true; do
|
||||||
-m|--nocolor) USE_COLOR='n' ;;
|
-m|--nocolor) USE_COLOR='n' ;;
|
||||||
-o|--nobuild) NOBUILD=1 ;;
|
-o|--nobuild) NOBUILD=1 ;;
|
||||||
-p) shift; BUILDFILE=$1 ;;
|
-p) shift; BUILDFILE=$1 ;;
|
||||||
--pkg) shift; PKGLIST=$1 ;;
|
--pkg) shift; PKGLIST=($1) ;;
|
||||||
-r|--rmdeps) RMDEPS=1 ;;
|
-r|--rmdeps) RMDEPS=1 ;;
|
||||||
-R|--repackage) REPKG=1 ;;
|
-R|--repackage) REPKG=1 ;;
|
||||||
--skipinteg) SKIPINTEG=1 ;;
|
--skipinteg) SKIPINTEG=1 ;;
|
||||||
|
@ -1817,7 +1817,7 @@ pkgbase=${pkgbase:-${pkgname[0]}}
|
||||||
|
|
||||||
if [[ -n "${PKGLIST[@]}" ]]; then
|
if [[ -n "${PKGLIST[@]}" ]]; then
|
||||||
unset pkgname
|
unset pkgname
|
||||||
pkgname="${PKGLIST[@]}"
|
pkgname=("${PKGLIST[@]}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( ! SPLITPKG )); then
|
if (( ! SPLITPKG )); then
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
25
test/pacman/tests/sync022.py
Normal file
25
test/pacman/tests/sync022.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
self.description = "Install a group from a sync db using --needed"
|
||||||
|
|
||||||
|
lp1 = pmpkg("pkg1")
|
||||||
|
lp2 = pmpkg("pkg2")
|
||||||
|
lp3 = pmpkg("pkg3")
|
||||||
|
|
||||||
|
sp1 = pmpkg("pkg1", "1.1-1")
|
||||||
|
sp2 = pmpkg("pkg2")
|
||||||
|
sp3 = pmpkg("pkg3")
|
||||||
|
|
||||||
|
for p in lp1, lp2, lp3, sp1, sp2, sp3:
|
||||||
|
setattr(p, "groups", ["grp"])
|
||||||
|
|
||||||
|
for p in lp1, lp2, lp3:
|
||||||
|
self.addpkg2db("local", p)
|
||||||
|
|
||||||
|
for p in sp1, sp2, sp3:
|
||||||
|
self.addpkg2db("sync", p);
|
||||||
|
|
||||||
|
self.args = "-S --needed grp"
|
||||||
|
|
||||||
|
self.addrule("PACMAN_RETCODE=0")
|
||||||
|
for p in sp1, sp2, sp3:
|
||||||
|
self.addrule("PKG_EXIST=%s" % p.name)
|
||||||
|
self.addrule("PKG_VERSION=pkg1|1.1-1")
|
29
test/pacman/tests/sync023.py
Normal file
29
test/pacman/tests/sync023.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
self.description = "Install a group from a sync db using --needed (testing repo)"
|
||||||
|
|
||||||
|
lp1 = pmpkg("pkg1", "1.1-1")
|
||||||
|
lp2 = pmpkg("pkg2")
|
||||||
|
lp3 = pmpkg("pkg3")
|
||||||
|
|
||||||
|
sp1 = pmpkg("pkg1")
|
||||||
|
sp2 = pmpkg("pkg2")
|
||||||
|
sp3 = pmpkg("pkg3")
|
||||||
|
newp1 = pmpkg("pkg1", "1.1-1")
|
||||||
|
|
||||||
|
for p in lp1, lp2, lp3, sp1, sp2, sp3, newp1:
|
||||||
|
setattr(p, "groups", ["grp"])
|
||||||
|
|
||||||
|
for p in lp1, lp2, lp3:
|
||||||
|
self.addpkg2db("local", p)
|
||||||
|
|
||||||
|
self.addpkg2db("testing", newp1);
|
||||||
|
|
||||||
|
for p in sp1, sp2, sp3:
|
||||||
|
self.addpkg2db("sync", p);
|
||||||
|
|
||||||
|
self.args = "-S --needed grp"
|
||||||
|
|
||||||
|
self.addrule("PACMAN_RETCODE=0")
|
||||||
|
for p in sp1, sp2, sp3:
|
||||||
|
self.addrule("PKG_EXIST=%s" % p.name)
|
||||||
|
# The newer version should still be installed
|
||||||
|
self.addrule("PKG_VERSION=pkg1|1.1-1")
|
Loading…
Add table
Reference in a new issue