Mailinglist Archive: zypp-commit (301 mails)

< Previous Next >
[zypp-commit] r7668 - in /trunk/sat-solver: bindings/ src/ testsuite/ tools/
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Fri, 26 Oct 2007 20:25:08 -0000
  • Message-id: <20071026202509.902D6173A8@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Fri Oct 26 22:25:08 2007
New Revision: 7668

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7668&view=rev
Log:
to follow SUSE tools conventions
Source is now Repo

Added:
trunk/sat-solver/src/repo.c
- copied, changed from r7667, trunk/sat-solver/src/source.c
trunk/sat-solver/src/repo.h
trunk/sat-solver/src/repo_solv.c
- copied, changed from r7667, trunk/sat-solver/src/source_solv.c
trunk/sat-solver/src/repo_solv.h
trunk/sat-solver/tools/repo_content.c
- copied, changed from r7667, trunk/sat-solver/tools/source_content.c
trunk/sat-solver/tools/repo_content.h
trunk/sat-solver/tools/repo_helix.c
- copied, changed from r7667, trunk/sat-solver/tools/source_helix.c
trunk/sat-solver/tools/repo_helix.h
trunk/sat-solver/tools/repo_patchxml.c
- copied, changed from r7667, trunk/sat-solver/tools/source_patchxml.c
trunk/sat-solver/tools/repo_patchxml.h
trunk/sat-solver/tools/repo_rpmdb.c
- copied, changed from r7667, trunk/sat-solver/tools/source_rpmdb.c
trunk/sat-solver/tools/repo_rpmdb.h
trunk/sat-solver/tools/repo_rpmmd.c
- copied, changed from r7667, trunk/sat-solver/tools/source_rpmmd.c
trunk/sat-solver/tools/repo_rpmmd.h
trunk/sat-solver/tools/repo_susetags.c
- copied, changed from r7667, trunk/sat-solver/tools/source_susetags.c
trunk/sat-solver/tools/repo_susetags.h
trunk/sat-solver/tools/repo_write.c
- copied, changed from r7667, trunk/sat-solver/tools/source_write.c
trunk/sat-solver/tools/repo_write.h
Removed:
trunk/sat-solver/src/source.c
trunk/sat-solver/src/source.h
trunk/sat-solver/src/source_solv.c
trunk/sat-solver/src/source_solv.h
trunk/sat-solver/tools/source_content.c
trunk/sat-solver/tools/source_content.h
trunk/sat-solver/tools/source_helix.c
trunk/sat-solver/tools/source_helix.h
trunk/sat-solver/tools/source_patchxml.c
trunk/sat-solver/tools/source_patchxml.h
trunk/sat-solver/tools/source_rpmdb.c
trunk/sat-solver/tools/source_rpmdb.h
trunk/sat-solver/tools/source_rpmmd.c
trunk/sat-solver/tools/source_rpmmd.h
trunk/sat-solver/tools/source_susetags.c
trunk/sat-solver/tools/source_susetags.h
trunk/sat-solver/tools/source_write.c
trunk/sat-solver/tools/source_write.h
Modified:
trunk/sat-solver/bindings/satsolver.i
trunk/sat-solver/src/CMakeLists.txt
trunk/sat-solver/src/pool.c
trunk/sat-solver/src/pool.h
trunk/sat-solver/src/solvable.h
trunk/sat-solver/src/solver.c
trunk/sat-solver/src/solver.h
trunk/sat-solver/testsuite/deptestomatic.c
trunk/sat-solver/testsuite/gimmick.c
trunk/sat-solver/testsuite/yps.c
trunk/sat-solver/tools/CMakeLists.txt
trunk/sat-solver/tools/content2solv.c
trunk/sat-solver/tools/dumpsolv.c
trunk/sat-solver/tools/helix2solv.c
trunk/sat-solver/tools/mergesolv.c
trunk/sat-solver/tools/patchxml2solv.c
trunk/sat-solver/tools/rpmdb2solv.c
trunk/sat-solver/tools/rpmmd2solv.c
trunk/sat-solver/tools/susetags2solv.c

Modified: trunk/sat-solver/bindings/satsolver.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/satsolver.i?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/bindings/satsolver.i (original)
+++ trunk/sat-solver/bindings/satsolver.i Fri Oct 26 22:25:08 2007
@@ -17,8 +17,8 @@
#include "queue.h"
#include "solvable.h"
#include "solver.h"
-#include "source.h"
-#include "source_solv.h"
+#include "repo.h"
+#include "repo_solv.h"
}
#include <sstream>

@@ -64,14 +64,14 @@
void prepare()
{ pool_prepare($self);}

- void each_source()
+ void each_repo()
{
- for (int i = 0; i < $self->nsources; ++i )
- rb_yield(SWIG_NewPointerObj((void*) $self->sources[i],
SWIGTYPE_p__Source, 0));
+ for (int i = 0; i < $self->nrepos; ++i )
+ rb_yield(SWIG_NewPointerObj((void*) $self->repos[i], SWIGTYPE_p__Repo,
0));
}

Solvable *
- select_solvable(Source *source, char *name)
+ select_solvable(Repo *repo, char *name)
{
Id id;
Queue plist;
@@ -82,8 +82,8 @@
pool = $self;
id = str2id(pool, name, 1);
queueinit( &plist);
- i = source ? source->start : 1;
- end = source ? source->start + source->nsolvables : pool->nsolvables;
+ i = repo ? repo->start : 1;
+ end = repo ? repo->start + repo->nsolvables : pool->nsolvables;
for (; i < end; i++)
{
s = pool->solvables + i;
@@ -108,13 +108,13 @@
}


- Source* add_empty_source()
+ Repo* add_empty_repo()
{
- return pool_addsource_empty($self);
+ return pool_addrepo_empty($self);
}

- Source * add_source_solv(FILE *fp, const char *sourcename)
- { pool_addsource_solv($self, fp, sourcename); }
+ Repo * add_repo_solv(FILE *fp, const char *reponame)
+ { pool_addrepo_solv($self, fp, reponame); }
};
%newobject pool_create;
%delobject pool_free;
@@ -143,7 +143,7 @@
{ /*printf("push id\n");*/ queuepush($self, id); }

void push( Solvable *s )
- { /*printf("push solvable\n");*/ queuepush($self, (s -
s->source->pool->solvables)); }
+ { /*printf("push solvable\n");*/ queuepush($self, (s -
s->repo->pool->solvables)); }

void push_unique(Id id)
{ queuepushunique($self, id); }
@@ -173,20 +173,20 @@
//%rename(name_id) name();
%ignore name;
const char * name()
- { return id2str($self->source->pool, $self->name);}
+ { return id2str($self->repo->pool, $self->name);}

%rename("to_s") asString();
const char * asString()
{
std::stringstream ss;
- if ( $self->source == NULL )
+ if ( $self->repo == NULL )
return "<UNKNOWN>";

- ss << id2str($self->source->pool, $self->name);
+ ss << id2str($self->repo->pool, $self->name);
ss << "-";
- ss << id2str($self->source->pool, $self->evr);
+ ss << id2str($self->repo->pool, $self->evr);
ss << "-";
- ss << id2str($self->source->pool, $self->arch);
+ ss << id2str($self->repo->pool, $self->arch);
return ss.str().c_str();
}

@@ -196,7 +196,7 @@

%extend Solver {

- Solver( Pool *pool, Source *system ) { return solver_create(pool, system); }
+ Solver( Pool *pool, Repo *system ) { return solver_create(pool, system); }
~Solver() { solver_free($self); }

%rename("fix_system") fixsystem;
@@ -225,9 +225,9 @@
if (p == SYSTEMSOLVABLE)
continue;

- // getting source
+ // getting repo
s = $self->pool->solvables + p;
- Source *source = s->source;
+ Repo *repo = s->repo;
rb_yield(SWIG_NewPointerObj((void*) s, SWIGTYPE_p__Solvable, 0));
}
}
@@ -246,20 +246,20 @@
if ($self->decisionmap[i] > 0)
continue;

- // getting source
+ // getting repo
s = $self->pool->solvables + i;
- Source *source = s->source;
+ Repo *repo = s->repo;
rb_yield(SWIG_NewPointerObj((void*) s, SWIGTYPE_p__Solvable, 0));
}
}
};

-%include "source.h"
+%include "repo.h"

