[pacman-dev] CVS update of pacman-lib (5 files)
Date: Monday, March 19, 2007 @ 00:23:45 Author: aaron Path: /home/cvs-pacman/pacman-lib Added: pactest/tests/sync1000.py (1.1) pactest/tests/upgrade058.py (1.1) Modified: lib/libalpm/alpm.h (1.81 -> 1.82) lib/libalpm/deps.c (1.79 -> 1.80) src/pacman/sync.c (1.116 -> 1.117) James Rosten <seinfeld90@gmail.com> * Two new pactest test cases * Fix some "required by" / "requires" output by unifying all "dependency types" to a single value (PM_DEP_TYPE_DEPEND) -----------------------------+ lib/libalpm/alpm.h | 1 - lib/libalpm/deps.c | 4 ++-- pactest/tests/sync1000.py | 19 +++++++++++++++++++ pactest/tests/upgrade058.py | 17 +++++++++++++++++ src/pacman/sync.c | 6 ++---- 5 files changed, 40 insertions(+), 7 deletions(-) Index: pacman-lib/lib/libalpm/alpm.h diff -u pacman-lib/lib/libalpm/alpm.h:1.81 pacman-lib/lib/libalpm/alpm.h:1.82 --- pacman-lib/lib/libalpm/alpm.h:1.81 Wed Mar 7 02:45:30 2007 +++ pacman-lib/lib/libalpm/alpm.h Mon Mar 19 00:23:45 2007 @@ -371,7 +371,6 @@ typedef enum _pmdeptype_t { PM_DEP_TYPE_DEPEND = 1, - PM_DEP_TYPE_REQUIRED, PM_DEP_TYPE_CONFLICT } pmdeptype_t; Index: pacman-lib/lib/libalpm/deps.c diff -u pacman-lib/lib/libalpm/deps.c:1.79 pacman-lib/lib/libalpm/deps.c:1.80 --- pacman-lib/lib/libalpm/deps.c:1.79 Mon Mar 12 01:55:14 2007 +++ pacman-lib/lib/libalpm/deps.c Mon Mar 19 00:23:45 2007 @@ -288,7 +288,7 @@ if(!satisfied) { _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_REQUIRED, depend->mod, + miss = _alpm_depmiss_new(p->name, PM_DEP_TYPE_DEPEND, depend->mod, depend->name, depend->version); if(!_alpm_depmiss_isin(miss, baddeps)) { baddeps = alpm_list_add(baddeps, miss); @@ -408,7 +408,7 @@ if(!found) { _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"), reqname, alpm_pkg_get_name(tp)); - miss = _alpm_depmiss_new(alpm_pkg_get_name(tp), PM_DEP_TYPE_REQUIRED, + miss = _alpm_depmiss_new(alpm_pkg_get_name(tp), PM_DEP_TYPE_DEPEND, PM_DEP_MOD_ANY, j->data, NULL); if(!_alpm_depmiss_isin(miss, baddeps)) { baddeps = alpm_list_add(baddeps, miss); Index: pacman-lib/pactest/tests/sync1000.py diff -u /dev/null pacman-lib/pactest/tests/sync1000.py:1.1 --- /dev/null Mon Mar 19 00:23:45 2007 +++ pacman-lib/pactest/tests/sync1000.py Mon Mar 19 00:23:45 2007 @@ -0,0 +1,19 @@ +# If someone else can come up with a better name, please do so +self.description = "stonecrest's problem" + +sp = pmpkg("dummy", "1.1-1") +sp.requiredby = [ "pkg" ] +self.addpkg2db("sync", sp) + +lp1 = pmpkg("dummy", "1.0-1") +lp1.requiredby = [ "pkg" ] +self.addpkg2db("local", lp1) + +lp2 = pmpkg("pkg") +lp2.depends = [ "dummy=1.0" ] +self.addpkg2db("local", lp2) + +self.args = "-Su" + +self.addrule("!PACMAN_RETCODE=0") +self.addrule("!PKG_VERSION=dummy|1.1-1") Index: pacman-lib/pactest/tests/upgrade058.py diff -u /dev/null pacman-lib/pactest/tests/upgrade058.py:1.1 --- /dev/null Mon Mar 19 00:23:45 2007 +++ pacman-lib/pactest/tests/upgrade058.py Mon Mar 19 00:23:45 2007 @@ -0,0 +1,17 @@ +self.description = "Upgrade a package that's older version is required by another package." + +lp1 = pmpkg("pkg1") +lp1.depends = [ "pkg2=1.0" ] +self.addpkg2db("local", lp1) + +lp2 = pmpkg("pkg2", "1.0-1") +lp2.requiredby = [ "pkg1" ] +self.addpkg2db("local", lp2) + +p = pmpkg("pkg2", "1.1-1") +self.addpkg(p) + +self.args = "-U %s" % p.filename() + +self.addrule("PACMAN_RETCODE=1") +self.addrule("!PKG_VERSION=pkg2|1.1") Index: pacman-lib/src/pacman/sync.c diff -u pacman-lib/src/pacman/sync.c:1.116 pacman-lib/src/pacman/sync.c:1.117 --- pacman-lib/src/pacman/sync.c:1.116 Mon Mar 5 17:13:35 2007 +++ pacman-lib/src/pacman/sync.c Mon Mar 19 00:23:45 2007 @@ -618,10 +618,8 @@ case PM_ERR_UNSATISFIED_DEPS: for(i = data; i; i = alpm_list_next(i)) { pmdepmissing_t *miss = alpm_list_getdata(i); - MSG(NL, ":: %s %s %s", alpm_dep_get_target(miss), - alpm_dep_get_type(miss) == PM_DEP_TYPE_DEPEND ? - _("requires") : _("is required by"), - alpm_dep_get_name(miss)); + MSG(NL, ":: %s %s %s", alpm_dep_get_target(miss), _("requires"), + alpm_dep_get_name(miss)); switch(alpm_dep_get_mod(miss)) { case PM_DEP_MOD_ANY: break;
participants (1)
-
Aaron Griffin