Hello community,
here is the log from the commit of package libsolv for openSUSE:Factory checked in at 2012-06-26 17:45:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libsolv (Old)
and /work/SRC/openSUSE:Factory/.libsolv.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libsolv", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes 2012-06-01 07:21:01.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libsolv.new/libsolv.changes 2012-06-26 17:45:46.000000000 +0200
@@ -1,0 +2,5 @@
+Mon Jun 25 13:40:58 CEST 2012 - mls@suse.de
+
+- fix typo in repodata_merge_attrs [bnc#767510]
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libsolv-0.1.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/.travis.yml new/libsolv-0.1.0/.travis.yml
--- old/libsolv-0.1.0/.travis.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/libsolv-0.1.0/.travis.yml 2012-06-25 14:17:22.000000000 +0200
@@ -0,0 +1,5 @@
+language: C
+before_script: sudo apt-get install cmake
+script: mkdir build && cd build && cmake -DDEBIAN=1 -DMULTI_SEMANTICS=1 .. && make && make test
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/CMakeLists.txt new/libsolv-0.1.0/CMakeLists.txt
--- old/libsolv-0.1.0/CMakeLists.txt 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/CMakeLists.txt 2012-06-25 14:17:22.000000000 +0200
@@ -20,8 +20,10 @@
OPTION (ENABLE_DEBIAN "Build with debian database/repository support?" OFF)
OPTION (ENABLE_MDKREPO "Build with mandriva/mageia repository support?" OFF)
OPTION (ENABLE_ARCHREPO "Build with archlinux repository support?" OFF)
+OPTION (ENABLE_CUDFREPO "Build with cudf repository support?" OFF)
OPTION (ENABLE_LZMA_COMPRESSION "Build with lzma/xz compression support?" OFF)
+OPTION (ENABLE_BZIP2_COMPRESSION "Build with bzip2 compression support?" OFF)
#IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)
#ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)
@@ -112,6 +114,9 @@
IF (ENABLE_LZMA_COMPRESSION)
FIND_PACKAGE (LZMA REQUIRED)
ENDIF (ENABLE_LZMA_COMPRESSION)
+IF (ENABLE_BZIP2_COMPRESSION)
+FIND_PACKAGE (BZip2 REQUIRED)
+ENDIF (ENABLE_BZIP2_COMPRESSION)
IF (RPM5)
MESSAGE (STATUS "Enabling RPM 5 support")
@@ -167,7 +172,7 @@
FOREACH (VAR HAVE_STRCHRNUL HAVE_FOPENCOOKIE HAVE_FUNOPEN WORDS_BIGENDIAN
ENABLE_RPMDB ENABLE_RPMDB_PUBKEY ENABLE_RPMMD ENABLE_SUSEREPO ENABLE_COMPS
ENABLE_HELIXREPO ENABLE_MDKREPO ENABLE_ARCHREPO ENABLE_DEBIAN
- ENABLE_LZMA_COMPRESSION)
+ ENABLE_LZMA_COMPRESSION ENABLE_BZIP2_COMPRESSION)
IF(${VAR})
ADD_DEFINITIONS (-D${VAR}=1)
SET (SWIG_FLAGS ${SWIG_FLAGS} -D${VAR})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/bindings/CMakeLists.txt new/libsolv-0.1.0/bindings/CMakeLists.txt
--- old/libsolv-0.1.0/bindings/CMakeLists.txt 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/bindings/CMakeLists.txt 2012-06-25 14:17:22.000000000 +0200
@@ -3,6 +3,9 @@
IF (ENABLE_LZMA_COMPRESSION)
SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LZMA_LIBRARY})
ENDIF (ENABLE_LZMA_COMPRESSION)
+IF (ENABLE_BZIP2_COMPRESSION)
+SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${BZIP2_LIBRARIES})
+ENDIF (ENABLE_BZIP2_COMPRESSION)
IF (NOT DEBIAN)
SET (SYSTEM_LIBRARIES ${RPMDB_LIBRARY} ${SYSTEM_LIBRARIES})
ENDIF (NOT DEBIAN)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/examples/CMakeLists.txt new/libsolv-0.1.0/examples/CMakeLists.txt
--- old/libsolv-0.1.0/examples/CMakeLists.txt 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/examples/CMakeLists.txt 2012-06-25 14:17:23.000000000 +0200
@@ -3,6 +3,9 @@
IF (ENABLE_LZMA_COMPRESSION)
SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LZMA_LIBRARY})
ENDIF (ENABLE_LZMA_COMPRESSION)
+IF (ENABLE_BZIP2_COMPRESSION)
+SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${BZIP2_LIBRARIES})
+ENDIF (ENABLE_BZIP2_COMPRESSION)
IF (NOT DEBIAN)
SET (SYSTEM_LIBRARIES ${RPMDB_LIBRARY} ${SYSTEM_LIBRARIES})
ENDIF (NOT DEBIAN)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/examples/solv.c new/libsolv-0.1.0/examples/solv.c
--- old/libsolv-0.1.0/examples/solv.c 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/examples/solv.c 2012-06-25 14:17:23.000000000 +0200
@@ -1494,15 +1494,19 @@
load_stub(Pool *pool, Repodata *data, void *dp)
{
struct repoinfo *cinfo = data->repo->appdata;
+ switch (cinfo->type)
+ {
#ifdef ENABLE_SUSEREPO
- if (cinfo->type == TYPE_SUSETAGS)
- return susetags_load_ext(data->repo, data);
+ case TYPE_SUSETAGS:
+ return susetags_load_ext(data->repo, data);
#endif
#ifdef ENABLE_RPMMD
- if (cinfo->type == TYPE_RPMMD)
- return repomd_load_ext(data->repo, data);
+ case TYPE_RPMMD:
+ return repomd_load_ext(data->repo, data);
#endif
- return 0;
+ default:
+ return 0;
+ }
}
static unsigned char installedcookie[32];
@@ -1644,7 +1648,9 @@
#endif
struct stat stb;
Pool *sigpool = 0;
+#if defined(ENABLE_SUSEREPO) || defined(ENABLE_RPMMD)
Repodata *data;
+#endif
int badchecksum;
int dorefresh;
#if defined(ENABLE_DEBIAN)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/ext/CMakeLists.txt new/libsolv-0.1.0/ext/CMakeLists.txt
--- old/libsolv-0.1.0/ext/CMakeLists.txt 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/ext/CMakeLists.txt 2012-06-25 14:17:22.000000000 +0200
@@ -64,6 +64,13 @@
repo_arch.h)
ENDIF (ENABLE_ARCHREPO)
+IF (ENABLE_CUDFREPO)
+ SET (libsolvext_SRCS ${libsolvext_SRCS}
+ repo_cudf.c)
+ SET (libsolvext_HEADERS ${libsolvext_HEADERS}
+ repo_cudf.h)
+ENDIF (ENABLE_CUDFREPO)
+
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
SET (CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/ext/libsolvext.ver")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/ext/libsolvext.ver new/libsolv-0.1.0/ext/libsolvext.ver
--- old/libsolv-0.1.0/ext/libsolvext.ver 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/ext/libsolvext.ver 2012-06-25 14:17:22.000000000 +0200
@@ -7,6 +7,7 @@
repo_add_code11_products;
repo_add_content;
repo_add_comps;
+ repo_add_cudf;
repo_add_deb;
repo_add_debdb;
repo_add_debpackages;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/ext/repo_cudf.c new/libsolv-0.1.0/ext/repo_cudf.c
--- old/libsolv-0.1.0/ext/repo_cudf.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libsolv-0.1.0/ext/repo_cudf.c 2012-06-25 14:17:22.000000000 +0200
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 2012, Novell Inc.
+ *
+ * This program is licensed under the BSD license, read LICENSE.BSD
+ * for further information
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "pool.h"
+#include "repo.h"
+#include "util.h"
+#include "chksum.h"
+#include "solver.h"
+#include "repo_cudf.h"
+
+static Id
+parseonedep(Pool *pool, char *p)
+{
+ char *n, *ne, *e, *ee;
+ Id name, evr;
+ int flags;
+
+ while (*p == ' ' || *p == '\t' || *p == '\n')
+ p++;
+ if (!*p)
+ return 0;
+ if (!strcmp(p, "!true"))
+ return 0;
+ if (!strcmp(p, "!false"))
+ return pool_str2id(pool, p, 1);
+ n = p;
+ /* find end of name */
+ while (*p && *p != ' ' && *p != '\t' && *p != '\n' && *p != '|')
+ p++;
+ ne = p;
+ while (*p == ' ' || *p == '\t' || *p == '\n')
+ p++;
+ evr = 0;
+ flags = 0;
+ e = ee = 0;
+ if (*p == '>' || *p == '<' || *p == '=' || *p == '!')
+ {
+ if (*p == '>')
+ flags |= REL_GT;
+ else if (*p == '=')
+ flags |= REL_EQ;
+ else if (*p == '<')
+ flags |= REL_LT;
+ else if (*p == '!')
+ flags |= REL_LT | REL_GT | REL_EQ;
+ p++;
+ if (flags && *p == '=')
+ {
+ if (p[-1] != '=')
+ flags ^= REL_EQ;
+ p++;
+ }
+ while (*p == ' ' || *p == '\t' || *p == '\n')
+ p++;
+ e = p;
+ while (*p && *p != ' ' && *p != '\t' && *p != '\n' && *p != '|')
+ p++;
+ ee = p;
+ while (*p == ' ' || *p == '\t' || *p == '\n')
+ p++;
+ }
+ name = pool_strn2id(pool, n, ne - n, 1);
+ if (e)
+ {
+ evr = pool_strn2id(pool, e, ee - e, 1);
+ name = pool_rel2id(pool, name, evr, flags, 1);
+ }
+ if (*p == '|')
+ {
+ Id id = parseonedep(pool, p + 1);
+ if (id)
+ name = pool_rel2id(pool, name, id, REL_OR, 1);
+ }
+ return name;
+}
+static unsigned int
+makedeps(Repo *repo, char *deps, unsigned int olddeps, Id marker)
+{
+ Pool *pool = repo->pool;
+ char *p;
+ Id id;
+
+ while ((p = strchr(deps, ',')) != 0)
+ {
+ *p = 0;
+ olddeps = makedeps(repo, deps, olddeps, marker);
+ *p = ',';
+ deps = p + 1;
+ }
+ id = parseonedep(pool, deps);
+ if (!id)
+ return olddeps;
+ return repo_addid_dep(repo, olddeps, id, marker);
+}
+
+static Offset
+copydeps(Pool *pool, Repo *repo, Offset fromoff, Repo *fromrepo)
+{
+ Id *ida, *from;
+ int cc;
+ Offset off;
+
+ if (!fromoff)
+ return 0;
+ from = fromrepo->idarraydata + fromoff;
+ for (ida = from, cc = 0; *ida; ida++, cc++)
+ ;
+ if (cc == 0)
+ return 0;
+ off = repo_reserve_ids(repo, 0, cc);
+ memcpy(repo->idarraydata + off, from, (cc + 1) * sizeof(Id));
+ repo->idarraysize += cc + 1;
+ return off;
+}
+
+static void
+copysolvabledata(Pool *pool, Solvable *s, Repo *repo)
+{
+ Repo *srepo = s->repo;
+ if (srepo == repo)
+ return;
+ s->provides = copydeps(pool, repo, s->provides, srepo);
+ s->requires = copydeps(pool, repo, s->requires, srepo);
+ s->conflicts = copydeps(pool, repo, s->conflicts, srepo);
+ s->obsoletes = copydeps(pool, repo, s->obsoletes, srepo);
+ s->recommends = copydeps(pool, repo, s->recommends, srepo);
+ s->suggests = copydeps(pool, repo, s->suggests, srepo);
+ s->supplements = copydeps(pool, repo, s->supplements, srepo);
+ s->enhances = copydeps(pool, repo, s->enhances, srepo);
+}
+
+#define KEEP_VERSION 1
+#define KEEP_PACKAGE 2
+#define KEEP_FEATURE 3
+
+static void
+finishpackage(Pool *pool, Solvable *s, int keep, Queue *job)
+{
+ Id *idp, id, sid;
+ if (!s)
+ return;
+ if (!s->arch)
+ s->arch = ARCH_ANY;
+ if (!s->evr)
+ s->evr = ID_EMPTY;
+ sid = pool_rel2id(pool, s->name, s->evr, REL_EQ, 1);
+ s->provides = repo_addid_dep(s->repo, s->provides, sid, 0);
+ if (!job || !pool->installed || s->repo != pool->installed)
+ return;
+ if (keep == KEEP_VERSION)
+ queue_push2(job, SOLVER_INSTALL|SOLVER_SOLVABLE_NAME, sid);
+ else if (keep == KEEP_PACKAGE)
+ queue_push2(job, SOLVER_INSTALL|SOLVER_SOLVABLE_NAME, s->name);
+ else if (keep == KEEP_FEATURE)
+ {
+ for (idp = s->repo->idarraydata + s->provides; (id = *idp) != 0; idp++)
+ {
+ if (id != sid) /* skip self-provides */
+ queue_push2(job, SOLVER_INSTALL|SOLVER_SOLVABLE_PROVIDES, id);
+ }
+ }
+}
+
+int
+repo_add_cudf(Repo *repo, Repo *installedrepo, FILE *fp, Queue *job, int flags)
+{
+ Pool *pool = repo->pool;
+ char *buf, *p;
+ int bufa, bufl, c;
+ Solvable *s;
+ int instanza = 0;
+ int inrequest = 0;
+ int isinstalled = 0;
+ int keep = 0;
+ Repo *xrepo;
+
+ xrepo = repo ? repo : installedrepo;
+ if (!xrepo)
+ return -1;
+
+ buf = solv_malloc(4096);
+ bufa = 4096;
+ bufl = 0;
+ s = 0;
+
+ while (fgets(buf + bufl, bufa - bufl, fp) > 0)
+ {
+ bufl += strlen(buf + bufl);
+ if (bufl && buf[bufl - 1] != '\n')
+ {
+ if (bufa - bufl < 256)
+ {
+ bufa += 4096;
+ buf = solv_realloc(buf, bufa);
+ }
+ continue;
+ }
+ buf[--bufl] = 0;
+ c = getc(fp);
+ if (c == ' ' || c == '\t')
+ {
+ /* continuation line */
+ buf[bufl++] = ' ';
+ continue;
+ }
+ if (c != EOF)
+ ungetc(c, fp);
+ bufl = 0;
+ if (*buf == '#')
+ continue;
+ if (!*buf)
+ {
+ if (s && !repo && !isinstalled)
+ {
+ repo_free_solvable(repo, s - pool->solvables, 1);
+ s = 0;
+ }
+ if (s)
+ finishpackage(pool, s, keep, job);
+ s = 0;
+ keep = 0;
+ instanza = 0;
+ inrequest = 0;
+ continue;
+ }
+ p = strchr(buf, ':');
+ if (!p)
+ continue; /* hmm */
+ *p++ = 0;
+ while (*p == ' ' || *p == '\t')
+ p++;
+ if (!instanza)
+ {
+ instanza = 1;
+ inrequest = 0;
+ if (!strcmp(buf, "request"))
+ {
+ inrequest = 1;
+ continue;
+ }
+ if (!strcmp(buf, "package"))
+ {
+ s = pool_id2solvable(pool, repo_add_solvable(xrepo));
+ isinstalled = 0;
+ keep = 0;
+ }
+ }
+ if (inrequest)
+ {
+ if (!job)
+ continue;
+ if (!strcmp(buf, "install"))
+ {
+ Id id, *idp;
+ Offset off = makedeps(xrepo, p, 0, 0);
+ for (idp = xrepo->idarraydata + off; (id = *idp) != 0; idp++)
+ queue_push2(job, SOLVER_INSTALL|SOLVER_SOLVABLE_PROVIDES, id);
+ }
+ else if (!strcmp(buf, "remove"))
+ {
+ Id id, *idp;
+ Offset off = makedeps(xrepo, p, 0, 0);
+ for (idp = xrepo->idarraydata + off; (id = *idp) != 0; idp++)
+ queue_push2(job, SOLVER_ERASE|SOLVER_SOLVABLE_PROVIDES, id);
+ }
+ else if (!strcmp(buf, "upgrade"))
+ {
+ Id id, *idp;
+ Offset off = makedeps(xrepo, p, 0, 0);
+ for (idp = xrepo->idarraydata + off; (id = *idp) != 0; idp++)
+ queue_push2(job, SOLVER_INSTALL|SOLVER_ORUPDATE|SOLVER_SOLVABLE_PROVIDES, id);
+ }
+ continue;
+ }
+ if (!s)
+ continue; /* we ignore the preamble for now */
+ switch (buf[0])
+ {
+ case 'c':
+ if (!strcmp(buf, "conflicts"))
+ {
+ s->conflicts = makedeps(s->repo, p, s->conflicts, 0);
+ continue;
+ }
+ case 'd':
+ if (!strcmp(buf, "depends"))
+ {
+ s->requires = makedeps(s->repo, p, s->requires, 0);
+ continue;
+ }
+ break;
+ case 'k':
+ if (!strcmp(buf, "keep"))
+ {
+ if (!job)
+ continue;
+ if (!strcmp(p, "version"))
+ keep = KEEP_VERSION;
+ else if (!strcmp(p, "package"))
+ keep = KEEP_PACKAGE;
+ else if (!strcmp(p, "feature"))
+ keep = KEEP_FEATURE;
+ continue;
+ }
+ break;
+ case 'i':
+ if (!strcmp(buf, "installed"))
+ {
+ if (!strcmp(p, "true"))
+ {
+ isinstalled = 1;
+ if (!installedrepo)
+ {
+ repo_free_solvable(repo, s - pool->solvables, 1);
+ s = 0;
+ }
+ else if (s->repo != installedrepo)
+ {
+ copysolvabledata(pool, s, installedrepo);
+ s->repo->nsolvables--;
+ s->repo = installedrepo;
+ if (s - pool->solvables < s->repo->start)
+ s->repo->start = s - pool->solvables;
+ if (s - pool->solvables >= s->repo->end)
+ s->repo->end = s - pool->solvables + 1;
+ s->repo->nsolvables++;
+ }
+ }
+ continue;
+ }
+ break;
+ case 'p':
+ if (!strcmp(buf, "package"))
+ {
+ s->name = pool_str2id(pool, p, 1);
+ continue;
+ }
+ if (!strcmp(buf, "provides"))
+ {
+ s->provides = makedeps(s->repo, p, s->provides, 0);
+ continue;
+ }
+ break;
+ case 'r':
+ if (!strcmp(buf, "depends"))
+ {
+ s->recommends = makedeps(s->repo, p, s->recommends, 0);
+ continue;
+ }
+ break;
+ case 'v':
+ if (!strcmp(buf, "version"))
+ {
+ s->evr = pool_str2id(pool, p, 1);
+ continue;
+ }
+ break;
+ }
+ }
+ if (s && !repo && !isinstalled)
+ {
+ repo_free_solvable(repo, s - pool->solvables, 1);
+ s = 0;
+ }
+ if (s)
+ finishpackage(pool, s, keep, job);
+ solv_free(buf);
+ return 0;
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/ext/repo_cudf.h new/libsolv-0.1.0/ext/repo_cudf.h
--- old/libsolv-0.1.0/ext/repo_cudf.h 1970-01-01 01:00:00.000000000 +0100
+++ new/libsolv-0.1.0/ext/repo_cudf.h 2012-06-25 14:17:22.000000000 +0200
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 2012, Novell Inc.
+ *
+ * This program is licensed under the BSD license, read LICENSE.BSD
+ * for further information
+ */
+
+extern int repo_add_cudf(Repo *repo, Repo *installedrepo, FILE *fp, Queue *job, int flags);
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/ext/solv_xfopen.c new/libsolv-0.1.0/ext/solv_xfopen.c
--- old/libsolv-0.1.0/ext/solv_xfopen.c 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/ext/solv_xfopen.c 2012-06-25 14:17:22.000000000 +0200
@@ -50,31 +50,67 @@
static ssize_t cookie_gzread(void *cookie, char *buf, size_t nbytes)
{
- return gzread((gzFile *)cookie, buf, nbytes);
+ return gzread((gzFile)cookie, buf, nbytes);
}
static ssize_t cookie_gzwrite(void *cookie, const char *buf, size_t nbytes)
{
- return gzwrite((gzFile *)cookie, buf, nbytes);
+ return gzwrite((gzFile)cookie, buf, nbytes);
}
static int cookie_gzclose(void *cookie)
{
- return gzclose((gzFile *)cookie);
+ return gzclose((gzFile)cookie);
}
static inline FILE *mygzfopen(const char *fn, const char *mode)
{
- gzFile *gzf = gzopen(fn, mode);
+ gzFile gzf = gzopen(fn, mode);
return cookieopen(gzf, mode, cookie_gzread, cookie_gzwrite, cookie_gzclose);
}
static inline FILE *mygzfdopen(int fd, const char *mode)
{
- gzFile *gzf = gzdopen(fd, mode);
+ gzFile gzf = gzdopen(fd, mode);
return cookieopen(gzf, mode, cookie_gzread, cookie_gzwrite, cookie_gzclose);
}
+#ifdef ENABLE_BZIP2_COMPRESSION
+
+#include
+
+/* bzip2 compression */
+
+static ssize_t cookie_bzread(void *cookie, char *buf, size_t nbytes)
+{
+ return BZ2_bzread((BZFILE *)cookie, buf, nbytes);
+}
+
+static ssize_t cookie_bzwrite(void *cookie, const char *buf, size_t nbytes)
+{
+ return BZ2_bzwrite((BZFILE *)cookie, (char *)buf, nbytes);
+}
+
+static int cookie_bzclose(void *cookie)
+{
+ BZ2_bzclose((BZFILE *)cookie);
+ return 0;
+}
+
+static inline FILE *mybzfopen(const char *fn, const char *mode)
+{
+ BZFILE *bzf = BZ2_bzopen(fn, mode);
+ return cookieopen(bzf, mode, cookie_bzread, cookie_bzwrite, cookie_bzclose);
+}
+
+static inline FILE *mybzfdopen(int fd, const char *mode)
+{
+ BZFILE *bzf = BZ2_bzdopen(fd, mode);
+ return cookieopen(bzf, mode, cookie_bzread, cookie_bzwrite, cookie_bzclose);
+}
+
+#endif
+
#ifdef ENABLE_LZMA_COMPRESSION
@@ -290,6 +326,10 @@
if (suf && !strcmp(suf, ".lzma"))
return mylzfopen(fn, mode);
#endif
+#ifdef ENABLE_BZIP2_COMPRESSION
+ if (suf && !strcmp(suf, ".bz2"))
+ return mybzfopen(fn, mode);
+#endif
return fopen(fn, mode);
}
@@ -324,6 +364,10 @@
if (suf && !strcmp(suf, ".lzma"))
return mylzfdopen(fd, simplemode);
#endif
+#ifdef ENABLE_BZIP2_COMPRESSION
+ if (suf && !strcmp(suf, ".bz2"))
+ return mybzfdopen(fd, simplemode);
+#endif
return fdopen(fd, mode);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/ext/testcase.c new/libsolv-0.1.0/ext/testcase.c
--- old/libsolv-0.1.0/ext/testcase.c 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/ext/testcase.c 2012-06-25 14:17:22.000000000 +0200
@@ -53,6 +53,8 @@
{ SOLVER_WEAK, "weak" },
{ SOLVER_ESSENTIAL, "essential" },
{ SOLVER_CLEANDEPS, "cleandeps" },
+ { SOLVER_ORUPDATE, "orupdate" },
+ { SOLVER_FORCEBEST, "forcebest" },
{ SOLVER_SETEV, "setev" },
{ SOLVER_SETEVR, "setevr" },
{ SOLVER_SETARCH, "setarch" },
@@ -108,6 +110,15 @@
{ 0, 0, 0 }
};
+static struct disttype2str {
+ Id type;
+ const char *str;
+} disttype2str[] = {
+ { DISTTYPE_RPM, "rpm" },
+ { DISTTYPE_DEB, "deb" },
+ { DISTTYPE_ARCH, "arch" },
+ { 0, 0 },
+};
typedef struct strqueue {
char **str;
@@ -1475,7 +1486,7 @@
}
/* hmm, this is not optimal... we currently search for the lowest score */
lowscore = 0;
- arch = ARCH_NOARCH;
+ arch = pool->solvables[SYSTEMSOLVABLE].arch;
for (i = 0; i < pool->lastarch; i++)
{
if (pool->id2arch[i] == 1 && !lowscore)
@@ -1486,7 +1497,11 @@
lowscore = pool->id2arch[i];
}
}
- cmd = pool_tmpjoin(pool, "system ", pool_id2str(pool, arch), pool->disttype == DISTTYPE_DEB ? " deb" : " rpm");
+ cmd = pool_tmpjoin(pool, "system ", pool->lastarch ? pool_id2str(pool, arch) : "unset", 0);
+ for (i = 0; disttype2str[i].str != 0; i++)
+ if (pool->disttype == disttype2str[i].type)
+ break;
+ pool_tmpappend(pool, cmd, " ", disttype2str[i].str ? disttype2str[i].str : "unknown");
if (pool->installed)
cmd = pool_tmpappend(pool, cmd, " ", testcase_repoid2str(pool, pool->installed->repoid));
strqueue_push(&sq, cmd);
@@ -1529,8 +1544,9 @@
Reldep *rd = pool->rels + rid;
if (rd->flags != REL_NAMESPACE || rd->name == NAMESPACE_OTHERPROVIDERS)
continue;
- /* check if we evaluated it, also skip empty results */
- if (!(d = pool->whatprovides_rel[rid]) || !pool->whatprovidesdata[d])
+ /* evaluate all namespace ids, skip empty results */
+ d = pool_whatprovides(pool, MAKERELDEP(rid));
+ if (!d || !pool->whatprovidesdata[d])
continue;
cmd = pool_tmpjoin(pool, "namespace ", pool_id2str(pool, rd->name), "(");
cmd = pool_tmpappend(pool, cmd, pool_id2str(pool, rd->evr), ")");
@@ -1832,8 +1848,26 @@
}
else if (!strcmp(pieces[0], "system") && npieces >= 3)
{
+ int i;
prepared = 0;
- pool_setarch(pool, pieces[1]);
+ /* must set the disttype before the arch */
+ for (i = 0; disttype2str[i].str != 0; i++)
+ if (!strcmp(disttype2str[i].str, pieces[2]))
+ break;
+ if (!disttype2str[i].str)
+ pool_debug(pool, SOLV_ERROR, "testcase_read: system: unknown disttype '%s'\n", pieces[2]);
+ else if (pool->disttype != disttype2str[i].type)
+ {
+#ifdef MULTI_SEMANTICS
+ pool_setdisttype(pool, disttype2str[i].type);
+#else
+ pool_debug(pool, SOLV_ERROR, "testcase_read: system: cannot change disttype to '%s'\n", pieces[2]);
+#endif
+ }
+ if (strcmp(pieces[1], "unset") != 0)
+ pool_setarch(pool, pieces[1]);
+ else
+ pool_setarch(pool, 0);
if (npieces > 3)
{
Repo *repo = testcase_str2repo(pool, pieces[3]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/package/libsolv.changes new/libsolv-0.1.0/package/libsolv.changes
--- old/libsolv-0.1.0/package/libsolv.changes 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/package/libsolv.changes 2012-06-25 14:17:23.000000000 +0200
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Mon Jun 25 13:40:58 CEST 2012 - mls@suse.de
+
+- fix typo in repodata_merge_attrs [bnc#767510]
+
+-------------------------------------------------------------------
Wed May 30 14:46:48 CEST 2012 - mls@suse.de
- fix build for older suse versions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/src/libsolv.ver new/libsolv-0.1.0/src/libsolv.ver
--- old/libsolv-0.1.0/src/libsolv.ver 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/src/libsolv.ver 2012-06-25 14:17:22.000000000 +0200
@@ -90,6 +90,7 @@
pool_setdebugcallback;
pool_setdebuglevel;
pool_setdebugmask;
+ pool_setdisttype;
pool_setloadcallback;
pool_setvendorclasses;
pool_shrink_rels;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/src/repodata.c new/libsolv-0.1.0/src/repodata.c
--- old/libsolv-0.1.0/src/repodata.c 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/src/repodata.c 2012-06-25 14:17:22.000000000 +0200
@@ -2425,7 +2425,7 @@
repodata_merge_attrs(Repodata *data, Id dest, Id src)
{
Id *keyp;
- if (dest == src || data->attrs || !(keyp = data->attrs[src - data->start]))
+ if (dest == src || !data->attrs || !(keyp = data->attrs[src - data->start]))
return;
for (; *keyp; keyp += 2)
repodata_insert_keyid(data, dest, keyp[0], keyp[1], 0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/src/solver.c new/libsolv-0.1.0/src/solver.c
--- old/libsolv-0.1.0/src/solver.c 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/src/solver.c 2012-06-25 14:17:22.000000000 +0200
@@ -1681,7 +1681,8 @@
if (l || !dq.count)
continue;
/* prune to installed if not updating */
- if (dq.count > 1 && solv->installed && !solv->updatemap_all)
+ if (dq.count > 1 && solv->installed && !solv->updatemap_all &&
+ !(solv->job.elements[solv->ruletojob.elements[i - solv->jobrules]] & SOLVER_ORUPDATE))
{
int j, k;
for (j = k = 0; j < dq.count; j++)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/src/solver.h new/libsolv-0.1.0/src/solver.h
--- old/libsolv-0.1.0/src/solver.h 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/src/solver.h 2012-06-25 14:17:22.000000000 +0200
@@ -249,6 +249,15 @@
#define SOLVER_WEAK 0x010000
#define SOLVER_ESSENTIAL 0x020000
#define SOLVER_CLEANDEPS 0x040000
+/* ORUPDATE makes SOLVER_INSTALL not prune to installed
+ * packages, thus updating installed packages */
+#define SOLVER_ORUPDATE 0x080000
+/* FORCEBEST makes the solver insist on best packages, so
+ * you will get problem reported if the best package is
+ * not installable. This can be used with INSTALL, UPDATE
+ * and DISTUPGRADE */
+/* Also, it's not implemented yet ;) */
+#define SOLVER_FORCEBEST 0x100000
#define SOLVER_SETEV 0x01000000
#define SOLVER_SETEVR 0x02000000
@@ -316,7 +325,6 @@
int solver_calc_installsizechange(Solver *solv);
void solver_trivial_installable(Solver *solv, Queue *pkgs, Queue *res);
-void solver_find_involved(Solver *solv, Queue *installedq, Solvable *s, Queue *q);
/* iterate over all literals of a rule */
/* WARNING: loop body must not relocate whatprovidesdata, e.g. by
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/tools/CMakeLists.txt new/libsolv-0.1.0/tools/CMakeLists.txt
--- old/libsolv-0.1.0/tools/CMakeLists.txt 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/tools/CMakeLists.txt 2012-06-25 14:17:22.000000000 +0200
@@ -9,6 +9,9 @@
IF (ENABLE_LZMA_COMPRESSION)
SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LZMA_LIBRARY})
ENDIF (ENABLE_LZMA_COMPRESSION)
+IF (ENABLE_BZIP2_COMPRESSION)
+SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${BZIP2_LIBRARIES})
+ENDIF (ENABLE_BZIP2_COMPRESSION)
IF (ENABLE_RPMDB)
SET (SYSTEM_LIBRARIES ${RPMDB_LIBRARY} ${SYSTEM_LIBRARIES})
ENDIF (ENABLE_RPMDB)
@@ -82,6 +85,11 @@
SET (tools_list ${tools_list} archpkgs2solv archrepo2solv)
ENDIF (ENABLE_ARCHREPO)
+IF (ENABLE_CUDFREPO)
+ADD_EXECUTABLE (cudftest cudftest.c)
+TARGET_LINK_LIBRARIES (cudftest libsolvext libsolv ${SYSTEM_LIBRARIES})
+ENDIF (ENABLE_CUDFREPO)
+
ADD_EXECUTABLE (installcheck installcheck.c)
TARGET_LINK_LIBRARIES (installcheck libsolvext libsolv ${SYSTEM_LIBRARIES})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/tools/cudftest.c new/libsolv-0.1.0/tools/cudftest.c
--- old/libsolv-0.1.0/tools/cudftest.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libsolv-0.1.0/tools/cudftest.c 2012-06-25 14:17:22.000000000 +0200
@@ -0,0 +1,156 @@
+#include
+#include
+#include
+
+#include "pool.h"
+#include "evr.h"
+#include "solver.h"
+#include "solverdebug.h"
+#include "repo_cudf.h"
+#include "repo_write.h"
+#include "solv_xfopen.h"
+
+static void
+dump_repo(Repo *repo, char *name)
+{
+ FILE *fp;
+ if ((fp = fopen(name, "w")) == 0)
+ {
+ perror(name);
+ exit(1);
+ }
+ repo_write(repo, fp);
+ fclose(fp);
+}
+
+static int
+sortfunc(const void *ap, const void *bp, void *dp)
+{
+ Pool *pool = dp;
+ Solvable *sa, *sb;
+ sa = pool->solvables + *(Id *)ap;
+ sb = pool->solvables + *(Id *)bp;
+ if (sa->name != sb->name)
+ {
+ int r = strcmp(pool_id2str(pool, sa->name), pool_id2str(pool, sb->name));
+ if (r)
+ return r;
+ }
+ if (sa->evr != sb->evr)
+ {
+ int r = pool_evrcmp(pool, sa->evr, sb->evr, EVRCMP_COMPARE);
+ if (r)
+ return r;
+ }
+ return *(Id *)ap - *(Id *)bp;
+}
+
+int
+main(int argc, char **argv)
+{
+ char *cudfin;
+ char *cudfout = 0;
+ Pool *pool;
+ Repo *installed, *repo;
+ FILE *fp, *ofp;
+ Solver *solv;
+ Transaction *trans;
+ Queue job;
+ Queue dq;
+ int i;
+ int debug = 0;
+
+ while (argc > 1 && !strcmp(argv[1], "-d"))
+ {
+ debug++;
+ argc--;
+ argv++;
+ }
+ if (argc < 2)
+ {
+ fprintf(stderr, "Usage: cudftest <cudfin> [cudfout]\n");
+ exit(1);
+ }
+ cudfin = argv[1];
+ cudfout = argc > 2 ? argv[2] : 0;
+
+ if ((fp = solv_xfopen(cudfin, 0)) == 0)
+ {
+ perror(cudfin);
+ exit(1);
+ }
+ pool = pool_create();
+ if (debug > 1)
+ pool_setdebuglevel(pool, debug - 1);
+ installed = repo_create(pool, "installed");
+ pool_set_installed(pool, installed);
+ repo = repo_create(pool, "repo");
+ queue_init(&job);
+ repo_add_cudf(repo, installed, fp, &job, 0);
+ pool_createwhatprovides(pool);
+
+ /* debug */
+ if (debug)
+ {
+ dump_repo(installed, "cudf_installed.solv");
+ dump_repo(repo, "cudf_repo.solv");
+ }
+
+ solv = solver_create(pool);
+ solver_set_flag(solv, SOLVER_FLAG_ALLOW_UNINSTALL, 1);
+ /* solver_set_flag(solv, SOLVER_FLAG_IGNORE_RECOMMENDED, 1); */
+
+ queue_push2(&job, SOLVER_VERIFY | SOLVER_SOLVABLE_ALL, 0);
+ if (solver_solve(solv, &job) != 0)
+ {
+ int problem;
+ int pcnt = solver_problem_count(solv);
+ printf("Found %d problems:\n", pcnt);
+ for (problem = 1; problem <= pcnt; problem++)
+ {
+ printf("Problem %d:\n", problem);
+ solver_printprobleminfo(solv, problem);
+ printf("\n");
+ }
+ }
+ trans = solver_create_transaction(solv);
+ solver_free(solv);
+
+ if (debug)
+ transaction_print(trans);
+
+ queue_init(&dq);
+ transaction_installedresult(trans, &dq);
+ solv_sort(dq.elements, dq.count, sizeof(Id), sortfunc, pool);
+
+ ofp = stdout;
+ if (cudfout && ((ofp = fopen(cudfout, "w")) == 0))
+ {
+ perror(cudfout);
+ exit(1);
+ }
+ for (i = 0; i < dq.count; i++)
+ {
+ Solvable *s = pool_id2solvable(pool, dq.elements[i]);
+ fprintf(ofp, "package: %s\n", pool_id2str(pool, s->name));
+ fprintf(ofp, "version: %s\n", pool_id2str(pool, s->evr));
+ fprintf(ofp, "installed: true\n");
+ if (s->repo == pool->installed)
+ fprintf(ofp, "was-installed: true\n");
+ fprintf(ofp, "\n");
+ }
+ queue_free(&dq);
+ transaction_free(trans);
+ queue_free(&job);
+ pool_free(pool);
+ if (ofp != stdout)
+ {
+ if (fclose(ofp))
+ {
+ perror("fclose");
+ exit(1);
+ }
+ }
+ exit(0);
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.1.0/tools/installcheck.c new/libsolv-0.1.0/tools/installcheck.c
--- old/libsolv-0.1.0/tools/installcheck.c 2012-05-31 12:11:34.000000000 +0200
+++ new/libsolv-0.1.0/tools/installcheck.c 2012-06-25 14:17:22.000000000 +0200
@@ -60,7 +60,10 @@
char *arch, *exclude_pat;
int i, j;
Id p;
- Id rpmid, rpmarch, rpmrel, archlock;
+ Id rpmarch, rpmrel, archlock;
+#ifndef DEBIAN
+ Id rpmid;
+#endif
int status = 0;
int nocheck = 0;
int withsrc = 0;
@@ -157,10 +160,10 @@
}
pool_addfileprovides(pool);
pool_createwhatprovides(pool);
+#ifndef DEBIAN
rpmid = pool_str2id(pool, "rpm", 0);
rpmarch = pool_str2id(pool, arch, 0);
rpmrel = 0;
-#ifndef DEBIAN
if (rpmid && rpmarch)
{
for (p = 1; p < pool->nsolvables; p++)
@@ -172,6 +175,8 @@
if (p < pool->nsolvables)
rpmrel = pool_rel2id(pool, rpmid, rpmarch, REL_ARCH, 1);
}
+#else
+ rpmrel = rpmarch = 0;
#endif
queue_init(&job);
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org