-%nodefaultdtor Source;
-%extend Source {
+%nodefaultdtor Repo;
+%extend Repo {

- const char *name() { return source_name($self); }
+ const char *name() { return repo_name($self); }

void each_solvable()
{
@@ -276,7 +276,7 @@
}
};

-%include "source_solv.h"
+%include "repo_solv.h"

%typemap(in) Id {
$1 = (int) NUM2INT($input);

Modified: trunk/sat-solver/src/CMakeLists.txt
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/CMakeLists.txt?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/src/CMakeLists.txt (original)
+++ trunk/sat-solver/src/CMakeLists.txt Fri Oct 26 22:25:08 2007
@@ -1,10 +1,10 @@

-SET(libsatsolver_SRCS bitmap.c poolarch.c poolid.c solver.c source_solv.c
-evr.c pool.c queue.c source.c util.c)
+SET(libsatsolver_SRCS bitmap.c poolarch.c poolid.c solver.c repo_solv.c
+evr.c pool.c queue.c repo.c util.c)

ADD_LIBRARY(satsolver STATIC ${libsatsolver_SRCS})

-SET(libsatsolver_HEADERS bitmap.h evr.h hash.h poolarch.h pool.h poolid.h
pooltypes.h queue.h solvable.h solver.h source.h source_solv.h util.h )
+SET(libsatsolver_HEADERS bitmap.h evr.h hash.h poolarch.h pool.h poolid.h
pooltypes.h queue.h solvable.h solver.h repo.h repo_solv.h util.h )

INSTALL( FILES ${libsatsolver_HEADERS} DESTINATION
"${CMAKE_INSTALL_PREFIX}/include/satsolver" )
INSTALL(TARGETS satsolver LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE
DESTINATION ${LIB_INSTALL_DIR})
\ No newline at end of file

Modified: trunk/sat-solver/src/pool.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/pool.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/src/pool.c (original)
+++ trunk/sat-solver/src/pool.c Fri Oct 26 22:25:08 2007
@@ -109,20 +109,20 @@
pool_free(Pool *pool)
{
int i;
- Source *source;
+ Repo *repo;

pool_freewhatprovides(pool);
pool_freeidhashes(pool);
- for (i = 0; i < pool->nsources; i++)
+ for (i = 0; i < pool->nrepos; i++)
{
- source = pool->sources[i];
- xfree(source->idarraydata);
- xfree(source->rpmdbid);
- xfree(source);
+ repo = pool->repos[i];
+ xfree(repo->idarraydata);
+ xfree(repo->rpmdbid);
+ xfree(repo);
}
xfree(pool->id2arch);
xfree(pool->solvables);
- xfree(pool->sources);
+ xfree(pool->repos);
xfree(pool->stringspace);
xfree(pool->strings);
xfree(pool->rels);
@@ -275,7 +275,7 @@
continue;
if (!pool_installable(pool, s))
continue;
- pp = s->source->idarraydata + s->provides;
+ pp = s->repo->idarraydata + s->provides;
while ((id = *pp++) != ID_NULL)
{
if (ISRELDEP(id))
@@ -324,7 +324,7 @@
continue;

/* for all provides of this solvable */
- pp = s->source->idarraydata + s->provides;
+ pp = s->repo->idarraydata + s->provides;
while ((id = *pp++) != 0)
{
if (ISRELDEP(id))
@@ -480,7 +480,7 @@
printf("addrelproviders: checking package %s\n", id2str(pool,
pool->p[p].name));
#endif
/* solvable p provides name in some rels */
- pidp = pool->solvables[p].source->idarraydata +
pool->solvables[p].provides;
+ pidp = pool->solvables[p].repo->idarraydata +
pool->solvables[p].provides;
while ((pid = *pidp++) != 0)
{
int pflags;

Modified: trunk/sat-solver/src/pool.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/pool.h?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/src/pool.h (original)
+++ trunk/sat-solver/src/pool.h Fri Oct 26 22:25:08 2007
@@ -12,7 +12,7 @@

#include "pooltypes.h"
#include "poolid.h"
-#include "source.h"
+#include "repo.h"
#include "solvable.h"
#include "queue.h"

@@ -70,8 +70,8 @@
Hashtable relhashtbl; // hash table: (name,evr,op ->) Hash -> Id
Hashmask relhashmask;

- Source **sources;
- int nsources;
+ Repo **repos;
+ int nrepos;

Solvable *solvables;
int nsolvables;
@@ -145,7 +145,7 @@
/**
* ????
*/
-extern void pool_freesource(Pool *pool, Source *source);
+extern void pool_freerepo(Pool *pool, Repo *repo);
/**
* Prepares a pool for solving
*/

Copied: trunk/sat-solver/src/repo.c (from r7667, trunk/sat-solver/src/source.c)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repo.c?p2=trunk/sat-solver/src/repo.c&p1=trunk/sat-solver/src/source.c&r1=7667&r2=7668&rev=7668&view=diff
==============================================================================
--- trunk/sat-solver/src/source.c (original)
+++ trunk/sat-solver/src/repo.c Fri Oct 26 22:25:08 2007
@@ -1,5 +1,5 @@
/*
- * source.c
+ * repo.c
*
* Manage metadata coming from one repository
*
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <string.h>

-#include "source.h"
+#include "repo.h"
#include "pool.h"
#include "poolid_private.h"
#include "util.h"
@@ -18,48 +18,48 @@


/*
- * create empty source
+ * create empty repo
* and add to pool
*/

-Source *
-pool_addsource_empty(Pool *pool)
+Repo *
+pool_addrepo_empty(Pool *pool)
{
- Source *source;
+ Repo *repo;

pool_freewhatprovides(pool);
- source = (Source *)xcalloc(1, sizeof(*source));
- pool->sources = (Source **)xrealloc(pool->sources, (pool->nsources + 1) *
sizeof(Source *));
- pool->sources[pool->nsources++] = source;
- source->name = "empty";
- source->pool = pool;
- source->start = pool->nsolvables;
- source->nsolvables = 0;
- return source;
+ repo = (Repo *)xcalloc(1, sizeof(*repo));
+ pool->repos = (Repo **)xrealloc(pool->repos, (pool->nrepos + 1) *
sizeof(Repo *));
+ pool->repos[pool->nrepos++] = repo;
+ repo->name = "empty";
+ repo->pool = pool;
+ repo->start = pool->nsolvables;
+ repo->nsolvables = 0;
+ return repo;
}

/*
- * add Id to source
+ * add Id to repo
* olddeps = old array to extend
*
*/

unsigned int
-source_addid(Source *source, Offset olddeps, Id id)
+repo_addid(Repo *repo, Offset olddeps, Id id)
{
Id *idarray;
int idarraysize;
int i;

- idarray = source->idarraydata;
- idarraysize = source->idarraysize;
+ idarray = repo->idarraydata;
+ idarraysize = repo->idarraysize;

if (!idarray) /* alloc idarray if not done yet
*/
{
idarray = (Id *)xmalloc((1 + IDARRAY_BLOCK) * sizeof(Id));
idarray[0] = 0;
idarraysize = 1;
- source->lastoff = 0;
+ repo->lastoff = 0;
}

if (!olddeps) /* no deps yet */
@@ -68,7 +68,7 @@
if ((idarraysize & IDARRAY_BLOCK) == 0)
idarray = (Id *)xrealloc(idarray, (idarraysize + 1 + IDARRAY_BLOCK) *
sizeof(Id));
}
- else if (olddeps == source->lastoff) /* extend at end */
+ else if (olddeps == repo->lastoff) /* extend at end */
idarraysize--;
else /* can't extend, copy old */
{
@@ -91,16 +91,16 @@

idarray[idarraysize++] = 0; /* ensure NULL termination */

- source->idarraydata = idarray;
- source->idarraysize = idarraysize;
- source->lastoff = olddeps;
+ repo->idarraydata = idarray;
+ repo->idarraysize = idarraysize;
+ repo->lastoff = olddeps;

return olddeps;
}


/*
- * add dependency (as Id) to source
+ * add dependency (as Id) to repo
* olddeps = offset into idarraydata
* isreq = 0 for normal dep
* isreq = 1 for requires
@@ -109,24 +109,24 @@
*/

unsigned int
-source_addid_dep(Source *source, Offset olddeps, Id id, int isreq)
+repo_addid_dep(Repo *repo, Offset olddeps, Id id, int isreq)
{
Id oid, *oidp, *marker = 0;

if (!olddeps)
- return source_addid(source, olddeps, id);
+ return repo_addid(repo, olddeps, id);

if (!isreq)
{
- for (oidp = source->idarraydata + olddeps; (oid = *oidp) != ID_NULL;
oidp++)
+ for (oidp = repo->idarraydata + olddeps; (oid = *oidp) != ID_NULL;
oidp++)
{
if (oid == id)
return olddeps;
}
- return source_addid(source, olddeps, id);
+ return repo_addid(repo, olddeps, id);
}

- for (oidp = source->idarraydata + olddeps; (oid = *oidp) != ID_NULL; oidp++)
+ for (oidp = repo->idarraydata + olddeps; (oid = *oidp) != ID_NULL; oidp++)
{
if (oid == SOLVABLE_PREREQMARKER)
marker = oidp;
@@ -148,7 +148,7 @@
if (marker < oidp)
memmove(marker, marker + 1, (oidp - marker) * sizeof(Id));
*oidp = SOLVABLE_PREREQMARKER;
- return source_addid(source, olddeps, id);
+ return repo_addid(repo, olddeps, id);
}
while (oidp[1])
oidp++;
@@ -157,7 +157,7 @@
return olddeps;
}
if (isreq == 2 && !marker)
- olddeps = source_addid(source, olddeps, SOLVABLE_PREREQMARKER);
+ olddeps = repo_addid(repo, olddeps, SOLVABLE_PREREQMARKER);
else if (isreq == 1 && marker)
{
*marker++ = id;
@@ -166,7 +166,7 @@
memmove(marker + 1, marker, (oidp - marker) * sizeof(Id));
*marker = SOLVABLE_PREREQMARKER;
}
- return source_addid(source, olddeps, id);
+ return repo_addid(repo, olddeps, id);
}


@@ -176,20 +176,20 @@
*/

unsigned int
-source_reserve_ids(Source *source, unsigned int olddeps, int num)
+repo_reserve_ids(Repo *repo, unsigned int olddeps, int num)
{
num++; /* room for trailing ID_NULL */

- if (!source->idarraysize) /* ensure buffer space */
+ if (!repo->idarraysize) /* ensure buffer space */
{
- source->idarraysize = 1;
- source->idarraydata = (Id *)xmalloc(((1 + num + IDARRAY_BLOCK) &
~IDARRAY_BLOCK) * sizeof(Id));
- source->idarraydata[0] = 0;
- source->lastoff = 1;
+ repo->idarraysize = 1;
+ repo->idarraydata = (Id *)xmalloc(((1 + num + IDARRAY_BLOCK) &
~IDARRAY_BLOCK) * sizeof(Id));
+ repo->idarraydata[0] = 0;
+ repo->lastoff = 1;
return 1;
}

- if (olddeps && olddeps != source->lastoff) /* if not appending */
+ if (olddeps && olddeps != repo->lastoff) /* if not appending */
{
/* can't insert into idarray, this would invalidate all 'larger' offsets
* so create new space at end and move existing deps there.
@@ -199,92 +199,92 @@
Id *idstart, *idend;
int count;

- for (idstart = idend = source->idarraydata + olddeps; *idend++; ) /*
find end */
+ for (idstart = idend = repo->idarraydata + olddeps; *idend++; ) /*
find end */
;
count = idend - idstart - 1 + num; /* new size */

/* realloc if crossing block boundary */
- if (((source->idarraysize - 1) | IDARRAY_BLOCK) != ((source->idarraysize
+ count - 1) | IDARRAY_BLOCK))
- source->idarraydata = (Id *)xrealloc(source->idarraydata,
((source->idarraysize + count + IDARRAY_BLOCK) & ~IDARRAY_BLOCK) * sizeof(Id));
+ if (((repo->idarraysize - 1) | IDARRAY_BLOCK) != ((repo->idarraysize +
count - 1) | IDARRAY_BLOCK))
+ repo->idarraydata = (Id *)xrealloc(repo->idarraydata,
((repo->idarraysize + count + IDARRAY_BLOCK) & ~IDARRAY_BLOCK) * sizeof(Id));

/* move old deps to end */
- olddeps = source->lastoff = source->idarraysize;
- memcpy(source->idarraydata + olddeps, idstart, count - num);
- source->idarraysize = olddeps + count - num;
+ olddeps = repo->lastoff = repo->idarraysize;
+ memcpy(repo->idarraydata + olddeps, idstart, count - num);
+ repo->idarraysize = olddeps + count - num;

return olddeps;
}

if (olddeps) /* appending */
- source->idarraysize--;
+ repo->idarraysize--;

/* realloc if crossing block boundary */
- if (((source->idarraysize - 1) | IDARRAY_BLOCK) != ((source->idarraysize +
num - 1) | IDARRAY_BLOCK))
- source->idarraydata = (Id *)xrealloc(source->idarraydata,
((source->idarraysize + num + IDARRAY_BLOCK) & ~IDARRAY_BLOCK) * sizeof(Id));
+ if (((repo->idarraysize - 1) | IDARRAY_BLOCK) != ((repo->idarraysize + num -
1) | IDARRAY_BLOCK))
+ repo->idarraydata = (Id *)xrealloc(repo->idarraydata, ((repo->idarraysize
+ num + IDARRAY_BLOCK) & ~IDARRAY_BLOCK) * sizeof(Id));

/* appending or new */
- source->lastoff = olddeps ? olddeps : source->idarraysize;
+ repo->lastoff = olddeps ? olddeps : repo->idarraysize;

- return source->lastoff;
+ return repo->lastoff;
}


/*
- * remove source from pool
+ * remove repo from pool
*
*/

void
-pool_freesource(Pool *pool, Source *source)
+pool_freerepo(Pool *pool, Repo *repo)
{
int i, nsolvables;

pool_freewhatprovides(pool);

- for (i = 0; i < pool->nsources; i++) /* find source in pool */
+ for (i = 0; i < pool->nrepos; i++) /* find repo in pool */
{
- if (pool->sources[i] == source)
+ if (pool->repos[i] == repo)
break;
}
- if (i == pool->nsources) /* source not in pool, return */
+ if (i == pool->nrepos) /* repo not in pool, return */
return;

/* close gap
- * all sources point into pool->solvables _relatively_ to source->start
- * so closing the gap only needs adaption of source->start for all
- * other sources.
+ * all repos point into pool->solvables _relatively_ to repo->start
+ * so closing the gap only needs adaption of repo->start for all
+ * other repos.
*/

- nsolvables = source->nsolvables;
- if (pool->nsolvables > source->start + nsolvables)
- memmove(pool->solvables + source->start, pool->solvables + source->start +
nsolvables, (pool->nsolvables - source->start - nsolvables) * sizeof(Solvable));
+ nsolvables = repo->nsolvables;
+ if (pool->nsolvables > repo->start + nsolvables)
+ memmove(pool->solvables + repo->start, pool->solvables + repo->start +
nsolvables, (pool->nsolvables - repo->start - nsolvables) * sizeof(Solvable));
pool->nsolvables -= nsolvables;

- for (; i < pool->nsources - 1; i++)
+ for (; i < pool->nrepos - 1; i++)
{
- pool->sources[i] = pool->sources[i + 1]; /* remove source */
- pool->sources[i]->start -= nsolvables; /* adapt start offset of
remaining sources */
+ pool->repos[i] = pool->repos[i + 1]; /* remove repo */
+ pool->repos[i]->start -= nsolvables; /* adapt start offset of
remaining repos */
}
- pool->nsources = i;
+ pool->nrepos = i;

- xfree(source->idarraydata);
- xfree(source->rpmdbid);
- xfree(source);
+ xfree(repo->idarraydata);
+ xfree(repo->rpmdbid);
+ xfree(repo);
}

unsigned int
-source_fix_legacy(Source *source, unsigned int provides, unsigned int
supplements)
+repo_fix_legacy(Repo *repo, unsigned int provides, unsigned int supplements)
{
- Pool *pool = source->pool;
+ Pool *pool = repo->pool;
Id id, idp, idl, idns;
char buf[1024], *p, *dep;
int i;

if (provides)
{
- for (i = provides; source->idarraydata[i]; i++)
+ for (i = provides; repo->idarraydata[i]; i++)
{
- id = source->idarraydata[i];
+ id = repo->idarraydata[i];
if (ISRELDEP(id))
continue;
dep = (char *)id2str(pool, id);
@@ -331,7 +331,7 @@
if (idp)
id = rel2id(pool, idp, id, REL_AND, 1);
if (id)
- supplements = source_addid_dep(source, supplements, id, 0);
+ supplements = repo_addid_dep(repo, supplements, id, 0);
}
else if ((p = strchr(dep, ':')) != 0 && p != dep && p[1] == '/' &&
strlen(dep) < sizeof(buf))
{
@@ -343,15 +343,15 @@
id = str2id(pool, p, 1);
id = rel2id(pool, idns, id, REL_NAMESPACE, 1);
id = rel2id(pool, idp, id, REL_AND, 1);
- supplements = source_addid_dep(source, supplements, id, 0);
+ supplements = repo_addid_dep(repo, supplements, id, 0);
}
}
}
if (!supplements)
return 0;
- for (i = supplements; source->idarraydata[i]; i++)
+ for (i = supplements; repo->idarraydata[i]; i++)
{
- id = source->idarraydata[i];
+ id = repo->idarraydata[i];
if (ISRELDEP(id))
continue;
dep = (char *)id2str(pool, id);
@@ -379,7 +379,7 @@
id = rel2id(pool, idns, id, REL_NAMESPACE, 1);
}
if (id)
- source->idarraydata[i] = id;
+ repo->idarraydata[i] = id;
}
else if (!strncmp(dep, "packageand(", 11) && strlen(dep) < sizeof(buf))
{
@@ -411,7 +411,7 @@
id = idp;
}
if (id)
- source->idarraydata[i] = id;
+ repo->idarraydata[i] = id;
}
}
return supplements;

Added: trunk/sat-solver/src/repo.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repo.h?rev=7668&view=auto
==============================================================================
--- trunk/sat-solver/src/repo.h (added)
+++ trunk/sat-solver/src/repo.h Fri Oct 26 22:25:08 2007
@@ -0,0 +1,38 @@
+/*
+ * repo.h
+ *
+ */
+
+#ifndef REPO_H
+#define REPO_H
+
+#include "pooltypes.h"
+
+typedef struct _Repo {
+ const char *name;
+ struct _Pool *pool; /* pool containing repo data */
+ int start; /* start of this repo solvables within
pool->solvables */
+ int nsolvables; /* number of solvables repo is contributing to
pool */
+
+ int priority; /* priority of this repo */
+
+ Id *idarraydata; /* array of metadata Ids, solvable dependencies
are offsets into this array */
+ int idarraysize;
+ Offset lastoff;
+
+ Id *rpmdbid;
+} Repo;
+
+extern unsigned int repo_addid(Repo *repo, unsigned int olddeps, Id id);
+extern unsigned int repo_addid_dep(Repo *repo, unsigned int olddeps, Id id,
int isreq);
+extern unsigned int repo_reserve_ids(Repo *repo, unsigned int olddeps, int
num);
+extern unsigned int repo_fix_legacy(Repo *repo, unsigned int provides,
unsigned int supplements);
+
+extern Repo *pool_addrepo_empty(Pool *pool);
+
+static inline const char *repo_name(const Repo *repo)
+{
+ return repo->name;
+}
+
+#endif /* REPO_H */

Copied: trunk/sat-solver/src/repo_solv.c (from r7667,
trunk/sat-solver/src/source_solv.c)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repo_solv.c?p2=trunk/sat-solver/src/repo_solv.c&p1=trunk/sat-solver/src/source_solv.c&r1=7667&r2=7668&rev=7668&view=diff
==============================================================================
--- trunk/sat-solver/src/source_solv.c (original)
+++ trunk/sat-solver/src/repo_solv.c Fri Oct 26 22:25:08 2007
@@ -1,10 +1,10 @@
/*
- * source_solv.c
+ * repo_solv.c
*
- * Read the binary dump of a Source and create a Source * from it
+ * Read the binary dump of a Repo and create a Repo * from it
*
* See
- * Source *pool_addsource_solv(Pool *pool, FILE *fp)
+ * Repo *pool_addrepo_solv(Pool *pool, FILE *fp)
* below
*
*/
@@ -16,7 +16,7 @@
#include <unistd.h>
#include <string.h>

-#include "source_solv.h"
+#include "repo_solv.h"
#include "util.h"

#define INTERESTED_START 2
@@ -163,21 +163,21 @@
// ----------------------------------------------

/*
- * read source from .solv file
+ * read repo from .solv file
* and add it to pool
*/

-Source *
-pool_addsource_solv(Pool *pool, FILE *fp, const char *sourcename)
+Repo *
+pool_addrepo_solv(Pool *pool, FILE *fp, const char *reponame)
{
int i, j, l;
unsigned int numid, numrel, numsolv, numsrcdata, numsolvdata;
int numsolvdatabits, type;
Offset sizeid;
Offset *str; /* map Id -> Offset into string space */
- char *strsp; /* source string space */
+ char *strsp; /* repo string space */
char *sp; /* pointer into string space */
- Id *idmap; /* map of source Ids to pool Ids */
+ Id *idmap; /* map of repo Ids to pool Ids */
Id id;
unsigned int hashmask, h;
int hh;
@@ -187,7 +187,7 @@
Reldep *ran;
SolvData *solvdata;
unsigned int size, size_str, size_idarray;
- Source *source;
+ Repo *repo;
Id *idarraydatap, *idarraydataend;
Offset ido;
unsigned int databits;
@@ -204,11 +204,11 @@
exit(1);
}

- /* create empty Source */
- source = pool_addsource_empty(pool);
+ /* create empty Repo */
+ repo = pool_addrepo_empty(pool);
pool_freeidhashes(pool);

- source->name = sourcename;
+ repo->name = reponame;

numid = read_u32(fp);
numrel = read_u32(fp);
@@ -240,7 +240,7 @@
idmap = (Id *)xcalloc(numid + numrel, sizeof(Id));

/*
- * read new source at end of pool
+ * read new repo at end of pool
*/

if (fread(strsp, sizeid, 1, fp) != 1)
@@ -326,7 +326,7 @@
memmove(pool->stringspace + pool->sstrings, sp, l); /* append to
pool buffer */
pool->sstrings += l;
}
- idmap[i] = id; /* source relative -> pool relative */
+ idmap[i] = id; /* repo relative -> pool relative */
sp += l; /* next string */
}
xfree(hashtbl);
@@ -369,12 +369,12 @@
}

