From 87388f78103860e899d1e3f63998a9c0fa08fc11 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Fri, 13 Jun 2008 15:02:48 +0000 Subject: Add a testcase for urpmi wrongly considering epochless conflicts to match any epoch in a case when urpmi should upgrade a conflicting package to an actually non-conflicting version. Disabled for now until fixed. --- .../epochless-conflict-with-promotion/a1.spec | 13 +++++++++++ .../epochless-conflict-with-promotion/a2.spec | 14 ++++++++++++ .../SPECS/epochless-conflict-with-promotion/b.spec | 14 ++++++++++++ t/superuser--epochless-conflict-with-promotion.t | 26 ++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 t/data/SPECS/epochless-conflict-with-promotion/a1.spec create mode 100644 t/data/SPECS/epochless-conflict-with-promotion/a2.spec create mode 100644 t/data/SPECS/epochless-conflict-with-promotion/b.spec create mode 100644 t/superuser--epochless-conflict-with-promotion.t (limited to 't') diff --git a/t/data/SPECS/epochless-conflict-with-promotion/a1.spec b/t/data/SPECS/epochless-conflict-with-promotion/a1.spec new file mode 100644 index 00000000..f75c94d2 --- /dev/null +++ b/t/data/SPECS/epochless-conflict-with-promotion/a1.spec @@ -0,0 +1,13 @@ +Summary: x +Name: a +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/data/SPECS/epochless-conflict-with-promotion/a2.spec b/t/data/SPECS/epochless-conflict-with-promotion/a2.spec new file mode 100644 index 00000000..b0345103 --- /dev/null +++ b/t/data/SPECS/epochless-conflict-with-promotion/a2.spec @@ -0,0 +1,14 @@ +Summary: x +Name: a +Epoch: 1 +Version: 2 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/data/SPECS/epochless-conflict-with-promotion/b.spec b/t/data/SPECS/epochless-conflict-with-promotion/b.spec new file mode 100644 index 00000000..2c10cfaa --- /dev/null +++ b/t/data/SPECS/epochless-conflict-with-promotion/b.spec @@ -0,0 +1,14 @@ +Summary: x +Name: b +Version: 1 +Release: 1 +License: x +Group: x +Url: x +Conflicts: a <= 2 +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/superuser--epochless-conflict-with-promotion.t b/t/superuser--epochless-conflict-with-promotion.t new file mode 100644 index 00000000..17f6b720 --- /dev/null +++ b/t/superuser--epochless-conflict-with-promotion.t @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +# a-1 does not have epoch +# a-2 has epoch 1 +# +# b conflicts with a <= 2 +# +# RPM does not consider this a conflict with a-2, so urpmi should promote it. +# +use strict; +use lib '.', 't'; +use helper; +use urpm::util; +use Test::More 'no_plan'; + +need_root_and_prepare(); + +my $name = 'epochless-conflict-with-promotion'; +urpmi_addmedia("$name $::pwd/media/$name"); + +urpmi('a-1'); +check_installed_fullnames('a-1-1'); + +# urpmi('--auto b'); +# check_installed_and_remove('a', 'b'); +# ERROR: urpmi considers the conflict to match a-2 as well and just removes a -- cgit v1.2.1