Update to 0.6.14; Backport patches from upstream

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
Igor Gnatenko 2015-10-12 18:54:15 +02:00
parent ac50906acb
commit 19941199c5
8 changed files with 199 additions and 10 deletions

1
.gitignore vendored
View File

@ -17,3 +17,4 @@
/2db517f87a8c0364d28c0fa2590ba034e866a4b8.tar.gz /2db517f87a8c0364d28c0fa2590ba034e866a4b8.tar.gz
/libsolv-1f9abfb.tar.gz /libsolv-1f9abfb.tar.gz
/libsolv-0.6.12.tar.gz /libsolv-0.6.12.tar.gz
/libsolv-0.6.14.tar.gz

View File

@ -0,0 +1,64 @@
From 80ddee19786b7b96d28cde1b972721dc631ee055 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 12 Oct 2015 13:43:05 +0200
Subject: [PATCH 1/4] Move allowuninstall map creation
We need to test for them when we have dup jobs
---
src/solver.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/solver.c b/src/solver.c
index c6cad6b..f371546 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -3561,6 +3561,19 @@ solver_solve(Solver *solv, Queue *job)
MAPSET(&solv->droporphanedmap, p - installed->start);
}
break;
+ case SOLVER_ALLOWUNINSTALL:
+ if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && installed && what == installed->repoid))
+ solv->allowuninstall_all = 1;
+ FOR_JOB_SELECT(p, pp, select, what)
+ {
+ s = pool->solvables + p;
+ if (s->repo != installed)
+ continue;
+ if (!solv->allowuninstallmap.size)
+ map_grow(&solv->allowuninstallmap, installed->end - installed->start);
+ MAPSET(&solv->allowuninstallmap, p - installed->start);
+ }
+ break;
default:
break;
}
@@ -3608,7 +3621,7 @@ solver_solve(Solver *solv, Queue *job)
if (how & SOLVER_FORCEBEST)
solv->bestupdatemap_all = 1;
}
- if (!solv->dupmap_all || solv->allowuninstall)
+ if (!solv->dupmap_all || solv->allowuninstall || solv->allowuninstall_all || solv->allowuninstallmap.size)
hasdupjob = 1;
break;
default:
@@ -3917,17 +3930,6 @@ solver_solve(Solver *solv, Queue *job)
break;
case SOLVER_ALLOWUNINSTALL:
POOL_DEBUG(SOLV_DEBUG_JOB, "job: allowuninstall %s\n", solver_select2str(pool, select, what));
- if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && installed && what == installed->repoid))
- solv->allowuninstall_all = 1;
- FOR_JOB_SELECT(p, pp, select, what)
- {
- s = pool->solvables + p;
- if (s->repo != installed)
- continue;
- if (!solv->allowuninstallmap.size)
- map_grow(&solv->allowuninstallmap, installed->end - installed->start);
- MAPSET(&solv->allowuninstallmap, p - installed->start);
- }
break;
default:
POOL_DEBUG(SOLV_DEBUG_JOB, "job: unknown job\n");
--
2.6.1

View File

