From: Neal Gompa Date: Sun, 6 Aug 2017 04:05:13 +0000 (-0400) Subject: Add missing Mageia definitions X-Git-Tag: 0.6.29~5^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de2991f836352cd0d94bca9d427b561d6db64e40;p=thirdparty%2Flibsolv.git Add missing Mageia definitions Mageia's RPM stack mirrors Fedora's, so libsolv's definitions need to reflect this. --- diff --git a/examples/solv/deltarpm.c b/examples/solv/deltarpm.c index 551d5705..438c2d8b 100644 --- a/examples/solv/deltarpm.c +++ b/examples/solv/deltarpm.c @@ -75,7 +75,7 @@ trydeltadownload(Solvable *s, const char *loc) seq = pool_tmpappend(pool, seq, "-", pool_lookup_str(pool, SOLVID_POS, DELTA_SEQ_NUM)); if (strchr(seq, '\'') != 0) continue; -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) sprintf(cmd, "/usr/bin/applydeltarpm -a '%s' -c -s '", archstr); #else sprintf(cmd, "/usr/bin/applydeltarpm -c -s '"); @@ -101,7 +101,7 @@ trydeltadownload(Solvable *s, const char *loc) continue; /* got it, now reconstruct */ newfd = opentmpfile(); -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) sprintf(cmd, "applydeltarpm -a '%s' /dev/fd/%d /dev/fd/%d", archstr, fileno(fp), newfd); #else sprintf(cmd, "applydeltarpm /dev/fd/%d /dev/fd/%d", fileno(fp), newfd); diff --git a/examples/solv/repoinfo_config_yum.c b/examples/solv/repoinfo_config_yum.c index 6e2e66ae..697bd6d4 100644 --- a/examples/solv/repoinfo_config_yum.c +++ b/examples/solv/repoinfo_config_yum.c @@ -1,4 +1,4 @@ -#if defined(SUSE) || defined(FEDORA) +#if defined(SUSE) || defined(FEDORA) || defined(MAGEIA) #include #include @@ -14,7 +14,7 @@ #include "repoinfo_config_yum.h" -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) # define REPOINFO_PATH "/etc/yum.repos.d" #endif #ifdef SUSE @@ -160,7 +160,7 @@ read_repoinfos_yum(Pool *pool, int *nrepoinfosp) cinfo->type = TYPE_RPMMD; cinfo->autorefresh = 1; cinfo->priority = 99; -#ifndef FEDORA +#if !defined(FEDORA) && !defined(MAGEIA) cinfo->repo_gpgcheck = 1; #endif cinfo->metadata_expire = METADATA_EXPIRE; diff --git a/examples/solv/repoinfo_download.c b/examples/solv/repoinfo_download.c index 3735cb17..f5ba8b90 100644 --- a/examples/solv/repoinfo_download.c +++ b/examples/solv/repoinfo_download.c @@ -13,7 +13,7 @@ #include "repoinfo.h" #include "mirror.h" #include "checksig.h" -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) #include "repoinfo_config_yum.h" #endif #include "repoinfo_download.h" @@ -92,7 +92,7 @@ curlfopen(struct repoinfo *cinfo, const char *file, int uncompress, const unsign fclose(fp); if (!cinfo->baseurl) return 0; -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) if (strchr(cinfo->baseurl, '$')) { char *b = yum_substitute(cinfo->repo->pool, cinfo->baseurl); diff --git a/examples/solv/solv.c b/examples/solv/solv.c index 33011267..615c83dd 100644 --- a/examples/solv/solv.c +++ b/examples/solv/solv.c @@ -49,7 +49,7 @@ #include "fileconflicts.h" #include "deltarpm.h" #endif -#if defined(SUSE) || defined(FEDORA) +#if defined(SUSE) || defined(FEDORA) || defined(MAGEIA) #include "patchjobs.h" #endif @@ -195,7 +195,7 @@ usage(int r) fprintf(stderr, " search: search name/summary/description\n"); fprintf(stderr, " update: update installed packages\n"); fprintf(stderr, " verify: check dependencies of installed packages\n"); -#if defined(SUSE) || defined(FEDORA) +#if defined(SUSE) || defined(FEDORA) || defined(MAGEIA) fprintf(stderr, " patch: install newest maintenance updates\n"); #endif fprintf(stderr, "\n"); @@ -244,7 +244,7 @@ main(int argc, char **argv) mainmode = MODE_INSTALL; mode = SOLVER_INSTALL; } -#if defined(SUSE) || defined(FEDORA) +#if defined(SUSE) || defined(FEDORA) || defined(MAGEIA) else if (!strcmp(argv[0], "patch")) { mainmode = MODE_PATCH; @@ -638,7 +638,7 @@ main(int argc, char **argv) exit(0); } -#if defined(SUSE) || defined(FEDORA) +#if defined(SUSE) || defined(FEDORA) || defined(MAGEIA) if (mainmode == MODE_PATCH) add_patchjobs(pool, &job); #endif @@ -667,7 +667,7 @@ main(int argc, char **argv) rerunsolver: solv = solver_create(pool); solver_set_flag(solv, SOLVER_FLAG_SPLITPROVIDES, 1); -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) solver_set_flag(solv, SOLVER_FLAG_ALLOW_VENDORCHANGE, 1); #endif if (mainmode == MODE_ERASE) diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 387b370b..9fb5a297 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -1186,7 +1186,7 @@ rpmdbid2db(unsigned char *db, Id id, int byteswapped) #endif } -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) int serialize_dbenv_ops(struct rpmdbstate *state) { @@ -1227,7 +1227,7 @@ opendbenv(struct rpmdbstate *state) if (db_env_create(&dbenv, 0)) return pool_error(state->pool, 0, "db_env_create: %s", strerror(errno)); -#if defined(FEDORA) && (DB_VERSION_MAJOR >= 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 5)) +#if (defined(FEDORA) || defined(MAGEIA)) && (DB_VERSION_MAJOR >= 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 5)) dbenv->set_thread_count(dbenv, 8); #endif snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm", rootdir ? rootdir : ""); @@ -1241,7 +1241,7 @@ opendbenv(struct rpmdbstate *state) } else { -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) int serialize_fd = serialize_dbenv_ops(state); r = dbenv->open(dbenv, dbpath, DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL, 0644); if (serialize_fd >= 0) @@ -1263,13 +1263,13 @@ opendbenv(struct rpmdbstate *state) static void closedbenv(struct rpmdbstate *state) { -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) uint32_t eflags = 0; #endif if (!state->dbenv) return; -#ifdef FEDORA +#if defined(FEDORA) || defined(MAGEIA) (void)state->dbenv->get_open_flags(state->dbenv, &eflags); if (!(eflags & DB_PRIVATE)) {