- fix internalize logic
authorMichael Schroeder <mls@suse.de>
Mon, 22 Jun 2009 12:13:51 +0000 (14:13 +0200)
committerMichael Schroeder <mls@suse.de>
Mon, 22 Jun 2009 12:13:51 +0000 (14:13 +0200)
ext/repo_products.c
ext/repo_releasefile_products.c

index 5cdcc19..7325cd7 100644 (file)
@@ -551,6 +551,10 @@ repo_add_products(Repo *repo, const char *proddir, const char *root, int flags)
   /* no luck. print an error message in case the root argument is wrong */
   perror(fullpath);
   join_freemem();
+
+  /* the least we can do... */
+  if (!(flags & REPO_NO_INTERNALIZE) && (flags & REPO_REUSE_REPODATA) != 0)
+    repodata_internalize(repo_last_repodata(repo));
 }
 
 /* EOF */
index 2413d20..9277395 100644 (file)
@@ -144,13 +144,7 @@ repo_add_releasefile_products(Repo *repo, const char *dirpath, int flags)
   closedir(dir);
   join_freemem();
 
-  if (!(flags & REPO_NO_INTERNALIZE))
-    {
-      if (!(flags & REPO_REUSE_REPODATA))
-       {
-         Repodata *data = repo_add_repodata(repo, 0);
-         repodata_internalize(data);
-       }
-    }
+  if (!(flags & REPO_NO_INTERNALIZE) && (flags & REPO_REUSE_REPODATA) != 0)
+    repodata_internalize(repo_last_repodata(repo));
 }