@ -1,7 +1,18 @@
diff -up libsolv/bindings/ruby/CMakeLists.txt.rubyinclude libsolv/bindings/ruby/CMakeLists.txt From d82a26ca0950191546f546264e79ff72e2dbf09f Mon Sep 17 00:00:00 2001
--- libsolv/bindings/ruby/CMakeLists.txt.rubyinclude 2012-06-07 10:06:19.372687533 +0200 From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
+++ libsolv/bindings/ruby/CMakeLists.txt 2012-06-07 10:09:57.313968719 +0200 Date: Mon, 12 Oct 2015 18:52:16 +0200
@@ -6,8 +6,17 @@ ELSE (USE_VENDORDIRS AND RUBY_VENDORARCH Subject: [PATCH] ruby: make compatible with ruby 2.2
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
bindings/ruby/CMakeLists.txt | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/bindings/ruby/CMakeLists.txt b/bindings/ruby/CMakeLists.txt
index 6c3bd50..a7a3394 100644
--- a/bindings/ruby/CMakeLists.txt
+++ b/bindings/ruby/CMakeLists.txt
@@ -6,8 +6,17 @@ ELSE (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR)
SET (RUBY_INSTALL_DIR ${RUBY_SITEARCH_DIR}) SET (RUBY_INSTALL_DIR ${RUBY_SITEARCH_DIR})
ENDIF (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR) ENDIF (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR)
@ -26,5 +37,8 @@ diff -up libsolv/bindings/ruby/CMakeLists.txt.rubyinclude libsolv/bindings/ruby/
-INCLUDE_DIRECTORIES (${RUBY_INCLUDE_PATH}) -INCLUDE_DIRECTORIES (${RUBY_INCLUDE_PATH})
+INCLUDE_DIRECTORIES (${RUBY_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES (${RUBY_INCLUDE_DIRS})
ADD_LIBRARY (bindings_ruby SHARED solv_ruby.c) ADD_LIBRARY (bindings_ruby MODULE solv_ruby.c)
SET_TARGET_PROPERTIES (bindings_ruby PROPERTIES PREFIX "" OUTPUT_NAME "solv") SET_TARGET_PROPERTIES (bindings_ruby PROPERTIES PREFIX "" OUTPUT_NAME "solv")
--
2.6.1

View File

@ -0,0 +1,42 @@
From 36a4434559e3885f75f3e1e878f11f3b18fce920 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 12 Oct 2015 14:03:25 +0200
Subject: [PATCH 2/4] Prefer to autouninstall orphans
---
src/solver.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/solver.c b/src/solver.c
index f371546..87b6c45 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -217,13 +217,24 @@ autouninstall(Solver *solv, Id *problem)
Rule *r;
if (m && !MAPTST(m, v - solv->updaterules))
continue;
- /* check if identical to feature rule, we don't like that */
+ /* check if identical to feature rule, we don't like that (except for orphans) */
r = solv->rules + solv->featurerules + (v - solv->updaterules);
if (!r->p)
{
/* update rule == feature rule */
if (v > lastfeature)
lastfeature = v;
+ /* prefer orphaned packages in dup mode */
+ if (solv->dupmap_all && solv->keep_orphans)
+ {
+ r = solv->rules + v;
+ if (!r->d && r->p == (solv->installed->start + (v - solv->updaterules)))
+ {
+ lastfeature = v;
+ lastupdate = 0;
+ break;
+ }
+ }
continue;
}
if (v > lastupdate)
--
2.6.1

View File

@ -0,0 +1,33 @@
From d5af25c0ef8fb01e5b0d377a2d7223281991b960 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 12 Oct 2015 14:03:55 +0200
Subject: [PATCH 3/4] Check keep_orphans flag in solver_addduprules
solver_addduprules is called if allowuninstall is set
---
src/rules.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/rules.c b/src/rules.c
index b941986..ead78d6 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1835,6 +1835,15 @@ solver_addduprules(Solver *solv, Map *addedmap)
if (is->evr == ps->evr && solvable_identical(ps, is))
break;
}
+ if (!ip && solv->dupmap_all && solv->keep_orphans)
+ {
+ /* is this an orphan we should keep? */
+ Rule *r = solv->rules + solv->featurerules + (p - solv->installed->start);
+ if (!r->p)
+ r = solv->rules + solv->updaterules + (p - solv->installed->start);
+ if (r->p == p && !r->d)
+ ip = p;
+ }
if (!ip)
solver_addrule(solv, -p, 0, 0); /* no match, sorry */
else
--
2.6.1

View File

@ -0,0 +1,25 @@
From 18f93e12d10aa2a507ffa3689725e21a85a81e7f Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 12 Oct 2015 14:04:54 +0200
Subject: [PATCH 4/4] Fix spelling, duh...
---
ext/testcase.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ext/testcase.c b/ext/testcase.c
index 3c40451..b9fddef 100644
--- a/ext/testcase.c
+++ b/ext/testcase.c
@@ -164,7 +164,7 @@ static struct selflags2str {
};
static const char *features[] = {
-#ifdef ENABLE_LINKED_PACKAGES
+#ifdef ENABLE_LINKED_PKGS
"linked_packages",
#endif
#ifdef ENABLE_COMPLEX_DEPS
--
2.6.1

View File

@ -29,12 +29,19 @@
%filter_setup %filter_setup
Name: libsolv Name: libsolv
Version: 0.6.12 Version: 0.6.14
Release: 1%{?dist} Release: 1%{?dist}
License: BSD License: BSD
Url: https://github.com/openSUSE/libsolv Url: https://github.com/openSUSE/libsolv
Source: https://github.com/openSUSE/libsolv/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source: https://github.com/openSUSE/libsolv/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: libsolv-rubyinclude.patch Patch0: 0001-ruby-make-compatible-with-ruby-2.2.patch
Patch1: 0001-Move-allowuninstall-map-creation.patch
Patch2: 0002-Prefer-to-autouninstall-orphans.patch
Patch3: 0003-Check-keep_orphans-flag-in-solver_addduprules.patch
Patch4: 0004-Fix-spelling-duh.patch
BuildRequires: git-core
Group: Development/Libraries Group: Development/Libraries
Summary: Package dependency solver Summary: Package dependency solver
BuildRequires: cmake libdb-devel expat-devel rpm-devel zlib-devel BuildRequires: cmake libdb-devel expat-devel rpm-devel zlib-devel
@ -130,8 +137,7 @@ Perl bindings for sat solver.
%endif %endif
%prep %prep
%setup -q %autosetup -S git
%patch0 -p1 -b .rubyinclude
%if %{with python3} %if %{with python3}
rm -rf %{py3dir} rm -rf %{py3dir}
@ -223,6 +229,10 @@ make ARGS="-V" test
%endif %endif
%changelog %changelog
* Mon Oct 12 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.6.14-1
- Update to 0.6.14
- Backport patches from upstream
* Thu Sep 10 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.6.12-1 * Thu Sep 10 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.6.12-1
- Update to 0.6.12 - Update to 0.6.12

View File

@ -1 +1 @@
57a31231742f4095b1189925ddc13bd2 libsolv-0.6.12.tar.gz 3bacd80472e4c8d5dd66d22f435f9258 libsolv-0.6.14.tar.gz