]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
- add repo_deb to CMakeLists.txt
authorMichael Schroeder <mls@suse.de>
Tue, 30 Jun 2009 14:39:54 +0000 (16:39 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 30 Jun 2009 14:39:54 +0000 (16:39 +0200)
ext/CMakeLists.txt
ext/repo_deb.c
ext/repo_rpmdb.c
src/chksum.c
src/poolid.c

index 1f53aa89b403752700060db9f87607d4e8d0cf53..c6bd1bcada1920d78b1ecd65b9e16ad052d92123 100644 (file)
@@ -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")
 
index 59807acd65f05ecd62f70ffc670f1c83aecec386..da352ba2a70e7faa8813578ac72fffc9488e1b21 100644 (file)
@@ -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;
index 48a8d1e1143f004ae78e5d6691a86440b51f0006..721668547a1065ea7f230f7c808afeee09214fd7 100644 (file)
@@ -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);
index a66de4614817e00a36961fefeba3549afecaa695..2b917dd0dad12c53e3d5dd339f44e79e654ce72c 100644 (file)
@@ -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;
     }
index 9ed14d19d8c2b6d560d6ec2b411f0cef32d675cc..05032248516016b3b4943e35a15a6ca8fdf04437 100644 (file)
@@ -135,10 +135,18 @@ id2str(const Pool *pool, Id id)
 
 static const char *rels[] = {
   " ! ",
+#ifndef DEBIAN_SEMANTICS
   " > ",
+#else
+  " >> ",
+#endif
   " = ",
   " >= ",
+#ifndef DEBIAN_SEMANTICS
   " < ",
+#else
+  " << ",
+#endif
   " <> ",
   " <= ",
   " <=> "