From e0d327462c460329b8d0f65f1324551accff939c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 29 Dec 2010 20:06:40 -0600 Subject: doc: add website zip to clean files Signed-off-by: Dan McGee --- doc/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 2e656f61..c2391b71 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -52,7 +52,7 @@ EXTRA_DIST = \ $(DOXYGEN_MANS) # Files that should be removed, but which Automake does not know. -MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS) $(HTML_DOCS) repo-remove.8 +MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS) $(HTML_DOCS) repo-remove.8 website.tar.gz # Ensure manpages are fresh when building a dist tarball dist-hook: -- cgit v1.2.3-24-g4f1b From 58ee249c86d0f4ac1dfef9ca242d44d89044cb88 Mon Sep 17 00:00:00 2001 From: Jakob Gruber Date: Fri, 24 Sep 2010 14:22:35 +0200 Subject: Tests: Sync group which includes ignored pkgs * FS#19854 (--ignore is ignored with groups) * http://www.archlinux.org/pipermail/pacman-dev/2009-June/008847.html (operation aborts when a package from a group is ignored/and user chooses not to install it) If a group member is ignored, we expect a) a question whether to install b) after saying 'no' to a), the ignored member not to be installed c) all other group members to be installed d) pacman to execute successfully Signed-off-by: Dan McGee (cherry picked from commit 9d0b33fd3327ae6d2b15f50870c0885a2068d492) --- test/pacman/tests/ignore007.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/pacman/tests/ignore007.py diff --git a/test/pacman/tests/ignore007.py b/test/pacman/tests/ignore007.py new file mode 100644 index 00000000..e4be40a1 --- /dev/null +++ b/test/pacman/tests/ignore007.py @@ -0,0 +1,23 @@ +self.description = "Sync group with ignored packages" + +pkg1 = pmpkg("package1") +pkg1.groups = ["grp"] +self.addpkg2db("sync", pkg1) + +pkg2 = pmpkg("package2") +pkg2.groups = ["grp"] +self.addpkg2db("sync", pkg2) + +pkg3 = pmpkg("package3") +pkg3.groups = ["grp"] +self.addpkg2db("sync", pkg3) + +self.option["IgnorePkg"] = ["package1"] +self.args = "--ask=1 -S grp" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=%s" % pkg1.name) +self.addrule("PKG_EXIST=%s" % pkg2.name) +self.addrule("PACMAN_OUTPUT=IgnorePkg") + +self.expectfailure = True -- cgit v1.2.3-24-g4f1b From df360b791da6d4ce8bc5813d9031ce44e32fcc55 Mon Sep 17 00:00:00 2001 From: Jakob Gruber Date: Sat, 2 Oct 2010 20:41:13 +0200 Subject: Move group code to separate function This makes the following commits more readable. No logic was changed in this commit. Signed-off-by: Dan McGee --- lib/libalpm/sync.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 57097fd1..a8bb4733 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -248,29 +248,15 @@ static int sync_pkg(pmpkg_t *spkg, alpm_list_t *pkg_list) return(0); } -static int sync_target(alpm_list_t *dbs_sync, char *target) +static int sync_group(alpm_list_t *dbs_sync, const 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; int found = 0; ALPM_LOG_FUNC; - /* Sanity checks */ - ASSERT(target != NULL && strlen(target) != 0, RET_ERR(PM_ERR_WRONG_ARGS, -1)); - ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); - - dep = _alpm_splitdep(target); - spkg = _alpm_resolvedep(dep, dbs_sync, NULL, 1); - _alpm_dep_free(dep); - - if(spkg != NULL) { - return(sync_pkg(spkg, handle->trans->add)); - } - _alpm_log(PM_LOG_DEBUG, "%s package not found, searching for group...\n", target); for(i = dbs_sync; i; i = i->next) { pmdb_t *db = i->data; @@ -305,6 +291,28 @@ static int sync_target(alpm_list_t *dbs_sync, char *target) return(0); } +static int sync_target(alpm_list_t *dbs_sync, const char *target) +{ + pmpkg_t *spkg; + pmdepend_t *dep; /* provisions and dependencies are also allowed */ + + ALPM_LOG_FUNC; + + /* Sanity checks */ + ASSERT(target != NULL && strlen(target) != 0, RET_ERR(PM_ERR_WRONG_ARGS, -1)); + ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); + + dep = _alpm_splitdep(target); + spkg = _alpm_resolvedep(dep, dbs_sync, NULL, 1); + _alpm_dep_free(dep); + + if(spkg != NULL) { + return(sync_pkg(spkg, handle->trans->add)); + } + + return(sync_group(dbs_sync, target)); +} + /** Add a sync target to the transaction. * @param target the name of the sync target to add * @return 0 on success, -1 on error (pm_errno is set accordingly) -- cgit v1.2.3-24-g4f1b From 6ddc115c7f52d6d172ca3879f96cc782bb526313 Mon Sep 17 00:00:00 2001 From: Jakob Gruber Date: Sat, 2 Oct 2010 20:51:37 +0200 Subject: Respect Ignore{Pkg,Group} for group members Fixes FS#19854. Signed-off-by: Dan McGee --- lib/libalpm/sync.c | 12 ++++++++++++ test/pacman/tests/ignore007.py | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index a8bb4733..4cbaf0cb 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -265,6 +265,18 @@ static int sync_group(alpm_list_t *dbs_sync, const char *target) found = 1; for(j = alpm_grp_get_pkgs(grp); j; j = j->next) { pmpkg_t *pkg = j->data; + + /* check if group member is ignored */ + if(_alpm_pkg_should_ignore(pkg)) { + int install = 0; + QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, + NULL, NULL, &install); + if(install == 0) { + _alpm_log(PM_LOG_WARNING, _("skipping target: %s\n"), alpm_pkg_get_name(pkg)); + continue; + } + } + 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 */ diff --git a/test/pacman/tests/ignore007.py b/test/pacman/tests/ignore007.py index e4be40a1..bb5efdc9 100644 --- a/test/pacman/tests/ignore007.py +++ b/test/pacman/tests/ignore007.py @@ -19,5 +19,3 @@ self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_EXIST=%s" % pkg1.name) self.addrule("PKG_EXIST=%s" % pkg2.name) self.addrule("PACMAN_OUTPUT=IgnorePkg") - -self.expectfailure = True -- cgit v1.2.3-24-g4f1b