fix compile on 64bit
[platform/upstream/libsolv.git] / tools / repo_rpmmd.c
index 4fdb45f..44ab8ee 100644 (file)
@@ -773,19 +773,7 @@ startElement(void *userData, const char *name, const char **atts)
     case STATE_LOCATION:
       str = find_attr("href", atts);
       if (str)
-       {
-         const char *str2 = strrchr(str, '/');
-         if (str2)
-           {
-             char *str3 = strdup(str);
-             str3[str2 - str] = 0;
-             repodata_set_poolstr(pd->data, handle, SOLVABLE_MEDIADIR, str3);
-             free(str3);
-              repodata_set_str(pd->data, handle, SOLVABLE_MEDIAFILE, str2 + 1);
-           }
-         else
-            repodata_set_str(pd->data, handle, SOLVABLE_MEDIAFILE, str);
-       }
+       repodata_set_location(pd->data, handle, 0, 0, str);
       break;
     case STATE_CHECKSUM:
       pd->tmpattr = find_attr("type", atts);
@@ -1104,7 +1092,9 @@ repo_add_rpmmd(Repo *repo, FILE *fp, const char *language, int flags)
   int i, l;
   struct stateswitch *sw;
   Repodata *data;
+  unsigned int now;
 
+  now = sat_timems(0);
   if (!(flags & REPO_REUSE_REPODATA))
     data = repo_add_repodata(repo, 0);
   else
@@ -1158,4 +1148,7 @@ repo_add_rpmmd(Repo *repo, FILE *fp, const char *language, int flags)
   sat_free(pd.cscache);
   if (!(flags & REPO_NO_INTERNALIZE))
     repodata_internalize(data);
+  POOL_DEBUG(SAT_DEBUG_STATS, "repo_add_rpmmd took %d ms\n", sat_timems(now));
+  POOL_DEBUG(SAT_DEBUG_STATS, "repo size: %d solvables\n", repo->nsolvables);
+  POOL_DEBUG(SAT_DEBUG_STATS, "repo memory used: %ld K incore, %ld K idarray\n", (unsigned long)data->incoredatalen/1024, (unsigned long)repo->idarraysize / (1024/sizeof(Id)));
 }