/*
- * read RelDeps from source
+ * read RelDeps from repo
*/

for (i = 0; i < numrel; i++)
{
- name = read_id(fp, i + numid); /* read (source relative) Ids */
+ name = read_id(fp, i + numid); /* read (repo relative) Ids */
evr = read_id(fp, i + numid);
flags = read_u8(fp);
name = idmap[name]; /* map to (pool relative) Ids */
@@ -405,11 +405,11 @@
}

/*
- * read (but dont store) source data
+ * read (but dont store) repo data
*/

#if 0
- printf("read source data\n");
+ printf("read repo data\n");
#endif
numsrcdata = read_u32(fp);
for (i = 0; i < numsrcdata; i++)
@@ -481,16 +481,16 @@
if (size_idarray)
{
size_idarray++; /* first entry is always zero */
- source->idarraydata = (Id *)xmalloc(sizeof(Id) * size_idarray);
- source->idarraysize = size_idarray;
- idarraydatap = source->idarraydata;
+ repo->idarraydata = (Id *)xmalloc(sizeof(Id) * size_idarray);
+ repo->idarraysize = size_idarray;
+ idarraydatap = repo->idarraydata;
*idarraydatap++ = 0;
- idarraydataend = source->idarraydata + size_idarray;
+ idarraydataend = repo->idarraydata + size_idarray;
}
else
{
- source->idarraydata = 0;
- source->idarraysize = 0;
+ repo->idarraydata = 0;
+ repo->idarraysize = 0;
idarraydatap = 0;
idarraydataend = 0;
}
@@ -500,8 +500,8 @@

if (numsolv) /* clear newly allocated area */
memset(pool->solvables + pool->nsolvables, 0, numsolv * sizeof(Solvable));
- source->start = pool->nsolvables;
- source->nsolvables = numsolv;
+ repo->start = pool->nsolvables;
+ repo->nsolvables = numsolv;

