use susetags data dir for susetags deltas
authorMichael Schroeder <mls@suse.de>
Tue, 30 Oct 2012 10:39:41 +0000 (11:39 +0100)
committerMichael Schroeder <mls@suse.de>
Tue, 30 Oct 2012 10:39:41 +0000 (11:39 +0100)
examples/pysolv
examples/solv.c

index b6e7710..238e3e8 100755 (executable)
@@ -881,6 +881,7 @@ if cmd == 'install' or cmd == 'erase' or cmd == 'up' or cmd == 'dup' or cmd == '
                     if not chksum:
                         continue
                     dloc = dp.lookup_str(solv.DELTA_LOCATION_DIR) + '/' + dp.lookup_str(solv.DELTA_LOCATION_NAME) + '-' + dp.lookup_str(solv.DELTA_LOCATION_EVR) + '.' + dp.lookup_str(solv.DELTA_LOCATION_SUFFIX)
+                    dloc = repo.packagespath() + dloc
                     f = repo.download(dloc, False, chksum)
                     if not f:
                         continue
index 139529f..1128c2d 100644 (file)
@@ -1048,7 +1048,7 @@ calc_checksum_fp(FILE *fp, Id chktype, unsigned char *out)
 }
 
 void
-calc_checksum_stat(struct stat *stb, Id chktype, unsigned *cookie, unsigned char *out)
+calc_checksum_stat(struct stat *stb, Id chktype, unsigned char *cookie, unsigned char *out)
 {
   void *h = solv_chksum_create(chktype);
   solv_chksum_add(h, CHKSUM_IDENT, strlen(CHKSUM_IDENT));
@@ -3029,6 +3029,11 @@ rerunsolver:
                      dloc = pool_tmpappend(pool, dloc, "/", pool_lookup_str(pool, SOLVID_POS, DELTA_LOCATION_NAME));
                      dloc = pool_tmpappend(pool, dloc, "-", pool_lookup_str(pool, SOLVID_POS, DELTA_LOCATION_EVR));
                      dloc = pool_tmpappend(pool, dloc, ".", pool_lookup_str(pool, SOLVID_POS, DELTA_LOCATION_SUFFIX));
+                     if (cinfo->type == TYPE_SUSETAGS)
+                       {
+                         const char *datadir = repo_lookup_str(cinfo->repo, SOLVID_META, SUSETAGS_DATADIR);
+                         dloc = pool_tmpjoin(pool, datadir ? datadir : "suse", "/", dloc);
+                       }
                      if ((fp = curlfopen(cinfo, dloc, 0, chksum, chksumtype, 0)) == 0)
                        continue;
                      /* got it, now reconstruct */