From 3e36ee6efdd5b1b567c3601887cb19372cbc5970 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Mon, 20 Feb 2012 16:47:36 +0100 Subject: [PATCH] - make old rpmdb pubkey support optional --- CMakeLists.txt | 5 ++++- examples/solv.c | 2 +- ext/repo_rpmdb.c | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd5f75e..539199e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ OPTION (ENABLE_RUBY "Build the ruby bindings?" OFF) OPTION (USE_VENDORDIRS "Install the bindings in vendor directories?" OFF) OPTION (ENABLE_RPMDB "Build with rpm database support?" OFF) +OPTION (ENABLE_RPMDB_PUBKEY "Build with rpmdb pubkey support?" OFF) OPTION (ENABLE_RPMMD "Build with rpmmd repository support?" OFF) OPTION (ENABLE_SUSEREPO "Build with suse repository support?" OFF) OPTION (ENABLE_COMPS "Build with fedora comps support?" OFF) @@ -86,6 +87,7 @@ IF (NOT ENABLE_RPMDB AND NOT ENABLE_HELIXREPO AND NOT ENABLE_DEBIAN) SET (ENABLE_RPMDB ON) + SET (ENABLE_RPMDB_PUBKEY ON) SET (ENABLE_RPMMD ON) SET (ENABLE_SUSEREPO ON) SET (ENABLE_HELIXREPO ON) @@ -129,7 +131,8 @@ TEST_BIG_ENDIAN (WORDS_BIGENDIAN) # should create config.h with #cmakedefine instead... FOREACH (VAR HAVE_STRCHRNUL HAVE_FOPENCOOKIE HAVE_FUNOPEN WORDS_BIGENDIAN - ENABLE_RPMDB ENABLE_RPMMD ENABLE_SUSEREPO ENABLE_COMPS ENABLE_HELIXREPO ENABLE_DEBIAN) + ENABLE_RPMDB ENABLE_RPMDB_PUBKEY ENABLE_RPMMD ENABLE_SUSEREPO ENABLE_COMPS + ENABLE_HELIXREPO ENABLE_DEBIAN) IF(${VAR}) ADD_DEFINITIONS (-D${VAR}=1) ENDIF (${VAR}) diff --git a/examples/solv.c b/examples/solv.c index 4e3cdbe..dd3ff5e 100644 --- a/examples/solv.c +++ b/examples/solv.c @@ -1206,7 +1206,7 @@ static Pool * read_sigs() { Pool *sigpool = pool_create(); -#ifdef ENABLE_RPMDB +#if defined(ENABLE_RPMDB_PUBKEYS) Repo *repo = repo_create(sigpool, "rpmdbkeys"); repo_add_rpmdb_pubkeys(repo, 0, 0); #endif diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 4dcd956..5eccfec 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Novell Inc. + * Copyright (c) 2007-2012, Novell Inc. * * This program is licensed under the BSD license, read LICENSE.BSD * for further information @@ -2528,6 +2528,8 @@ rpm_byrpmh(Header h, void **statep) } +#ifdef ENABLE_RPM_PUBKEY + static char * r64dec1(char *p, unsigned int *vp, int *eofp) { @@ -3142,3 +3144,5 @@ repo_add_pubkeys(Repo *repo, const char **keys, int nkeys, int flags) repodata_internalize(data); return 0; } + +#endif /* ENABLE_RPM_PUBKEY */ -- 2.7.4