/*
* read solvables
@@ -510,9 +510,9 @@
#if 0
printf("read solvables\n");
#endif
- for (i = 0, s = pool->solvables + source->start; i < numsolv; i++, s++)
+ for (i = 0, s = pool->solvables + repo->start; i < numsolv; i++, s++)
{
- s->source = source;
+ s->repo = repo;
databits = 0;
if (numsolvdatabits)
{
@@ -554,9 +554,9 @@
#endif
if (id == RPM_RPMDBID)
{
- if (!source->rpmdbid)
- source->rpmdbid = (Id *)xcalloc(numsolv, sizeof(Id));
- source->rpmdbid[i] = h;
+ if (!repo->rpmdbid)
+ repo->rpmdbid = (Id *)xcalloc(numsolv, sizeof(Id));
+ repo->rpmdbid[i] = h;
}
break;
case TYPE_STR:
@@ -571,7 +571,7 @@
;
break;
}
- ido = idarraydatap - source->idarraydata;
+ ido = idarraydatap - repo->idarraydata;
idarraydatap = read_idarray(fp, numid + numrel, idmap,
idarraydatap, idarraydataend);
if (id == SOLVABLE_PROVIDES)
s->provides = ido;
@@ -593,8 +593,8 @@
s->freshens = ido;
#if 0
printf("%s ->\n", id2str(pool, id));
- for (; source->idarraydata[ido]; ido++)
- printf(" %s\n", dep2str(pool, source->idarraydata[ido]));
+ for (; repo->idarraydata[ido]; ido++)
+ printf(" %s\n", dep2str(pool, repo->idarraydata[ido]));
#endif
break;
}
@@ -606,7 +606,7 @@

pool->nsolvables += numsolv;

- return source;
+ return repo;
}

// EOF

Added: trunk/sat-solver/src/repo_solv.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repo_solv.h?rev=7668&view=auto
==============================================================================
--- trunk/sat-solver/src/repo_solv.h (added)
+++ trunk/sat-solver/src/repo_solv.h Fri Oct 26 22:25:08 2007
@@ -0,0 +1,22 @@
+/*
+ * repo_solv.h
+ *
+ */
+
+#ifndef REPO_SOLVE_H
+#define REPO_SOLVE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "pool.h"
+#include "repo.h"
+
+extern Repo *pool_addrepo_solv(Pool *pool, FILE *fp, const char *name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* REPO_SOLVE_H */

Modified: trunk/sat-solver/src/solvable.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solvable.h?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/src/solvable.h (original)
+++ trunk/sat-solver/src/solvable.h Fri Oct 26 22:25:08 2007
@@ -8,16 +8,16 @@
#define SOLVABLE_H

#include "pooltypes.h"
-#include "source.h"
+#include "repo.h"

typedef struct _Solvable {
Id name;
Id arch;
Id evr; /* epoch:version-release */

- Source *source; /* source we belong to */
+ Repo *repo; /* repo we belong to */

- /* dependencies are offsets into idarray of source */
+ /* dependencies are offsets into idarray of repo */
Offset provides; /* terminated with Id 0 */
Offset obsoletes;
Offset conflicts;

Modified: trunk/sat-solver/src/solver.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/src/solver.c (original)
+++ trunk/sat-solver/src/solver.c Fri Oct 26 22:25:08 2007
@@ -41,7 +41,7 @@
replaces_system(Solver *solv, Id id)
{
Pool *pool = solv->pool;
- Source *system = solv->system;
+ Repo *system = solv->system;
Id *name = pool->solvables[id].name;

FOR_PROVIDES(p, pp, id)
@@ -144,13 +144,13 @@
for (i = 0; i < plist->count; i++)
{
s = pool->solvables + plist->elements[i];
- if (i == 0 || s->source->priority > bestprio)
- bestprio = s->source->priority;
+ if (i == 0 || s->repo->priority > bestprio)
+ bestprio = s->repo->priority;
}
for (i = j = 0; i < plist->count; i++)
{
s = pool->solvables + plist->elements[i];
- if (s->source->priority == bestprio)
+ if (s->repo->priority == bestprio)
plist->elements[j++] = plist->elements[i];
}
plist->count = j;
@@ -184,14 +184,14 @@
s = pool->solvables + p;
if (s->recommends)
{
- recp = s->source->idarraydata + s->recommends;
+ recp = s->repo->idarraydata + s->recommends;
while ((rec = *recp++) != 0)
FOR_PROVIDES(p, pp, rec)
MAPSET(&solv->recommendsmap, p);
}
if (s->suggests)
{
- sugp = s->source->idarraydata + s->suggests;
+ sugp = s->repo->idarraydata + s->suggests;
while ((sug = *sugp++) != 0)
FOR_PROVIDES(p, pp, sug)
MAPSET(&solv->suggestsmap, p);
@@ -211,7 +211,7 @@
continue;
if (s->supplements)
{
- supp = s->source->idarraydata + s->supplements;
+ supp = s->repo->idarraydata + s->supplements;
while ((sup = *supp++) != 0)
if (dep_fulfilled(solv, sup))
break;
@@ -220,7 +220,7 @@
}
if (s->freshens)
{
- supp = s->source->idarraydata + s->freshens;
+ supp = s->repo->idarraydata + s->freshens;
while ((sup = *supp++) != 0)
if (dep_fulfilled(solv, sup))
break;
@@ -246,7 +246,7 @@
s = pool->solvables + p;
if (!s->enhances)
continue;
- enhp = s->source->idarraydata + s->enhances;
+ enhp = s->repo->idarraydata + s->enhances;
while ((enh = *enhp++) != 0)
if (dep_fulfilled(solv, enh))
break;
@@ -796,7 +796,7 @@
addrulesforsolvable(Solver *solv, Solvable *s, Map *m)
{
Pool *pool = solv->pool;
- Source *system = solv->system;
+ Repo *system = solv->system;
Queue q;
Id qbuf[64];
int i;
@@ -842,7 +842,7 @@

if (s->requires)
{
- reqp = s->source->idarraydata + s->requires;
+ reqp = s->repo->idarraydata + s->requires;
while ((req = *reqp++) != 0)
{
if (req == SOLVABLE_PREREQMARKER) /* skip the marker */
@@ -876,7 +876,7 @@
#endif
addrule(solv, -n, 0); /* mark requestor as uninstallable */
if (solv->rc_output)
- printf(">!> !unflag %s-%s.%s[%s]\n", id2str(pool, s->name),
id2str(pool, s->evr), id2str(pool, s->arch), source_name(s->source));
+ printf(">!> !unflag %s-%s.%s[%s]\n", id2str(pool, s->name),
id2str(pool, s->evr), id2str(pool, s->arch), repo_name(s->repo));
continue;
}

@@ -909,7 +909,7 @@

if (s->conflicts)
{
- conp = s->source->idarraydata + s->conflicts;
+ conp = s->repo->idarraydata + s->conflicts;
while ((con = *conp++) != 0)
{
FOR_PROVIDES(p, pp, con)
@@ -930,7 +930,7 @@
{ /* not installed */
if (s->obsoletes)
{
- obsp = s->source->idarraydata + s->obsoletes;
+ obsp = s->repo->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
{
FOR_PROVIDES(p, pp, obs)
@@ -949,7 +949,7 @@
*/
if (s->recommends)
{
- recp = s->source->idarraydata + s->recommends;
+ recp = s->repo->idarraydata + s->recommends;
while ((rec = *recp++) != 0)
{
FOR_PROVIDES(p, pp, rec)
@@ -959,7 +959,7 @@
}
if (s->suggests)
{
- sugp = s->source->idarraydata + s->suggests;
+ sugp = s->repo->idarraydata + s->suggests;
while ((sug = *sugp++) != 0)
{
FOR_PROVIDES(p, pp, sug)
@@ -992,21 +992,21 @@
sup = 0;
if (s->supplements)
{
- supp = s->source->idarraydata + s->supplements;
+ supp = s->repo->idarraydata + s->supplements;
while ((sup = *supp++) != ID_NULL)
if (dep_possible(solv, sup, m))
break;
}
if (!sup && s->freshens)
{
- supp = s->source->idarraydata + s->freshens;
+ supp = s->repo->idarraydata + s->freshens;
while ((sup = *supp++) != ID_NULL)
if (dep_possible(solv, sup, m))
break;
}
if (!sup && s->enhances)
{
- supp = s->source->idarraydata + s->enhances;
+ supp = s->repo->idarraydata + s->enhances;
while ((sup = *supp++) != ID_NULL)
if (dep_possible(solv, sup, m))
break;
@@ -1075,7 +1075,7 @@
}
else if (!solv->noupdateprovide && ps->obsoletes) /*
provides/obsoletes combination ? */
{
- obsp = ps->source->idarraydata + ps->obsoletes;
+ obsp = ps->repo->idarraydata + ps->obsoletes;
while ((obs = *obsp++) != 0) /* for all obsoletes */
{
FOR_PROVIDES(p2, pp2, obs) /* and all matching providers of the
obsoletes */
@@ -1798,11 +1798,11 @@
*
*
* Upon solving, rules are created to flag the Solvables
- * of the 'system' Source as installed.
+ * of the 'system' Repo as installed.
*/

Solver *
-solver_create(Pool *pool, Source *system)
+solver_create(Pool *pool, Repo *system)
{
Solver *solv;
solv = (Solver *)xcalloc(1, sizeof(Solver));
@@ -2130,7 +2130,7 @@
/* XXX need to special case AND ? */
if (s->recommends)
{
- recp = s->source->idarraydata + s->recommends;
+ recp = s->repo->idarraydata + s->recommends;
while ((rec = *recp++) != 0)
{
qcount = dq.count;
@@ -2157,7 +2157,7 @@
continue;
if (s->supplements)
{
- supp = s->source->idarraydata + s->supplements;
+ supp = s->repo->idarraydata + s->supplements;
while ((sup = *supp++) != 0)
if (dep_fulfilled(solv, sup))
break;
@@ -2166,7 +2166,7 @@
}
if (s->freshens)
{
- supp = s->source->idarraydata + s->freshens;
+ supp = s->repo->idarraydata + s->freshens;
while ((sup = *supp++) != 0)
if (dep_fulfilled(solv, sup))
break;
@@ -2408,7 +2408,7 @@
s = pool->solvables + n;
if (s->obsoletes)
{
- obsp = s->source->idarraydata + s->obsoletes;
+ obsp = s->repo->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
FOR_PROVIDES(p, pp, obs)
{
@@ -2526,9 +2526,9 @@
}
if (solv->rc_output)
{
- Source *source = s->source;
- if (source && strcmp(source_name(source), "locales"))
- printf("[%s]", source_name(source));
+ Repo *repo = s->repo;
+ if (repo && strcmp(repo_name(repo), "locales"))
+ printf("[%s]", repo_name(repo));
}
printf("\n");
}
@@ -2544,7 +2544,7 @@
{
Pool *pool = solv->pool;
Solvable *s;
- Source *system = solv->system;
+ Repo *system = solv->system;
Id p, *pp, obs, *obsp, *obsoletes, *obsoletes_data;
int i, n;

@@ -2557,7 +2557,7 @@
continue;
if (!pool_installable(pool, s))
continue;
- obsp = s->source->idarraydata + s->obsoletes;
+ obsp = s->repo->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
FOR_PROVIDES(p, pp, obs)
{
@@ -2584,7 +2584,7 @@
continue;
if (!pool_installable(pool, s))
continue;
- obsp = s->source->idarraydata + s->obsoletes;
+ obsp = s->repo->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
FOR_PROVIDES(p, pp, obs)
{
@@ -2756,7 +2756,7 @@
case SOLVER_INSTALL_SOLVABLE: /* install specific
solvable */
if (solv->rc_output) {
Solvable *s = pool->solvables + what;
- printf(">!> Installing %s from channel %s\n", id2str(pool,
s->name), source_name(s->source));
+ printf(">!> Installing %s from channel %s\n", id2str(pool,
s->name), repo_name(s->repo));
}
addrule(solv, what, 0); /* install by Id */
queuepush(&solv->ruletojob, i);
@@ -2900,7 +2900,7 @@
s = pool->solvables + p;
if (s->suggests)
{
- sugp = s->source->idarraydata + s->suggests;
+ sugp = s->repo->idarraydata + s->suggests;
while ((sug = *sugp++) != 0)
{
FOR_PROVIDES(p, pp, sug)
@@ -2924,7 +2924,7 @@
continue;
if (!pool_installable(pool, s))
continue;
- enhp = s->source->idarraydata + s->enhances;
+ enhp = s->repo->idarraydata + s->enhances;
while ((enh = *enhp++) != 0)
if (dep_fulfilled(solv, enh))
break;

Modified: trunk/sat-solver/src/solver.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.h?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/src/solver.h (original)
+++ trunk/sat-solver/src/solver.h Fri Oct 26 22:25:08 2007
@@ -8,7 +8,7 @@

#include "pooltypes.h"
#include "pool.h"
-#include "source.h"
+#include "repo.h"
#include "queue.h"
#include "bitmap.h"

@@ -39,7 +39,7 @@

typedef struct solver {
Pool *pool;
- Source *system;
+ Repo *system;

int fixsystem; /* repair errors in rpm dependency
graph */
int allowdowngrade; /* allow to downgrade installed
solvable */
@@ -106,7 +106,7 @@
SOLVER_INSTALL_SOLVABLE_UPDATE
} SolverCmd;

-extern Solver *solver_create(Pool *pool, Source *system);
+extern Solver *solver_create(Pool *pool, Repo *system);
extern void solver_free(Solver *solv);
extern void solve(Solver *solv, Queue *job);


Modified: trunk/sat-solver/testsuite/deptestomatic.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/testsuite/deptestomatic.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/testsuite/deptestomatic.c (original)
+++ trunk/sat-solver/testsuite/deptestomatic.c Fri Oct 26 22:25:08 2007
@@ -21,7 +21,7 @@
#include <dirent.h>

#include "solver.h"
-#include "source_solv.h"
+#include "repo_solv.h"
#include "poolarch.h"

static int verbose = 0;
@@ -140,7 +140,7 @@
struct _channelmap {
Id nid;
char *name;
- Source *source;
+ Repo *repo;
};

typedef struct _parsedata {
@@ -161,8 +161,8 @@
int nchannels;
struct _channelmap *channels;

- Source *system; // system source
- Source *locales; // where we store locales
+ Repo *system; // system repo
+ Repo *locales; // where we store locales

Id arch; // set architecture

@@ -514,23 +514,23 @@
/*----------------------------------------------------------------*/

/*
- * read source from file as name
+ * read repo from file as name
*
*/

-static Source *
-add_source( Parsedata *pd, const char *name, const char *file )
+static Repo *
+add_repo( Parsedata *pd, const char *name, const char *file )
{
if (!file)
{
- err( "add_source, no filename!" );
+ err( "add_repo, no filename!" );
return NULL;
}
char solvname[256];
int l = strlen( file );
if (l > 255 )
{
- err( "add_source, filename too long!" );
+ err( "add_repo, filename too long!" );
return NULL;
}

@@ -558,19 +558,19 @@
perror( solvname );
return NULL;
}
- Source *s = pool_addsource_solv( pd->pool, fp, name );
+ Repo *s = pool_addrepo_solv( pd->pool, fp, name );
fclose( fp );
return s;
}


-// find solvable id by name and source
-// If source != NULL, find there
+// find solvable id by name and repo
+// If repo != NULL, find there
// else find in pool (available packages)
//

static Id
-select_solvable( Pool *pool, Source *source, const char *name, const char
*arch )
+select_solvable( Pool *pool, Repo *repo, const char *name, const char *arch )
{
Id id, archid;
int i, end;
@@ -588,8 +588,8 @@
}
}

- i = source ? source->start : 1;
- end = source ? source->start + source->nsolvables : pool->nsolvables;
+ i = repo ? repo->start : 1;
+ end = repo ? repo->start + repo->nsolvables : pool->nsolvables;
for (; i < end; i++)
{
if (archid && pool->solvables[i].arch != archid)
@@ -636,7 +636,7 @@
pd->channels = (struct _channelmap *)realloc( pd->channels,
pd->nchannels * sizeof( struct _channelmap ) );
struct _channelmap *cmap = pd->channels + (pd->nchannels-1);

- cmap->source = pd->locales = pool_addsource_empty(pool);
+ cmap->repo = pd->locales = pool_addrepo_empty(pool);
pd->locales->name = cmap->name = strdup( "locales" );
cmap->nid = str2id( pd->pool, cmap->name, 1 );
}
@@ -654,11 +654,11 @@
s = pool->solvables + pool->nsolvables++;
pd->locales->nsolvables++;
memset(s, 0, sizeof(Solvable));
- s->source = pd->locales;
+ s->repo = pd->locales;
s->name = id;
s->arch = ARCH_NOARCH;
s->evr = ID_EMPTY;
- s->provides = source_addid_dep(pd->locales, s->provides, id, 0);
+ s->provides = repo_addid_dep(pd->locales, s->provides, id, 0);

queuepush( &(pd->trials), SOLVER_INSTALL_SOLVABLE_PROVIDES );
queuepush( &(pd->trials), id );
@@ -767,8 +767,8 @@
name = file;

char *cname = strdup( name );
- Source *source = add_source( pd, cname, path );
- if (source)
+ Repo *repo = add_repo( pd, cname, path );
+ if (repo)
{
pd->nchannels++;
pd->channels = (struct _channelmap *)realloc( pd->channels,
pd->nchannels * sizeof( struct _channelmap ) );
@@ -780,7 +780,7 @@
struct _channelmap *cmap = pd->channels + (pd->nchannels-1);
cmap->name = cname;
cmap->nid = str2id( pool, cname, 1 );
- cmap->source = source;
+ cmap->repo = repo;
}
else
{
@@ -809,9 +809,9 @@
char path[PATH_MAX];
strncpy(path, pd->directory, sizeof(path));
strncat(path, file, sizeof(path));
- Source *source = add_source( pd, "system", path );
- if (source)
- pd->system = source;
+ Repo *repo = add_repo( pd, "system", path );
+ if (repo)
+ pd->system = repo;
else
{
err( "Can't add <system>" );
@@ -901,7 +901,7 @@
break;
}

- Source *source = NULL;
+ Repo *repo = NULL;
if (channel) /* from specific channel */
{
Id cid = str2id( pool, channel, 0 );
@@ -915,16 +915,16 @@
{
if (pd->channels[i].nid == cid)
{
- source = pd->channels[i].source;
+ repo = pd->channels[i].repo;
break;
}
++i;
}
- Id id = select_solvable( pool, source, package, arch );
+ Id id = select_solvable( pool, repo, package, arch );
if (id == ID_NULL)
{
err( "Install: Package '%s' not found", package );
- if (source) err( " in channel '%s'", channel );
+ if (repo) err( " in channel '%s'", channel );
exit( 1 );
}
queuepush( &(pd->trials), SOLVER_ERASE_SOLVABLE );
@@ -985,7 +985,7 @@
break;
}

- Source *source = NULL;
+ Repo *repo = NULL;
if (channel) /* from specific channel */
{
Id cid = str2id( pool, channel, 0 );
@@ -997,15 +997,15 @@
int i = 0;
while (i < pd->nchannels ) {
if (pd->channels[i].nid == cid) {
- source = pd->channels[i].source;
+ repo = pd->channels[i].repo;
break;
}
++i;
}
- Id id = select_solvable( pool, source, package, arch );
+ Id id = select_solvable( pool, repo, package, arch );
if (id == ID_NULL) {
err( "Install: Package '%s' not found", package );
- if (source) err( " in channel '%s'", channel );
+ if (repo) err( " in channel '%s'", channel );
exit( 1 );
}
queuepush( &(pd->trials), SOLVER_INSTALL_SOLVABLE );
@@ -1086,13 +1086,13 @@
}
break;

- case STATE_CURRENT: { /* FIXME: needs source prio */
+ case STATE_CURRENT: { /* FIXME: needs repo prio */
// const char *channel = attrval( atts, "channel" );
// err( "ignoring <current channel=\"%s\">", channel );
}
break;

- case STATE_SUBSCRIBE: { /* FIXME: needs source prio */
+ case STATE_SUBSCRIBE: { /* FIXME: needs repo prio */
// const char *channel = attrval( atts, "channel" );
// err( "ignoring <subscribe channel=\"%s\">", channel );
}
@@ -1166,7 +1166,7 @@
case STATE_TRIAL: { /* trial complete */

if (!pd->system)
- pd->system = pool_addsource_empty( pd->pool );
+ pd->system = pool_addrepo_empty( pd->pool );

if (pd->arch)
pool_setarch( pd->pool, id2str(pd->pool, pd->arch) );
@@ -1352,7 +1352,7 @@
for ( i = 0; i < pd.nchannels; ++i )
{
free( pd.channels[i].name );
- pool_freesource( pd.pool, pd.channels[i].source );
+ pool_freerepo( pd.pool, pd.channels[i].repo );
}

for ( i = 0; i < pd.nmodaliases; ++i )

Modified: trunk/sat-solver/testsuite/gimmick.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/testsuite/gimmick.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/testsuite/gimmick.c (original)
+++ trunk/sat-solver/testsuite/gimmick.c Fri Oct 26 22:25:08 2007
@@ -1,7 +1,7 @@
/*
* gimmick - with gimmick
*
- * command line interface to source data
+ * command line interface to repo data
*
* Usage:
* cat x.solv | gimmick <name>
@@ -15,7 +15,7 @@
#include <string.h>

#include "pool.h"
-#include "source_solv.h"
+#include "repo_solv.h"
#include "solver.h"

int main(int argc, char **argv)
@@ -26,7 +26,7 @@
Id p, *pp;

pool = pool_create();
- pool_addsource_solv( pool, stdin, "" );
+ pool_addrepo_solv( pool, stdin, "" );
if (argc == 2)
id = str2id( pool, argv[1], 1 );
else

Modified: trunk/sat-solver/testsuite/yps.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/testsuite/yps.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/testsuite/yps.c (original)
+++ trunk/sat-solver/testsuite/yps.c Fri Oct 26 22:25:08 2007
@@ -3,7 +3,7 @@
*
* command line interface to solver
* Usage:
- * yps <system> <source> [ ... <source>] <name>
+ * yps <system> <repo> [ ... <repo>] <name>
* to install a package <name>
*
* yps -e <system> <name>
@@ -18,16 +18,16 @@

#include "pool.h"
#include "poolarch.h"
-#include "source_solv.h"
+#include "repo_solv.h"
#include "solver.h"

// find solvable by name
-// If source != NULL, find there (installed packages)
+// If repo != NULL, find there (installed packages)
// else find in pool (available packages)
//

static Solvable *
-select_solvable(Pool *pool, Source *source, char *name)
+select_solvable(Pool *pool, Repo *repo, char *name)
{
Id id;
Queue plist;
@@ -36,8 +36,8 @@

id = str2id(pool, name, 1);
queueinit( &plist);
- i = source ? source->start : 1;
- end = source ? source->start + source->nsolvables : pool->nsolvables;
+ i = repo ? repo->start : 1;
+ end = repo ? repo->start + repo->nsolvables : pool->nsolvables;
for (; i < end; i++)
{
s = pool->solvables + i;
@@ -69,10 +69,10 @@
{
Pool *pool; // available packages (multiple repos)
FILE *fp;
- Source *system; // installed packages (single repo, aka 'Source')
+ Repo *system; // installed packages (single repo, aka 'Repo')
Solvable *xs;
Solver *solv;
- Source *channel;
+ Repo *channel;
Queue job;
Id id;
int erase = 0;
@@ -84,7 +84,7 @@

if (argc < 3)
{
- fprintf(stderr, "Usage:\n yps <system> <source> [ ... <source>]
<name>\n");
+ fprintf(stderr, "Usage:\n yps <system> <repo> [ ... <repo>] <name>\n");
fprintf(stderr, " to install a package <name>\n");
fprintf(stderr, "\n yps -e <system> <name>\n");
fprintf(stderr, " to erase a package <name>\n");
@@ -107,7 +107,7 @@
perror(argv[1]);
exit(1);
}
- system = pool_addsource_solv(pool, fp, "system");
+ system = pool_addrepo_solv(pool, fp, "system");
channel = 0;
fclose(fp);

@@ -115,14 +115,14 @@

argc--;
argv++;
- while (argc > 2) /* all but last arg are sources */
+ while (argc > 2) /* all but last arg are repos */
{
if ((fp = fopen(argv[1], "r")) == 0)
{
perror(argv[1]);
exit(1);
}
- channel = pool_addsource_solv(pool, fp, argv[1]);
+ channel = pool_addrepo_solv(pool, fp, argv[1]);
fclose(fp);
argv++;
argc--;

Modified: trunk/sat-solver/tools/CMakeLists.txt
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/CMakeLists.txt?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/CMakeLists.txt (original)
+++ trunk/sat-solver/tools/CMakeLists.txt Fri Oct 26 22:25:08 2007
@@ -1,44 +1,44 @@

-SET(rpmdb2solv_SOURCES
+SET(rpmdb2solv_REPOS
rpmdb2solv.c
- source_rpmdb.h
- source_rpmdb.c
- source_write.c
+ repo_rpmdb.h
+ repo_rpmdb.c
+ repo_write.c
)

-ADD_EXECUTABLE( rpmdb2solv ${rpmdb2solv_SOURCES} )
+ADD_EXECUTABLE( rpmdb2solv ${rpmdb2solv_REPOS} )
TARGET_LINK_LIBRARIES( rpmdb2solv satsolver ${DB43_LIBRARY})

-SET(rpmmd2solv_SOURCES rpmmd2solv.c source_rpmmd.h source_rpmmd.c
source_write.c )
-ADD_EXECUTABLE( rpmmd2solv ${rpmmd2solv_SOURCES} )
+SET(rpmmd2solv_REPOS rpmmd2solv.c repo_rpmmd.h repo_rpmmd.c repo_write.c )
+ADD_EXECUTABLE( rpmmd2solv ${rpmmd2solv_REPOS} )
TARGET_LINK_LIBRARIES( rpmmd2solv satsolver ${EXPAT_LIBRARY})

-SET(helix2solv_SOURCES helix2solv.c source_helix.h source_helix.c
source_write.c )
-ADD_EXECUTABLE( helix2solv ${helix2solv_SOURCES} )
+SET(helix2solv_REPOS helix2solv.c repo_helix.h repo_helix.c repo_write.c )
+ADD_EXECUTABLE( helix2solv ${helix2solv_REPOS} )
TARGET_LINK_LIBRARIES( helix2solv satsolver ${EXPAT_LIBRARY})

-SET(susetags2solv_SOURCES susetags2solv.c source_susetags.h source_susetags.c
source_write.c)
-ADD_EXECUTABLE( susetags2solv ${susetags2solv_SOURCES} )
+SET(susetags2solv_REPOS susetags2solv.c repo_susetags.h repo_susetags.c
repo_write.c)
+ADD_EXECUTABLE( susetags2solv ${susetags2solv_REPOS} )
TARGET_LINK_LIBRARIES( susetags2solv satsolver)

-SET(patchxml2solv_SOURCES patchxml2solv.c source_patchxml.h source_patchxml.c
source_write.c)
-ADD_EXECUTABLE( patchxml2solv ${patchxml2solv_SOURCES} )
+SET(patchxml2solv_REPOS patchxml2solv.c repo_patchxml.h repo_patchxml.c
repo_write.c)
+ADD_EXECUTABLE( patchxml2solv ${patchxml2solv_REPOS} )
TARGET_LINK_LIBRARIES( patchxml2solv satsolver ${EXPAT_LIBRARY})


-SET(content2solv_SOURCES
+SET(content2solv_REPOS
content2solv.c
- source_content.h
- source_content.c
- source_write.c)
-ADD_EXECUTABLE( content2solv ${content2solv_SOURCES} )
+ repo_content.h
+ repo_content.c
+ repo_write.c)
+ADD_EXECUTABLE( content2solv ${content2solv_REPOS} )
TARGET_LINK_LIBRARIES( content2solv satsolver)


-SET(dumpsolv_SOURCES dumpsolv.c)
-ADD_EXECUTABLE( dumpsolv ${dumpsolv_SOURCES} )
+SET(dumpsolv_REPOS dumpsolv.c)
+ADD_EXECUTABLE( dumpsolv ${dumpsolv_REPOS} )
TARGET_LINK_LIBRARIES( dumpsolv satsolver)

-SET(mergesolv_SOURCES mergesolv.c source_write.c)
-ADD_EXECUTABLE( mergesolv ${mergesolv_SOURCES} )
+SET(mergesolv_REPOS mergesolv.c repo_write.c)
+ADD_EXECUTABLE( mergesolv ${mergesolv_REPOS} )
TARGET_LINK_LIBRARIES( mergesolv satsolver)
\ No newline at end of file

Modified: trunk/sat-solver/tools/content2solv.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/content2solv.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/content2solv.c (original)
+++ trunk/sat-solver/tools/content2solv.c Fri Oct 26 22:25:08 2007
@@ -6,15 +6,15 @@
#include <string.h>

#include "pool.h"
-#include "source_content.h"
-#include "source_write.h"
+#include "repo_content.h"
+#include "repo_write.h"

int
main(int argc, char **argv)
{
Pool *pool = pool_create();
- Source *source = pool_addsource_content(pool, stdin);
- pool_writesource(pool, source, stdout);
+ Repo *repo = pool_addrepo_content(pool, stdin);
+ pool_writerepo(pool, repo, stdout);
pool_free(pool);
return 0;
}

Modified: trunk/sat-solver/tools/dumpsolv.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/dumpsolv.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/dumpsolv.c (original)
+++ trunk/sat-solver/tools/dumpsolv.c Fri Oct 26 22:25:08 2007
@@ -4,24 +4,24 @@
#include <string.h>

#include "pool.h"
-#include "source_solv.h"
+#include "repo_solv.h"

static void
-printids(Source *source, char *kind, Offset ido)
+printids(Repo *repo, char *kind, Offset ido)
{
- Pool *pool = source->pool;
+ Pool *pool = repo->pool;
Id id, *ids;
if (!ido)
return;
printf("%s:\n", kind);
- ids = source->idarraydata + ido;
+ ids = repo->idarraydata + ido;
while((id = *ids++) != 0)
printf(" %s\n", dep2str(pool, id));
}

int main(int argc, char **argv)
{
- Source *source;
+ Repo *repo;
Pool *pool;
int i;
Solvable *s;
@@ -35,23 +35,23 @@
}
}
pool = pool_create();
- source = pool_addsource_solv(pool, stdin, "");
- printf("source contains %d solvables\n", source->nsolvables);
- for (i = source->start; i < source->start + source->nsolvables; i++)
+ repo = pool_addrepo_solv(pool, stdin, "");
+ printf("repo contains %d solvables\n", repo->nsolvables);
+ for (i = repo->start; i < repo->start + repo->nsolvables; i++)
{
s = pool->solvables + i;
printf("\n");
printf("solvable %d:\n", i);
printf("name: %s %s %s\n", id2str(pool, s->name), id2str(pool, s->evr),
id2str(pool, s->arch));
- printids(source, "provides", s->provides);
- printids(source, "obsoletes", s->obsoletes);
- printids(source, "conflicts", s->conflicts);
- printids(source, "requires", s->requires);
- printids(source, "recommends", s->recommends);
- printids(source, "suggests", s->suggests);
- printids(source, "supplements", s->supplements);
- printids(source, "enhances", s->enhances);
- printids(source, "freshens", s->freshens);
+ printids(repo, "provides", s->provides);
+ printids(repo, "obsoletes", s->obsoletes);
+ printids(repo, "conflicts", s->conflicts);
+ printids(repo, "requires", s->requires);
+ printids(repo, "recommends", s->recommends);
+ printids(repo, "suggests", s->suggests);
+ printids(repo, "supplements", s->supplements);
+ printids(repo, "enhances", s->enhances);
+ printids(repo, "freshens", s->freshens);
}
exit(0);
}

Modified: trunk/sat-solver/tools/helix2solv.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/helix2solv.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/helix2solv.c (original)
+++ trunk/sat-solver/tools/helix2solv.c Fri Oct 26 22:25:08 2007
@@ -15,15 +15,15 @@
#include <string.h>

#include "pool.h"
-#include "source_helix.h"
-#include "source_write.h"
+#include "repo_helix.h"
+#include "repo_write.h"

int
main(int argc, char **argv)
{
Pool *pool = pool_create();
- Source *source = pool_addsource_helix(pool, stdin);
- pool_writesource(pool, source, stdout);
+ Repo *repo = pool_addrepo_helix(pool, stdin);
+ pool_writerepo(pool, repo, stdout);
pool_free(pool);
exit(0);
}

Modified: trunk/sat-solver/tools/mergesolv.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/mergesolv.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/mergesolv.c (original)
+++ trunk/sat-solver/tools/mergesolv.c Fri Oct 26 22:25:08 2007
@@ -12,8 +12,8 @@
#include <assert.h>

#include "pool.h"
-#include "source_solv.h"
-#include "source_write.h"
+#include "repo_solv.h"
+#include "repo_write.h"

int
main(int argc, char **argv)
@@ -32,24 +32,24 @@
perror(argv[1]);
exit(0);
}
- pool_addsource_solv(pool, fp, "");
+ pool_addrepo_solv(pool, fp, "");
fclose(fp);
}
- if (!pool->nsources)
+ if (!pool->nrepos)
return 0;

new_id_size = 0;
- for (i = 0; i < pool->nsources; i++)
- new_id_size += pool->sources[i]->idarraysize;
+ for (i = 0; i < pool->nrepos; i++)
+ new_id_size += pool->repos[i]->idarraysize;
new_id = (Id*) malloc (sizeof (Id) * new_id_size);
new_id_size = 0;
- for (i = 0; i < pool->nsources; i++)
+ for (i = 0; i < pool->nrepos; i++)
{
- Source *source = pool->sources[i];
+ Repo *repo = pool->repos[i];
int si;
- memcpy (new_id + new_id_size, source->idarraydata,
- source->idarraysize * sizeof (new_id[0]));
- for (si = source->start; si < source->start + source->nsolvables; si++)
+ memcpy (new_id + new_id_size, repo->idarraydata,
+ repo->idarraysize * sizeof (new_id[0]));
+ for (si = repo->start; si < repo->start + repo->nsolvables; si++)
{
Solvable *s = pool->solvables + si;
if (s->provides)
@@ -71,25 +71,25 @@
if (s->freshens)
s->freshens += new_id_size;
}
- new_id_size += source->idarraysize;
+ new_id_size += repo->idarraysize;
if (i > 0)
{
- pool->sources[0]->nsolvables += source->nsolvables;
- source->nsolvables = 0;
- source->start = pool->nsolvables;
- free (source->idarraydata);
- source->idarraydata = 0;
+ pool->repos[0]->nsolvables += repo->nsolvables;
+ repo->nsolvables = 0;
+ repo->start = pool->nsolvables;
+ free (repo->idarraydata);
+ repo->idarraydata = 0;
}
}
- while (pool->nsources > 1)
+ while (pool->nrepos > 1)
{
- pool_freesource (pool, pool->sources[1]);
+ pool_freerepo (pool, pool->repos[1]);
}
- free (pool->sources[0]->idarraydata);
- pool->sources[0]->idarraydata = new_id;
- pool->sources[0]->idarraysize = new_id_size;
+ free (pool->repos[0]->idarraydata);
+ pool->repos[0]->idarraydata = new_id;
+ pool->repos[0]->idarraysize = new_id_size;

- pool_writesource(pool, pool->sources[0], stdout);
+ pool_writerepo(pool, pool->repos[0], stdout);
pool_free(pool);

return 0;

Modified: trunk/sat-solver/tools/patchxml2solv.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/patchxml2solv.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/patchxml2solv.c (original)
+++ trunk/sat-solver/tools/patchxml2solv.c Fri Oct 26 22:25:08 2007
@@ -6,15 +6,15 @@
#include <string.h>

#include "pool.h"
-#include "source_patchxml.h"
-#include "source_write.h"
+#include "repo_patchxml.h"
+#include "repo_write.h"

int
main(int argc, char **argv)
{
Pool *pool = pool_create();
- Source *source = pool_addsource_patchxml(pool, stdin);
- pool_writesource(pool, source, stdout);
+ Repo *repo = pool_addrepo_patchxml(pool, stdin);
+ pool_writerepo(pool, repo, stdout);
pool_free(pool);
exit(0);
}

Copied: trunk/sat-solver/tools/repo_content.c (from r7667,
trunk/sat-solver/tools/source_content.c)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_content.c?p2=trunk/sat-solver/tools/repo_content.c&p1=trunk/sat-solver/tools/source_content.c&r1=7667&r2=7668&rev=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/source_content.c (original)
+++ trunk/sat-solver/tools/repo_content.c Fri Oct 26 22:25:08 2007
@@ -8,7 +8,7 @@

#include "pool.h"
#include "util.h"
-#include "source_content.h"
+#include "repo_content.h"

#define PACK_BLOCK 16

@@ -36,7 +36,7 @@

struct parsedata {
char *kind;
- Source *source;
+ Repo *repo;
char *tmp;
int tmpl;
};
@@ -146,29 +146,29 @@
if (words == 3)
line = sp[2], words = 2;
}
- olddeps = source_addid_dep(pd->source, olddeps, id, isreq);
+ olddeps = repo_addid_dep(pd->repo, olddeps, id, isreq);
if (!line)
break;
}
return olddeps;
}

-Source *
-pool_addsource_content(Pool *pool, FILE *fp)
+Repo *
+pool_addrepo_content(Pool *pool, FILE *fp)
{
char *line, *linep;
int aline;
- Source *source;
+ Repo *repo;
Solvable *s;
int pack;
struct parsedata pd;

- source = pool_addsource_empty(pool);
+ repo = pool_addrepo_empty(pool);
memset(&pd, 0, sizeof(pd));
line = xmalloc(1024);
aline = 1024;

- pd.source = source;
+ pd.repo = repo;
linep = line;
pack = 0;
s = 0;
@@ -208,18 +208,18 @@
if (istag ("PRODUCT"))
{
if (s && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = source_addid_dep(source, s->provides,
rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
if (s)
- s->supplements = source_fix_legacy(source, s->provides,
s->supplements);
+ s->supplements = repo_fix_legacy(repo, s->provides,
s->supplements);
/* Only support one product. */
pd.kind = "product";
if ((pack & PACK_BLOCK) == 0)
{
pool->solvables = realloc(pool->solvables, (pool->nsolvables
+ pack + PACK_BLOCK + 1) * sizeof(Solvable));
- memset(pool->solvables + source->start + pack, 0, (PACK_BLOCK
+ 1) * sizeof(Solvable));
+ memset(pool->solvables + repo->start + pack, 0, (PACK_BLOCK +
1) * sizeof(Solvable));
}
- s = pool->solvables + source->start + pack;
- s->source = source;
+ s = pool->solvables + repo->start + pack;
+ s->repo = repo;
pack++;
}
else if (istag ("VERSION"))
@@ -260,15 +260,15 @@
}

if (s && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = source_addid_dep(source, s->provides, rel2id(pool, s->name,
s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name,
s->evr, REL_EQ, 1), 0);
if (s)
- s->supplements = source_fix_legacy(source, s->provides, s->supplements);
+ s->supplements = repo_fix_legacy(repo, s->provides, s->supplements);

pool->nsolvables += pack;
- source->nsolvables = pack;
+ repo->nsolvables = pack;
if (pd.tmp)
free(pd.tmp);
free(line);

- return source;
+ return repo;
}

Added: trunk/sat-solver/tools/repo_content.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_content.h?rev=7668&view=auto
==============================================================================
--- trunk/sat-solver/tools/repo_content.h (added)
+++ trunk/sat-solver/tools/repo_content.h Fri Oct 26 22:25:08 2007
@@ -0,0 +1 @@
+Repo * pool_addrepo_content(Pool *pool, FILE *fp);

Copied: trunk/sat-solver/tools/repo_helix.c (from r7667,
trunk/sat-solver/tools/source_helix.c)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_helix.c?p2=trunk/sat-solver/tools/repo_helix.c&p1=trunk/sat-solver/tools/source_helix.c&r1=7667&r2=7668&rev=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/source_helix.c (original)
+++ trunk/sat-solver/tools/repo_helix.c Fri Oct 26 22:25:08 2007
@@ -1,9 +1,9 @@
/* -*- mode: C; c-file-style: "gnu"; fill-column: 78 -*- */
/*
- * source_helix.c
+ * repo_helix.c
*
* Parse 'helix' XML representation
- * and create 'source'
+ * and create 'repo'
*
*/

@@ -15,7 +15,7 @@
#include <string.h>
#include <expat.h>

-#include "source_helix.h"
+#include "repo_helix.h"
#include "evr.h"


@@ -133,11 +133,11 @@
int acontent; // actual buffer size
int docontent; // handle content

- // source data
+ // repo data
int pack; // number of solvables

Pool *pool; // current pool
- Source *source; // current source
+ Repo *repo; // current repo
Solvable *start; // collected solvables

// package data
@@ -352,8 +352,8 @@
else
id = name; /* no operator */

- /* add new dependency to source */
- return source_addid_dep(pd->source, olddeps, id, isreq);
+ /* add new dependency to repo */
+ return repo_addid_dep(pd->repo, olddeps, id, isreq);
}


@@ -435,7 +435,7 @@
if ((pd->pack & PACK_BLOCK) == 0) /* alloc new block ? */
{
pool->solvables = (Solvable *)realloc(pool->solvables,
(pool->nsolvables + pd->pack + PACK_BLOCK + 1) * sizeof(Solvable));
- pd->start = pool->solvables + pd->source->start;
+ pd->start = pool->solvables + pd->repo->start;
memset(pd->start + pd->pack, 0, (PACK_BLOCK + 1) * sizeof(Solvable));
}

@@ -534,7 +534,7 @@

if (s->provides)
{
- for (pidp = pd->source->idarraydata + s->provides; pidp && (pid =
*pidp++) != 0; )
+ for (pidp = pd->repo->idarraydata + s->provides; pidp && (pid = *pidp++)
!= 0; )
{
Reldep *prd;
const char *depname;
@@ -551,12 +551,12 @@
}

//fprintf(stderr, "pack %d\n", pd->pack);
- //fprintf(stderr, "source %d\n", s->requires);
+ //fprintf(stderr, "repo %d\n", s->requires);

if (!s->requires)
return 0;

- for (pidp = pd->source->idarraydata + s->requires ; pidp && (pid = *pidp++)
!= 0; )
+ for (pidp = pd->repo->idarraydata + s->requires ; pidp && (pid = *pidp++) !=
0; )
{
const char *depname = 0;

@@ -611,7 +611,7 @@
{

case STATE_PACKAGE: /* package complete */
- s->source = pd->source;
+ s->repo = pd->repo;

if (!s->arch) /* default to "noarch" */
s->arch = ARCH_NOARCH;
@@ -623,8 +623,8 @@
pd->release ? pd->evrspace + pd->release : 0);
/* ensure self-provides */
if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = source_addid_dep(pd->source, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
- s->supplements = source_fix_legacy(pd->source, s->provides,
s->supplements);
+ s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
+ s->supplements = repo_fix_legacy(pd->repo, s->provides, s->supplements);

const char *flavor = findKernelFlavor(pd, s);
if (flavor)
@@ -638,7 +638,7 @@
if (s->provides)
{
npr = 0;
- for (pidp = pd->source->idarraydata + s->provides; (pid =
*pidp++) != 0; )
+ for (pidp = pd->repo->idarraydata + s->provides; (pid = *pidp++)
!= 0; )
{
const char *depname = 0;
Reldep *prd = 0;
@@ -666,7 +666,7 @@
pid = rel2id(pool, pid, prd->evr, prd->flags, 1);
}

- npr = source_addid_dep(pd->source, npr, pid, 0);
+ npr = repo_addid_dep(pd->repo, npr, pid, 0);
}
s->provides = npr;
}
@@ -675,7 +675,7 @@
if (s->requires)
{
npr = 0;
- for (pidp = pd->source->idarraydata + s->requires; (pid =
*pidp++) != 0; )
+ for (pidp = pd->repo->idarraydata + s->requires; (pid = *pidp++)
!= 0; )
{
const char *depname = 0;
Reldep *prd = 0;
@@ -701,7 +701,7 @@
if (prd)
pid = rel2id(pool, pid, prd->evr, prd->flags, 1);
}
- npr = source_addid_dep(pd->source, npr, pid, 0);
+ npr = repo_addid_dep(pd->repo, npr, pid, 0);
}
s->requires = npr;
}
@@ -800,21 +800,21 @@

/*
* read 'helix' type xml from fp
- * add packages to pool/source
+ * add packages to pool/repo
*
*/

-Source *
-pool_addsource_helix(Pool *pool, FILE *fp)
+Repo *
+pool_addrepo_helix(Pool *pool, FILE *fp)
{
Parsedata pd;
char buf[BUFF_SIZE];
int i, l;
- Source *source;
+ Repo *repo;
struct stateswitch *sw;

- // create empty source
- source = pool_addsource_empty(pool);
+ // create empty repo
+ repo = pool_addrepo_empty(pool);

// prepare parsedata
memset(&pd, 0, sizeof(pd));
@@ -826,7 +826,7 @@
}

pd.pool = pool;
- pd.source = source;
+ pd.repo = repo;

pd.content = (char *)malloc(256); /* must hold all solvable kinds! */
pd.acontent = 256;
@@ -859,10 +859,10 @@

// adapt package count
pool->nsolvables += pd.pack;
- source->nsolvables = pd.pack;
+ repo->nsolvables = pd.pack;

free(pd.content);
free(pd.evrspace);

- return source;
+ return repo;
}

Added: trunk/sat-solver/tools/repo_helix.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_helix.h?rev=7668&view=auto
==============================================================================
--- trunk/sat-solver/tools/repo_helix.h (added)
+++ trunk/sat-solver/tools/repo_helix.h Fri Oct 26 22:25:08 2007
@@ -0,0 +1,15 @@
+/*
+ * repo_helix.h
+ *
+ */
+
+#ifndef REPO_HELIX_H
+#define REPO_HELIX_H
+
+#include <stdio.h>
+#include "pool.h"
+#include "repo.h"
+
+extern Repo *pool_addrepo_helix(Pool *pool, FILE *fp);
+
+#endif /* REPO_HELIX_H */

Copied: trunk/sat-solver/tools/repo_patchxml.c (from r7667,
trunk/sat-solver/tools/source_patchxml.c)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_patchxml.c?p2=trunk/sat-solver/tools/repo_patchxml.c&p1=trunk/sat-solver/tools/source_patchxml.c&r1=7667&r2=7668&rev=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/source_patchxml.c (original)
+++ trunk/sat-solver/tools/repo_patchxml.c Fri Oct 26 22:25:08 2007
@@ -7,8 +7,8 @@
#include <expat.h>

#include "pool.h"
-#include "source_patchxml.h"
-#include "source_rpmmd.h"
+#include "repo_patchxml.h"
+#include "repo_rpmmd.h"


enum state {
@@ -94,7 +94,7 @@
int docontent;
int pack;
Pool *pool;
- Source *source;
+ Repo *repo;
Solvable *start;
char *kind;

@@ -227,7 +227,7 @@
#if 0
fprintf(stderr, "new dep %s%s%s\n", id2str(pool, d), id2rel(pool, d),
id2evr(pool, d));
#endif
- return source_addid_dep(pd->source, olddeps, id, isreq);
+ return repo_addid_dep(pd->repo, olddeps, id, isreq);
}


@@ -282,10 +282,10 @@
/* HACK: close patch */
if (pd->kind && !strcmp(pd->kind, "patch"))
{
- s->source = pd->source;
+ s->repo = pd->repo;
if (!s->arch)
s->arch = ARCH_NOARCH;
- s->provides = source_addid_dep(pd->source, s->provides,
rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
pd->pack++;
}
pd->kind = "atom";
@@ -296,7 +296,7 @@
if ((pd->pack & PACK_BLOCK) == 0)
{
pool->solvables = realloc(pool->solvables, (pool->nsolvables +
pd->pack + PACK_BLOCK + 1) * sizeof(Solvable));
- pd->start = pool->solvables + pd->source->start;
+ pd->start = pool->solvables + pd->repo->start;
memset(pd->start + pd->pack, 0, (PACK_BLOCK + 1) * sizeof(Solvable));
}
#if 0
@@ -389,12 +389,12 @@
case STATE_PATCH:
if (!strcmp(name, "patch") && strcmp(pd->kind, "patch"))
break; /* already closed */
- s->source = pd->source;
+ s->repo = pd->repo;
if (!s->arch)
s->arch = ARCH_NOARCH;
if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = source_addid_dep(pd->source, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
- s->supplements = source_fix_legacy(pd->source, s->provides,
s->supplements);
+ s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
+ s->supplements = repo_fix_legacy(pd->repo, s->provides, s->supplements);
pd->pack++;
break;
case STATE_NAME:
@@ -436,16 +436,16 @@

#define BUFF_SIZE 8192

-Source *
-pool_addsource_patchxml(Pool *pool, FILE *fp)
+Repo *
+pool_addrepo_patchxml(Pool *pool, FILE *fp)
{
struct parsedata pd;
char buf[BUFF_SIZE];
int i, l;
- Source *source;
+ Repo *repo;
struct stateswitch *sw;

- source = pool_addsource_empty(pool);
+ repo = pool_addrepo_empty(pool);
memset(&pd, 0, sizeof(pd));
for (i = 0, sw = stateswitches; sw->from != NUMSTATES; i++, sw++)
{
@@ -454,7 +454,7 @@
pd.sbtab[sw->to] = sw->from;
}
pd.pool = pool;
- pd.source = source;
+ pd.repo = repo;
pd.content = malloc(256);
pd.acontent = 256;
pd.lcontent = 0;
@@ -476,8 +476,8 @@
XML_ParserFree(parser);

pool->nsolvables += pd.pack;
- source->nsolvables = pd.pack;
+ repo->nsolvables = pd.pack;

free(pd.content);
- return source;
+ return repo;
}

Added: trunk/sat-solver/tools/repo_patchxml.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_patchxml.h?rev=7668&view=auto
==============================================================================
--- trunk/sat-solver/tools/repo_patchxml.h (added)
+++ trunk/sat-solver/tools/repo_patchxml.h Fri Oct 26 22:25:08 2007
@@ -0,0 +1 @@
+extern Repo *pool_addrepo_patchxml(Pool *pool, FILE *fp);

Copied: trunk/sat-solver/tools/repo_rpmdb.c (from r7667,
trunk/sat-solver/tools/source_rpmdb.c)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_rpmdb.c?p2=trunk/sat-solver/tools/repo_rpmdb.c&p1=trunk/sat-solver/tools/source_rpmdb.c&r1=7667&r2=7668&rev=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/source_rpmdb.c (original)
+++ trunk/sat-solver/tools/repo_rpmdb.c Fri Oct 26 22:25:08 2007
@@ -1,7 +1,7 @@
/*
- * source_rpmdb
+ * repo_rpmdb
*
- * convert rpm db to source
+ * convert rpm db to repo
*
*/

@@ -16,7 +16,7 @@

#include "pool.h"
#include "hash.h"
-#include "source_rpmdb.h"
+#include "repo_rpmdb.h"

#define TAG_NAME 1000
#define TAG_VERSION 1001
@@ -199,7 +199,7 @@
}

static unsigned int
-makedeps(Pool *pool, Source *source, RpmHead *rpmhead, int tagn, int tagv, int
tagf, int strong)
+makedeps(Pool *pool, Repo *repo, RpmHead *rpmhead, int tagn, int tagv, int
tagf, int strong)
{
char **n, **v;
unsigned int *f;
@@ -261,8 +261,8 @@
return 0;
}
cc += haspre;
- olddeps = source_reserve_ids(source, 0, cc);
- ida = source->idarraydata + olddeps;
+ olddeps = repo_reserve_ids(repo, 0, cc);
+ ida = repo->idarraydata + olddeps;
for (i = 0; ; i++)
{
if (i == nc)
@@ -300,7 +300,7 @@
*ida++ = str2id(pool, n[i], 1);
}
*ida++ = 0;
- source->idarraysize += cc + 1;
+ repo->idarraysize += cc + 1;
free(n);
free(v);
free(f);
@@ -308,22 +308,22 @@
}

static Offset
-copydeps(Pool *pool, Source *source, Offset fromoff, Source *fromsource)
+copydeps(Pool *pool, Repo *repo, Offset fromoff, Repo *fromrepo)
{
int cc;
Id id, *ida, *from;
Offset ido;
- Pool *frompool = fromsource->pool;
+ Pool *frompool = fromrepo->pool;

if (!fromoff)
return 0;
- from = fromsource->idarraydata + fromoff;
+ from = fromrepo->idarraydata + fromoff;
for (ida = from, cc = 0; *ida; ida++, cc++)
;
if (cc == 0)
return 0;
- ido = source_reserve_ids(source, 0, cc);
- ida = source->idarraydata + ido;
+ ido = repo_reserve_ids(repo, 0, cc);
+ ida = repo->idarraydata + ido;
if (frompool && pool != frompool)
{
while (*from)
@@ -344,7 +344,7 @@
}
else
memcpy(ida, from, (cc + 1) * sizeof(Id));
- source->idarraysize += cc + 1;
+ repo->idarraysize += cc + 1;
return ido;
}

@@ -373,7 +373,7 @@

/* assumes last processed array is provides! */
static unsigned int
-addfileprovides(Pool *pool, Source *source, RpmHead *rpmhead, unsigned int
olddeps)
+addfileprovides(Pool *pool, Repo *repo, RpmHead *rpmhead, unsigned int olddeps)
{
char **bn;
char **dn;
@@ -449,7 +449,7 @@
}
strcpy(fn, dn[di[i]]);
strcat(fn, bn[i]);
- olddeps = source_addid(source, olddeps, str2id(pool, fn, 1));
+ olddeps = repo_addid(repo, olddeps, str2id(pool, fn, 1));
}
if (fn)
free(fn);
@@ -460,7 +460,7 @@
}

static int
-rpm2solv(Pool *pool, Source *source, Solvable *s, RpmHead *rpmhead)
+rpm2solv(Pool *pool, Repo *repo, Solvable *s, RpmHead *rpmhead)
{
char *name;
char *evr;
@@ -484,30 +484,30 @@
s->evr = str2id(pool, evr, 1);
free(evr);

- s->provides = makedeps(pool, source, rpmhead, TAG_PROVIDENAME,
TAG_PROVIDEVERSION, TAG_PROVIDEFLAGS, 0);
- s->provides = addfileprovides(pool, source, rpmhead, s->provides);
- s->provides = source_addid_dep(source, s->provides, rel2id(pool, s->name,
s->evr, REL_EQ, 1), 0);
- s->requires = makedeps(pool, source, rpmhead, TAG_REQUIRENAME,
TAG_REQUIREVERSION, TAG_REQUIREFLAGS, 0);
- s->conflicts = makedeps(pool, source, rpmhead, TAG_CONFLICTNAME,
TAG_CONFLICTVERSION, TAG_CONFLICTFLAGS, 0);
- s->obsoletes = makedeps(pool, source, rpmhead, TAG_OBSOLETENAME,
TAG_OBSOLETEVERSION, TAG_OBSOLETEFLAGS, 0);
-
- s->recommends = makedeps(pool, source, rpmhead, TAG_SUGGESTSNAME,
TAG_SUGGESTSVERSION, TAG_SUGGESTSFLAGS, 2);
- s->suggests = makedeps(pool, source, rpmhead, TAG_SUGGESTSNAME,
TAG_SUGGESTSVERSION, TAG_SUGGESTSFLAGS, 1);
- s->supplements = makedeps(pool, source, rpmhead, TAG_ENHANCESNAME,
TAG_ENHANCESVERSION, TAG_ENHANCESFLAGS, 2);
- s->enhances = makedeps(pool, source, rpmhead, TAG_ENHANCESNAME,
TAG_ENHANCESVERSION, TAG_ENHANCESFLAGS, 1);
+ s->provides = makedeps(pool, repo, rpmhead, TAG_PROVIDENAME,
TAG_PROVIDEVERSION, TAG_PROVIDEFLAGS, 0);
+ s->provides = addfileprovides(pool, repo, rpmhead, s->provides);
+ s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name,
s->evr, REL_EQ, 1), 0);
+ s->requires = makedeps(pool, repo, rpmhead, TAG_REQUIRENAME,
TAG_REQUIREVERSION, TAG_REQUIREFLAGS, 0);
+ s->conflicts = makedeps(pool, repo, rpmhead, TAG_CONFLICTNAME,
TAG_CONFLICTVERSION, TAG_CONFLICTFLAGS, 0);
+ s->obsoletes = makedeps(pool, repo, rpmhead, TAG_OBSOLETENAME,
TAG_OBSOLETEVERSION, TAG_OBSOLETEFLAGS, 0);
+
+ s->recommends = makedeps(pool, repo, rpmhead, TAG_SUGGESTSNAME,
TAG_SUGGESTSVERSION, TAG_SUGGESTSFLAGS, 2);
+ s->suggests = makedeps(pool, repo, rpmhead, TAG_SUGGESTSNAME,
TAG_SUGGESTSVERSION, TAG_SUGGESTSFLAGS, 1);
+ s->supplements = makedeps(pool, repo, rpmhead, TAG_ENHANCESNAME,
TAG_ENHANCESVERSION, TAG_ENHANCESFLAGS, 2);
+ s->enhances = makedeps(pool, repo, rpmhead, TAG_ENHANCESNAME,
TAG_ENHANCESVERSION, TAG_ENHANCESFLAGS, 1);
s->freshens = 0;
- s->supplements = source_fix_legacy(source, s->provides, s->supplements);
+ s->supplements = repo_fix_legacy(repo, s->provides, s->supplements);
return 1;
}


/*
- * read rpm db as source
+ * read rpm db as repo
*
*/

-Source *
-pool_addsource_rpmdb(Pool *pool, Source *ref)
+Repo *
+pool_addrepo_rpmdb(Pool *pool, Repo *ref)
{
unsigned char buf[16];
DB *db = 0;
@@ -520,13 +520,13 @@
int i;
int rpmheadsize;
RpmHead *rpmhead;
- Source *source;
+ Repo *repo;
Solvable *s;
Id id, *refhash;
unsigned int refmask, h;
int asolv;

- source = pool_addsource_empty(pool);
+ repo = pool_addrepo_empty(pool);

if (ref && !(ref->nsolvables && ref->rpmdbid))
ref = 0;
@@ -556,8 +556,8 @@
}
dbidp = (unsigned char *)&dbid;
pool->solvables = realloc(pool->solvables, (pool->nsolvables + 256) *
sizeof(Solvable));
- memset(pool->solvables + source->start, 0, 256 * sizeof(Solvable));
- source->rpmdbid = calloc(256, sizeof(unsigned int));
+ memset(pool->solvables + repo->start, 0, 256 * sizeof(Solvable));
+ repo->rpmdbid = calloc(256, sizeof(unsigned int));
asolv = 256;
rpmheadsize = 0;
rpmhead = 0;
@@ -567,12 +567,12 @@
if (i >= asolv)
{
pool->solvables = realloc(pool->solvables, (pool->nsolvables +
asolv + 256) * sizeof(Solvable));
- memset(pool->solvables + source->start + asolv, 0, 256 *
sizeof(Solvable));
- source->rpmdbid = realloc(source->rpmdbid, (asolv + 256) *
sizeof(unsigned int));
- memset(source->rpmdbid + asolv, 0, 256 * sizeof(unsigned int));
+ memset(pool->solvables + repo->start + asolv, 0, 256 *
sizeof(Solvable));
+ repo->rpmdbid = realloc(repo->rpmdbid, (asolv + 256) *
sizeof(unsigned int));
+ memset(repo->rpmdbid + asolv, 0, 256 * sizeof(unsigned int));
asolv += 256;
}
- pool->solvables[source->start + i].source = source;
+ pool->solvables[repo->start + i].repo = repo;
if (key.size != 4)
{
fprintf(stderr, "corrupt Packages database (key size)\n");
@@ -609,8 +609,8 @@
}
memcpy(rpmhead->data, (unsigned char *)data.data + 8, rpmhead->cnt *
16 + rpmhead->dcnt);
rpmhead->dp = rpmhead->data + rpmhead->cnt * 16;
- source->rpmdbid[i] = dbid;
- if (rpm2solv(pool, source, pool->solvables + source->start + i,
rpmhead))
+ repo->rpmdbid[i] = dbid;
+ if (rpm2solv(pool, repo, pool->solvables + repo->start + i, rpmhead))
i++;
}
nrpmids = i;
@@ -682,8 +682,8 @@
rpmhead = 0;

pool->solvables = realloc(pool->solvables, (pool->nsolvables + nrpmids)
* sizeof(Solvable));
- memset(pool->solvables + source->start, 0, nrpmids * sizeof(Solvable));
- source->rpmdbid = calloc(nrpmids, sizeof(unsigned int));
+ memset(pool->solvables + repo->start, 0, nrpmids * sizeof(Solvable));
+ repo->rpmdbid = calloc(nrpmids, sizeof(unsigned int));

refhash = 0;
refmask = 0;
@@ -699,12 +699,12 @@
refhash[h] = i + 1; /* make it non-zero */
}
}
- s = pool->solvables + source->start;
+ s = pool->solvables + repo->start;
for (i = 0; i < nrpmids; i++, rp++, s++)
{
- s->source = source;
+ s->repo = repo;
dbid = rp->dbid;
- source->rpmdbid[i] = dbid;
+ repo->rpmdbid[i] = dbid;
if (refhash)
{
h = dbid & refmask;
@@ -732,15 +732,15 @@
if (r->arch)
s->arch = str2id(pool, id2str(ref->pool, r->arch), 1);
}
- s->provides = copydeps(pool, source, r->provides, ref);
- s->requires = copydeps(pool, source, r->requires, ref);
- s->conflicts = copydeps(pool, source, r->conflicts, ref);
- s->obsoletes = copydeps(pool, source, r->obsoletes, ref);
- s->recommends = copydeps(pool, source, r->recommends, ref);
- s->suggests = copydeps(pool, source, r->suggests, ref);
- s->supplements = copydeps(pool, source, r->supplements, ref);
- s->enhances = copydeps(pool, source, r->enhances, ref);
- s->freshens = copydeps(pool, source, r->freshens, ref);
+ s->provides = copydeps(pool, repo, r->provides, ref);
+ s->requires = copydeps(pool, repo, r->requires, ref);
+ s->conflicts = copydeps(pool, repo, r->conflicts, ref);
+ s->obsoletes = copydeps(pool, repo, r->obsoletes, ref);
+ s->recommends = copydeps(pool, repo, r->recommends, ref);
+ s->suggests = copydeps(pool, repo, r->suggests, ref);
+ s->supplements = copydeps(pool, repo, r->supplements, ref);
+ s->enhances = copydeps(pool, repo, r->enhances, ref);
+ s->freshens = copydeps(pool, repo, r->freshens, ref);
continue;
}
}
@@ -801,7 +801,7 @@
memcpy(rpmhead->data, (unsigned char *)data.data + 8, rpmhead->cnt *
16 + rpmhead->dcnt);
rpmhead->dp = rpmhead->data + rpmhead->cnt * 16;

- rpm2solv(pool, source, s, rpmhead);
+ rpm2solv(pool, repo, s, rpmhead);
}

if (refhash)
@@ -816,9 +816,9 @@
if (rpmhead)
free(rpmhead);
pool->nsolvables += nrpmids;
- source->nsolvables = nrpmids;
+ repo->nsolvables = nrpmids;

if (db)
db->close(db, 0);
- return source;
+ return repo;
}

Added: trunk/sat-solver/tools/repo_rpmdb.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_rpmdb.h?rev=7668&view=auto
==============================================================================
--- trunk/sat-solver/tools/repo_rpmdb.h (added)
+++ trunk/sat-solver/tools/repo_rpmdb.h Fri Oct 26 22:25:08 2007
@@ -0,0 +1 @@
+extern Repo *pool_addrepo_rpmdb(Pool *pool, Repo *ref);

Copied: trunk/sat-solver/tools/repo_rpmmd.c (from r7667,
trunk/sat-solver/tools/source_rpmmd.c)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_rpmmd.c?p2=trunk/sat-solver/tools/repo_rpmmd.c&p1=trunk/sat-solver/tools/source_rpmmd.c&r1=7667&r2=7668&rev=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/source_rpmmd.c (original)
+++ trunk/sat-solver/tools/repo_rpmmd.c Fri Oct 26 22:25:08 2007
@@ -7,7 +7,7 @@
#include <expat.h>

#include "pool.h"
-#include "source_rpmmd.h"
+#include "repo_rpmmd.h"


enum state {
@@ -88,7 +88,7 @@
int numpacks;
int pack;
Pool *pool;
- Source *source;
+ Repo *repo;
Solvable *start;
struct stateswitch *swtab[NUMSTATES];
enum state sbtab[NUMSTATES];
@@ -219,7 +219,7 @@
#if 0
fprintf(stderr, "new dep %s%s%s\n", id2str(pool, d), id2rel(pool, d),
id2evr(pool, d));
#endif
- return source_addid_dep(pd->source, olddeps, id, isreq);
+ return repo_addid_dep(pd->repo, olddeps, id, isreq);
}


@@ -264,7 +264,7 @@
fprintf(stderr, "numpacks: %d\n", pd->numpacks);
#endif
pool->solvables = realloc(pool->solvables, (pool->nsolvables +
pd->numpacks) * sizeof(Solvable));
- pd->start = pool->solvables + pd->source->start;
+ pd->start = pool->solvables + pd->repo->start;
memset(pd->start, 0, pd->numpacks * sizeof(Solvable));
}
}
@@ -360,12 +360,12 @@
switch (pd->state)
{
case STATE_PACKAGE:
- s->source = pd->source;
+ s->repo = pd->repo;
if (!s->arch)
s->arch = ARCH_NOARCH;
if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = source_addid_dep(pd->source, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
- s->supplements = source_fix_legacy(pd->source, s->provides,
s->supplements);
+ s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
+ s->supplements = repo_fix_legacy(pd->repo, s->provides, s->supplements);
pd->pack++;
break;
case STATE_NAME:
@@ -376,7 +376,7 @@
break;
case STATE_FILE:
id = str2id(pool, pd->content, 1);
- s->provides = source_addid(pd->source, s->provides, id);
+ s->provides = repo_addid(pd->repo, s->provides, id);
break;
default:
break;
@@ -411,16 +411,16 @@

#define BUFF_SIZE 8192

-Source *
-pool_addsource_rpmmd(Pool *pool, FILE *fp)
+Repo *
+pool_addrepo_rpmmd(Pool *pool, FILE *fp)
{
struct parsedata pd;
char buf[BUFF_SIZE];
int i, l;
- Source *source;
+ Repo *repo;
struct stateswitch *sw;

- source = pool_addsource_empty(pool);
+ repo = pool_addrepo_empty(pool);
memset(&pd, 0, sizeof(pd));
for (i = 0, sw = stateswitches; sw->from != NUMSTATES; i++, sw++)
{
@@ -429,7 +429,7 @@
pd.sbtab[sw->to] = sw->from;
}
pd.pool = pool;
- pd.source = source;
+ pd.repo = repo;
pd.content = malloc(256);
pd.acontent = 256;
pd.lcontent = 0;
@@ -451,8 +451,8 @@
XML_ParserFree(parser);

pool->nsolvables += pd.pack;
- source->nsolvables = pd.pack;
+ repo->nsolvables = pd.pack;

free(pd.content);
- return source;
+ return repo;
}

Added: trunk/sat-solver/tools/repo_rpmmd.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_rpmmd.h?rev=7668&view=auto
==============================================================================
--- trunk/sat-solver/tools/repo_rpmmd.h (added)
+++ trunk/sat-solver/tools/repo_rpmmd.h Fri Oct 26 22:25:08 2007
@@ -0,0 +1 @@
+extern Repo *pool_addrepo_rpmmd(Pool *pool, FILE *fp);

Copied: trunk/sat-solver/tools/repo_susetags.c (from r7667,
trunk/sat-solver/tools/source_susetags.c)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_susetags.c?p2=trunk/sat-solver/tools/repo_susetags.c&p1=trunk/sat-solver/tools/source_susetags.c&r1=7667&r2=7668&rev=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/source_susetags.c (original)
+++ trunk/sat-solver/tools/repo_susetags.c Fri Oct 26 22:25:08 2007
@@ -6,7 +6,7 @@
#include <string.h>

#include "pool.h"
-#include "source_susetags.h"
+#include "repo_susetags.h"

#define PACK_BLOCK 255

@@ -32,7 +32,7 @@

struct parsedata {
char *kind;
- Source *source;
+ Repo *repo;
char *tmp;
int tmpl;
};
@@ -123,15 +123,15 @@
}
id = rel2id(pool, id, evrid, flags + 1, 1);
}
- return source_addid_dep(pd->source, olddeps, id, isreq);
+ return repo_addid_dep(pd->repo, olddeps, id, isreq);
}

-Source *
-pool_addsource_susetags(Pool *pool, FILE *fp)
+Repo *
+pool_addrepo_susetags(Pool *pool, FILE *fp)
{
char *line, *linep;
int aline;
- Source *source;
+ Repo *repo;
Solvable *s;
int intag = 0;
int cummulate = 0;
@@ -139,12 +139,12 @@
char *sp[5];
struct parsedata pd;

- source = pool_addsource_empty(pool);
+ repo = pool_addrepo_empty(pool);
memset(&pd, 0, sizeof(pd));
line = malloc(1024);
aline = 1024;

- pd.source = source;
+ pd.repo = repo;

linep = line;
pack = 0;
@@ -209,19 +209,19 @@
if (!strncmp(line, "=Pkg:", 5) || !strncmp(line, "=Pat:", 5))
{
if (s && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = source_addid_dep(source, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, rel2id(pool,
s->name, s->evr, REL_EQ, 1), 0);
if (s)
- s->supplements = source_fix_legacy(source, s->provides,
s->supplements);
+ s->supplements = repo_fix_legacy(repo, s->provides, s->supplements);
pd.kind = 0;
if (line[3] == 't')
pd.kind = "pattern";
if ((pack & PACK_BLOCK) == 0)
{
pool->solvables = realloc(pool->solvables, (pool->nsolvables +
pack + PACK_BLOCK + 1) * sizeof(Solvable));
- memset(pool->solvables + source->start + pack, 0, (PACK_BLOCK +
1) * sizeof(Solvable));
+ memset(pool->solvables + repo->start + pack, 0, (PACK_BLOCK + 1)
* sizeof(Solvable));
}
- s = pool->solvables + source->start + pack;
- s->source = source;
+ s = pool->solvables + repo->start + pack;
+ s->repo = repo;
pack++;
if (split(line + 5, sp, 5) != 4)
{
@@ -301,14 +301,14 @@
}
}
if (s && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = source_addid_dep(source, s->provides, rel2id(pool, s->name,
s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name,
s->evr, REL_EQ, 1), 0);
if (s)
- s->supplements = source_fix_legacy(source, s->provides, s->supplements);
+ s->supplements = repo_fix_legacy(repo, s->provides, s->supplements);

pool->nsolvables += pack;
- source->nsolvables = pack;
+ repo->nsolvables = pack;
if (pd.tmp)
free(pd.tmp);
free(line);
- return source;
+ return repo;
}

Added: trunk/sat-solver/tools/repo_susetags.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_susetags.h?rev=7668&view=auto
==============================================================================
--- trunk/sat-solver/tools/repo_susetags.h (added)
+++ trunk/sat-solver/tools/repo_susetags.h Fri Oct 26 22:25:08 2007
@@ -0,0 +1 @@
+extern Repo *pool_addrepo_susetags(Pool *pool, FILE *fp);

Copied: trunk/sat-solver/tools/repo_write.c (from r7667,
trunk/sat-solver/tools/source_write.c)
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_write.c?p2=trunk/sat-solver/tools/repo_write.c&p1=trunk/sat-solver/tools/source_write.c&r1=7667&r2=7668&rev=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/source_write.c (original)
+++ trunk/sat-solver/tools/repo_write.c Fri Oct 26 22:25:08 2007
@@ -1,7 +1,7 @@
/*
- * source_write.c
+ * repo_write.c
*
- * Write Source data out to binary file
+ * Write Repo data out to binary file
*
* See doc/README.format for a description
* of the binary file format
@@ -16,7 +16,7 @@
#include <string.h>

#include "pool.h"
-#include "source_write.h"
+#include "repo_write.h"

/*------------------------------------------------------------------*/
/* Id map optimizations */
@@ -178,11 +178,11 @@


/*
- * Source
+ * Repo
*/

void
-pool_writesource(Pool *pool, Source *source, FILE *fp)
+pool_writerepo(Pool *pool, Repo *repo, FILE *fp)
{
int i, numsolvdata;
Solvable *s, *sstart;
@@ -196,9 +196,9 @@
int bits, bitmaps;
int nsolvables;

- nsolvables = source->nsolvables;
- sstart = pool->solvables + source->start;
- idarraydata = source->idarraydata;
+ nsolvables = repo->nsolvables;
+ sstart = pool->solvables + repo->start;
+ idarraydata = repo->idarraydata;

needid = (NeedId *)calloc(pool->nstrings + pool->nrels, sizeof(*needid));

@@ -233,7 +233,7 @@
idsizes[SOLVABLE_NAME] = 1;
idsizes[SOLVABLE_ARCH] = 1;
idsizes[SOLVABLE_EVR] = 1;
- if (source->rpmdbid)
+ if (repo->rpmdbid)
idsizes[RPM_RPMDBID] = 1;

for (i = SOLVABLE_NAME; i <= RPM_RPMDBID; i++)
@@ -311,7 +311,7 @@
write_u8( fp, ran->flags);
}

- write_u32(fp, 0); /* no source data */
+ write_u32(fp, 0); /* no repo data */

/*
* write Solvables
@@ -344,7 +344,7 @@
write_u32(fp, 0);
}

- if (source->rpmdbid)
+ if (repo->rpmdbid)
{
write_u8(fp, TYPE_U32);
write_id(fp, needid[RPM_RPMDBID].need);
@@ -405,8 +405,8 @@
write_idarray(fp, pool, needid, idarraydata + s->enhances);
if (s->freshens)
write_idarray(fp, pool, needid, idarraydata + s->freshens);
- if (source->rpmdbid)
- write_u32(fp, source->rpmdbid[i]);
+ if (repo->rpmdbid)
+ write_u32(fp, repo->rpmdbid[i]);
}

free(needid);

Added: trunk/sat-solver/tools/repo_write.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_write.h?rev=7668&view=auto
==============================================================================
--- trunk/sat-solver/tools/repo_write.h (added)
+++ trunk/sat-solver/tools/repo_write.h Fri Oct 26 22:25:08 2007
@@ -0,0 +1,16 @@
+/*
+ * repo_write.h
+ *
+ */
+
+#ifndef REPO_WRITE_H
+#define REPO_WRITE_H
+
+#include <stdio.h>
+
+#include "pool.h"
+#include "repo.h"
+
+extern void pool_writerepo(Pool *pool, Repo *repo, FILE *fp);
+
+#endif

Modified: trunk/sat-solver/tools/rpmdb2solv.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/rpmdb2solv.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/rpmdb2solv.c (original)
+++ trunk/sat-solver/tools/rpmdb2solv.c Fri Oct 26 22:25:08 2007
@@ -11,15 +11,15 @@
#include <string.h>

#include "pool.h"
-#include "source_rpmdb.h"
-#include "source_solv.h"
-#include "source_write.h"
+#include "repo_rpmdb.h"
+#include "repo_solv.h"
+#include "repo_write.h"

int
main(int argc, char **argv)
{
Pool *pool = pool_create();
- Source *ref = NULL;
+ Repo *ref = NULL;
FILE *fp;

if (argc != 1)
@@ -30,21 +30,21 @@
perror(argv[1]);
exit(0);
}
- ref = pool_addsource_solv(refpool, fp, "rpmdb");
+ ref = pool_addrepo_solv(refpool, fp, "rpmdb");
fclose(fp);
}

- Source *source = pool_addsource_rpmdb(pool, ref);
+ Repo *repo = pool_addrepo_rpmdb(pool, ref);
if (ref)
{
if (ref->pool != pool)
pool_free(ref->pool);
else
- pool_freesource(pool, ref);
+ pool_freerepo(pool, ref);
ref = NULL;
}

- pool_writesource(pool, source, stdout);
+ pool_writerepo(pool, repo, stdout);
pool_free(pool);

exit(0);

Modified: trunk/sat-solver/tools/rpmmd2solv.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/rpmmd2solv.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/rpmmd2solv.c (original)
+++ trunk/sat-solver/tools/rpmmd2solv.c Fri Oct 26 22:25:08 2007
@@ -6,15 +6,15 @@
#include <string.h>

#include "pool.h"
-#include "source_rpmmd.h"
-#include "source_write.h"
+#include "repo_rpmmd.h"
+#include "repo_write.h"

int
main(int argc, char **argv)
{
Pool *pool = pool_create();
- Source *source = pool_addsource_rpmmd(pool, stdin);
- pool_writesource(pool, source, stdout);
+ Repo *repo = pool_addrepo_rpmmd(pool, stdin);
+ pool_writerepo(pool, repo, stdout);
pool_free(pool);
exit(0);
}

Modified: trunk/sat-solver/tools/susetags2solv.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/susetags2solv.c?rev=7668&r1=7667&r2=7668&view=diff
==============================================================================
--- trunk/sat-solver/tools/susetags2solv.c (original)
+++ trunk/sat-solver/tools/susetags2solv.c Fri Oct 26 22:25:08 2007
@@ -6,15 +6,15 @@
#include <string.h>

#include "pool.h"
-#include "source_susetags.h"
-#include "source_write.h"
+#include "repo_susetags.h"
+#include "repo_write.h"

int
main(int argc, char **argv)
{
Pool *pool = pool_create();
- Source *source = pool_addsource_susetags(pool, stdin);
- pool_writesource(pool, source, stdout);
+ Repo *repo = pool_addrepo_susetags(pool, stdin);
+ pool_writerepo(pool, repo, stdout);
pool_free(pool);
exit(0);
}

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages