We need to add mediadir also in the non-trivial case.
authorMichael Matz <matz@suse.de>
Thu, 21 Feb 2008 15:39:05 +0000 (15:39 +0000)
committerMichael Matz <matz@suse.de>
Thu, 21 Feb 2008 15:39:05 +0000 (15:39 +0000)
zypp/sat/Solvable.cc

index 89f079e3e2e6bed5b025546983674a71af254e55..2e4398cb6255657740b1b2d47ad15445429cde1a 100644 (file)
@@ -104,26 +104,26 @@ namespace zypp
       switch (key->type)
       {
         case TYPE_ID:
-        if (key->name == SolvAttr::mediadir.idStr().id())
-        {
-          if (data->localpool)
-            lc->mediadir = stringpool_id2str(&data->spool, kv->id);
-          else
-            lc->mediadir = id2str(data->repo->pool, kv->id);
-        }
-        break;
+          if (key->name == SolvAttr::mediadir.idStr().id())
+          {
+            if (data->localpool)
+              lc->mediadir = stringpool_id2str(&data->spool, kv->id);
+            else
+              lc->mediadir = id2str(data->repo->pool, kv->id);
+          }
+          break;
         case TYPE_STR:
-        if (key->name == SolvAttr::mediafile.idStr().id())
-          lc->mediafile = kv->str;
-        break;
-          case TYPE_VOID:
-        if (key->name == SolvAttr::mediafile.idStr().id())
-          lc->trivial = 1;
-        break;
-          case TYPE_CONSTANT:
-        if (key->name == SolvAttr::medianr.idStr().id())
-          lc->medianr = kv->num;
-        break;
+          if (key->name == SolvAttr::mediafile.idStr().id())
+            lc->mediafile = kv->str;
+          break;
+        case TYPE_VOID:
+          if (key->name == SolvAttr::mediafile.idStr().id())
+            lc->trivial = 1;
+          break;
+        case TYPE_CONSTANT:
+          if (key->name == SolvAttr::medianr.idStr().id())
+            lc->medianr = kv->num;
+          break;
       }
       /* continue walking */
       return 0;
@@ -153,13 +153,6 @@ namespace zypp
       medianr = lc.medianr;
       std::string ret;
 
-      if (!lc.trivial)
-      {
-        if (lc.mediafile)
-          ret += lc.mediafile;
-        return ret;
-      }
-
       if (lc.mediadir)
       {
         ret += std::string( lc.mediadir ) + "/";
@@ -171,6 +164,14 @@ namespace zypp
         ret += "suse/";
         ret += IdString(_solvable->arch).asString() + "/";
       }
+
+      if (!lc.trivial)
+      {
+        if (lc.mediafile)
+          ret += lc.mediafile;
+        return ret;
+      }
+
       /* Trivial means that we can construct the rpm name from our
          solvable data, as name-evr.arch.rpm .  */
       ret += IdString(_solvable->name).asString();