ref: refs/heads/master
commit 25c49541d4a5f14a15728014395f6af9dc81fdf8
Author: Michael Schroeder
Date: Tue Jun 30 16:39:54 2009 +0200
- add repo_deb to CMakeLists.txt
---
ext/CMakeLists.txt | 5 +++--
ext/repo_deb.c | 11 +++++------
ext/repo_rpmdb.c | 3 ++-
src/chksum.c | 8 ++++----
src/poolid.c | 8 ++++++++
5 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt
index 1f53aa8..c6bd1bc 100644
--- a/ext/CMakeLists.txt
+++ b/ext/CMakeLists.txt
@@ -1,7 +1,8 @@
SET(libsatsolverext_SRCS
pool_fileconflicts.c repo_content.c repo_deltainfoxml.c repo_helix.c repo_products.c
repo_releasefile_products.c repo_repomdxml.c repo_rpmdb.c repo_rpmmd.c
- repo_susetags.c repo_updateinfoxml.c repo_write.c repo_zyppdb.c)
+ repo_susetags.c repo_updateinfoxml.c repo_write.c repo_zyppdb.c
+ repo_deb.c)
ADD_LIBRARY(satsolverext STATIC ${libsatsolverext_SRCS})
@@ -9,7 +10,7 @@ SET(libsatsolver_HEADERS
pool_fileconflicts.h repo_content.h repo_deltainfoxml.h repo_helix.h repo_products.h
repo_releasefile_products.h repo_repomdxml.h repo_rpmdb.h repo_rpmmd.h
repo_susetags.h repo_updateinfoxml.h repo_write.h repo_zyppdb.h
- tools_util.h)
+ tools_util.h repo_deb.h)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
diff --git a/ext/repo_deb.c b/ext/repo_deb.c
index 59807ac..da352ba 100644
--- a/ext/repo_deb.c
+++ b/ext/repo_deb.c
@@ -69,7 +69,6 @@ makedeps(Repo *repo, char *deps, unsigned int olddeps, Id marker)
Pool *pool = repo->pool;
char *p, *n, *ne, *e, *ee;
Id id, name, evr;
- int c;
int flags;
while ((p = strchr(deps, ',')) != 0)
@@ -296,13 +295,13 @@ repo_add_debs(Repo *repo, const char **debs, int ndebs, int flags)
continue;
}
l = fread(buf, 1, sizeof(buf), fp);
- if (l < 8 + 60 || strncmp(buf, "!<arch>\ndebian-binary ", 8 + 16) != 0)
+ if (l < 8 + 60 || strncmp((char *)buf, "!<arch>\ndebian-binary ", 8 + 16) != 0)
{
fprintf(stderr, "%s: not a deb package\n", debs[i]);
fclose(fp);
continue;
}
- vlen = atoi(buf + 8 + 48);
+ vlen = atoi((char *)buf + 8 + 48);
if (vlen < 0 || vlen > l)
{
fprintf(stderr, "%s: not a deb package\n", debs[i]);
@@ -316,13 +315,13 @@ repo_add_debs(Repo *repo, const char **debs, int ndebs, int flags)
fclose(fp);
continue;
}
- if (strncmp(buf + 8 + 60 + vlen, "control.tar.gz ", 16) != 0)
+ if (strncmp((char *)buf + 8 + 60 + vlen, "control.tar.gz ", 16) != 0)
{
fprintf(stderr, "%s: control.tar.gz is not second entry\n", debs[i]);
fclose(fp);
continue;
}
- clen = atoi(buf + 8 + 60 + vlen + 48);
+ clen = atoi((char *)buf + 8 + 60 + vlen + 48);
if (clen <= 0)
{
fprintf(stderr, "%s: control.tar.gz has illegal size\n", debs[i]);
@@ -411,7 +410,7 @@ repo_add_debs(Repo *repo, const char **debs, int ndebs, int flags)
for (j = 124; j < 124 + 12; j++)
if (bp[j] >= '0' && bp[j] <= '7')
l2 = l2 * 8 + (bp[j] - '0');
- if (!strcmp(bp, "./control"))
+ if (!strcmp((char *)bp, "./control"))
break;
l2 = 512 + ((l2 + 511) & ~511);
l -= l2;
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c
index 48a8d1e..7216685 100644
--- a/ext/repo_rpmdb.c
+++ b/ext/repo_rpmdb.c
@@ -1816,7 +1816,8 @@ repo_add_rpms(Repo *repo, const char **rpms, int nrpms, int flags)
{
Id handle = s - pool->solvables;
repodata_set_location(data, handle, 0, 0, rpms[i]);
- repodata_set_num(data, handle, SOLVABLE_DOWNLOADSIZE, (unsigned int)((stb.st_size + 1023) / 1024));
+ if (S_ISREG(stb.st_mode))
+ repodata_set_num(data, handle, SOLVABLE_DOWNLOADSIZE, (unsigned int)((stb.st_size + 1023) / 1024));
repodata_set_num(data, handle, SOLVABLE_HEADEREND, headerend);
if (gotpkgid)
repodata_set_bin_checksum(data, handle, SOLVABLE_PKGID, REPOKEY_TYPE_MD5, pkgid);
diff --git a/src/chksum.c b/src/chksum.c
index a66de46..2b917dd 100644
--- a/src/chksum.c
+++ b/src/chksum.c
@@ -76,23 +76,23 @@ sat_chksum_get(void *handle, int *lenp)
case REPOKEY_TYPE_MD5:
sat_MD5_Final(h->result, &h->c.md5);
h->done = 1;
- if (*lenp)
+ if (lenp)
*lenp = 16;
return h->result;
case REPOKEY_TYPE_SHA1:
sat_SHA1_Final(&h->c.sha1, h->result);
h->done = 1;
- if (*lenp)
+ if (lenp)
*lenp = 20;
return h->result;
case REPOKEY_TYPE_SHA256:
sat_SHA256_Final(h->result, &h->c.sha256);
h->done = 1;
- if (*lenp)
+ if (lenp)
*lenp = 32;
return h->result;
default:
- if (*lenp)
+ if (lenp)
*lenp = 0;
return 0;
}
diff --git a/src/poolid.c b/src/poolid.c
index 9ed14d1..0503224 100644
--- a/src/poolid.c
+++ b/src/poolid.c
@@ -135,10 +135,18 @@ id2str(const Pool *pool, Id id)
static const char *rels[] = {
" ! ",
+#ifndef DEBIAN_SEMANTICS
" > ",
+#else
+ " >> ",
+#endif
" = ",
" >= ",
+#ifndef DEBIAN_SEMANTICS
" < ",
+#else
+ " << ",
+#endif
" <> ",
" <= ",
" <=> "
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org