Skip to content

Commit

Permalink
Fixes for building with libsolv-0.6.21 (#117)
Browse files Browse the repository at this point in the history
* tests/sack: do not raise exceptions on empty/unknown arches

libsolv 0.6.21 now permits handling custom architectures,
which completely breaks these tests.

* Add build option to enable urpmreorder solver flag

This optionally enables the urpm-style solution reordering
required to ensure the proper subset of locale and kernel packages
were being installed.

Reference: https://bugs.mageia.org/show_bug.cgi?id=18315

* spec: bump required libsolv to 0.6.21
  • Loading branch information
Conan-Kudo authored and Igor Gnatenko committed Jun 29, 2016
1 parent dc3b7e7 commit 43119cf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ IF(NOT CMAKE_BUILD_TYPE)
ENDIF(NOT CMAKE_BUILD_TYPE)

INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR})

OPTION (ENABLE_SOLV_URPMREORDER "Build with support for URPM-like solution reordering?" OFF)

IF (ENABLE_SOLV_URPMREORDER)
ADD_DEFINITIONS(-DLIBSOLV_FLAG_URPMREORDER=1)
ENDIF()

if (LIBSOLV_PATH)
INCLUDE_DIRECTORIES (${LIBSOLV_PATH}/build/)
FIND_LIBRARY (SOLV_LIBRARY NAMES solv PATHS ${LIBSOLV_PATH}/build/src NO_DEFAULT_PATH)
Expand Down
2 changes: 1 addition & 1 deletion hawkey.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%global libsolv_version 0.6.4-1
%global libsolv_version 0.6.21-1

%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
Expand Down
5 changes: 5 additions & 0 deletions src/goal.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ init_solver(HyGoal goal, int flags)
/* support package splits via obsoletes */
solver_set_flag(solv, SOLVER_FLAG_YUM_OBSOLETES, 1);

#if defined(LIBSOLV_FLAG_URPMREORDER)
/* support urpm-like solution reordering */
solver_set_flag(solv, SOLVER_FLAG_URPM_REORDER, 1);
#endif

return solv;
}

Expand Down
2 changes: 0 additions & 2 deletions tests/python/tests/test_sack.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class BasicTest(unittest.TestCase):
def test_creation(self):
hawkey.Sack(arch="noarch")
hawkey.Sack(arch="x86_64")
self.assertRaises(hawkey.ArchException, hawkey.Sack, arch="")
self.assertRaises(hawkey.ValueException, hawkey.Sack, arch="play")

def test_deepcopy(self):
sack = hawkey.Sack()
Expand Down
4 changes: 0 additions & 4 deletions tests/test_sack.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ START_TEST(test_sack_create)
fail_if(sack_pool(sack) == NULL, NULL);
hy_sack_free(sack);

sack = hy_sack_create(test_globals.tmpdir, "", NULL, NULL,
HY_MAKE_CACHE_DIR);
fail_unless(sack == NULL);
fail_unless(hy_get_errno() == HY_E_ARCH);
}
END_TEST

Expand Down

0 comments on commit 43119cf

Please sign in to comment.