2 * Copyright (c) 2009, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
8 /* solv, a little software installer demoing the sat solver library */
11 * - signature and checksum verification
12 * - vendor policy loading
23 #include <sys/utsname.h>
24 #include <sys/types.h>
32 #include "solverdebug.h"
34 #include "repo_solv.h"
36 #include "repo_write.h"
37 #include "repo_rpmdb.h"
38 #include "repo_products.h"
39 #include "repo_rpmmd.h"
40 #include "repo_susetags.h"
41 #include "repo_repomdxml.h"
42 #include "repo_content.h"
43 #include "pool_fileconflicts.h"
47 # define REPOINFO_PATH "/etc/yum.repos.d"
49 # define REPOINFO_PATH "/etc/zypp/repos.d"
50 # define PRODUCTS_PATH "/etc/products.d"
53 #define SOLVCACHE_PATH "/var/cache/solv"
71 #define TYPE_UNKNOWN 0
72 #define TYPE_SUSETAGS 1
74 #define TYPE_PLAINDIR 3
77 read_repoinfos_sort(const void *ap, const void *bp)
79 const struct repoinfo *a = ap;
80 const struct repoinfo *b = bp;
81 return strcmp(a->alias, b->alias);
85 read_repoinfos(Pool *pool, const char *reposdir, int *nrepoinfosp)
88 char buf2[4096], *kp, *vp, *kpe;
93 struct repoinfo *repoinfos = 0, *cinfo;
96 rdlen = strlen(reposdir);
97 dir = opendir(reposdir);
103 while ((ent = readdir(dir)) != 0)
105 l = strlen(ent->d_name);
106 if (l < 6 || rdlen + 2 + l >= sizeof(buf) || strcmp(ent->d_name + l - 5, ".repo") != 0)
108 snprintf(buf, sizeof(buf), "%s/%s", reposdir, ent->d_name);
109 if ((fp = fopen(buf, "r")) == 0)
115 while(fgets(buf2, sizeof(buf2), fp))
120 while (buf2[l - 1] == '\n' || buf2[l - 1] == ' ' || buf2[l - 1] == '\t')
123 while (*kp == ' ' || *kp == '\t')
125 if (!*kp || *kp == '#')
131 vp = strrchr(kp, ']');
135 repoinfos = sat_extend(repoinfos, nrepoinfos, 1, sizeof(*repoinfos), 15);
136 cinfo = repoinfos + nrepoinfos++;
137 memset(cinfo, 0, sizeof(*cinfo));
138 cinfo->alias = strdup(kp + 1);
140 cinfo->type = TYPE_RPMMD;
143 vp = strchr(kp, '=');
146 for (kpe = vp - 1; kpe >= kp; kpe--)
147 if (*kpe != ' ' && *kpe != '\t')
152 while (*vp == ' ' || *vp == '\t')
155 if (!strcmp(kp, "name"))
156 cinfo->name = strdup(vp);
157 else if (!strcmp(kp, "enabled"))
158 cinfo->enabled = *vp == '0' ? 0 : 1;
159 else if (!strcmp(kp, "autorefresh"))
160 cinfo->autorefresh = *vp == '0' ? 0 : 1;
161 else if (!strcmp(kp, "gpgcheck"))
162 cinfo->gpgcheck = *vp == '0' ? 0 : 1;
163 else if (!strcmp(kp, "baseurl"))
164 cinfo->baseurl = strdup(vp);
165 else if (!strcmp(kp, "path"))
167 if (vp && strcmp(vp, "/") != 0)
168 cinfo->path = strdup(vp);
170 else if (!strcmp(kp, "type"))
172 if (!strcmp(vp, "yast2"))
173 cinfo->type = TYPE_SUSETAGS;
174 else if (!strcmp(vp, "rpm-md"))
175 cinfo->type = TYPE_RPMMD;
176 else if (!strcmp(vp, "plaindir"))
177 cinfo->type = TYPE_PLAINDIR;
179 cinfo->type = TYPE_UNKNOWN;
181 else if (!strcmp(kp, "priority"))
182 cinfo->priority = atoi(vp);
183 else if (!strcmp(kp, "keeppackages"))
184 cinfo->keeppackages = *vp == '0' ? 0 : 1;
190 qsort(repoinfos, nrepoinfos, sizeof(*repoinfos), read_repoinfos_sort);
191 *nrepoinfosp = nrepoinfos;
196 cookie_gzread(void *cookie, char *buf, size_t nbytes)
198 return gzread((gzFile *)cookie, buf, nbytes);
202 cookie_gzclose(void *cookie)
204 return gzclose((gzFile *)cookie);
208 myfopen(const char *fn)
210 cookie_io_functions_t cio;
216 suf = strrchr(fn, '.');
217 if (!suf || strcmp(suf, ".gz") != 0)
218 return fopen(fn, "r");
219 gzf = gzopen(fn, "r");
222 memset(&cio, 0, sizeof(cio));
223 cio.read = cookie_gzread;
224 cio.close = cookie_gzclose;
225 return fopencookie(gzf, "r", cio);
229 curlfopen(struct repoinfo *cinfo, const char *file, int uncompress, const unsigned char *chksum, Id chksumtype)
236 const char *baseurl = cinfo->baseurl;
239 if (l && baseurl[l - 1] == '/')
240 snprintf(url, sizeof(url), "%s%s", baseurl, file);
242 snprintf(url, sizeof(url), "%s/%s", baseurl, file);
243 strcpy(tmpl, "/var/tmp/solvXXXXXX");
251 if ((pid = fork()) == (pid_t)-1)
263 execlp("curl", "curl", "-s", "-L", url, (char *)0);
267 while (waitpid(pid, &status, 0) != pid)
269 if (lseek(fd, 0, SEEK_END) == 0)
275 lseek(fd, 0, SEEK_SET);
280 void *h = sat_chksum_create(chksumtype);
285 printf("%s: unknown checksum type\n", file);
289 while ((l = read(fd, buf, sizeof(buf))) > 0)
290 sat_chksum_add(h, buf, l);
291 lseek(fd, 0, SEEK_SET);
293 sum = sat_chksum_get(h, &l);
294 if (memcmp(sum, chksum, l))
296 printf("%s: checksum mismatch\n", file);
303 cookie_io_functions_t cio;
306 sprintf(tmpl, "/dev/fd/%d", fd);
307 gzf = gzopen(tmpl, "r");
311 memset(&cio, 0, sizeof(cio));
312 cio.read = cookie_gzread;
313 cio.close = cookie_gzclose;
314 return fopencookie(gzf, "r", cio);
316 fcntl(fd, F_SETFD, FD_CLOEXEC);
317 return fdopen(fd, "r");
321 calc_checksum_fp(FILE *fp, Id chktype, unsigned char *out)
324 void *h = sat_chksum_create(chktype);
327 while ((l = fread(buf, 1, sizeof(buf), fp)) > 0)
328 sat_chksum_add(h, buf, l);
330 sat_chksum_free(h, out);
334 calc_checksum_stat(struct stat *stb, Id chktype, unsigned char *out)
336 void *h = sat_chksum_create(chktype);
337 sat_chksum_add(h, &stb->st_dev, sizeof(stb->st_dev));
338 sat_chksum_add(h, &stb->st_ino, sizeof(stb->st_ino));
339 sat_chksum_add(h, &stb->st_size, sizeof(stb->st_size));
340 sat_chksum_add(h, &stb->st_mtime, sizeof(stb->st_mtime));
341 sat_chksum_free(h, out);
353 pool_setarch(pool, un.machine);
356 char *calccachepath(Repo *repo)
358 char *q, *p = pool_tmpjoin(repo->pool, SOLVCACHE_PATH, "/", repo->name);
359 p = pool_tmpjoin(repo->pool, p, ".solv", 0);
360 q = p + strlen(SOLVCACHE_PATH) + 1;
370 usecachedrepo(Repo *repo, unsigned char *cookie)
373 unsigned char mycookie[32];
375 if (!(fp = fopen(calccachepath(repo), "r")))
377 if (fseek(fp, -sizeof(mycookie), SEEK_END) || fread(mycookie, sizeof(mycookie), 1, fp) != 1)
382 if (cookie && memcmp(cookie, mycookie, sizeof(mycookie)))
388 if (repo_add_solv(repo, fp))
398 writecachedrepo(Repo *repo, unsigned char *cookie)
400 Id *addedfileprovides = 0;
406 mkdir(SOLVCACHE_PATH, 0755);
407 tmpl = sat_dupjoin(SOLVCACHE_PATH, "/", ".newsolv-XXXXXX");
415 if (!(fp = fdopen(fd, "w")))
422 info = repo_add_repodata(repo, 0);
423 pool_addfileprovides_ids(repo->pool, 0, &addedfileprovides);
424 if (addedfileprovides && *addedfileprovides)
426 for (i = 0; addedfileprovides[i]; i++)
427 repodata_add_idarray(info, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, addedfileprovides[i]);
429 sat_free(addedfileprovides);
430 repodata_internalize(info);
431 repo_write(repo, fp, 0, 0, 0);
433 if (fwrite(cookie, 32, 1, fp) != 1)
446 if (!rename(tmpl, calccachepath(repo)))
452 read_repos(Pool *pool, struct repoinfo *repoinfos, int nrepoinfos)
455 struct repoinfo *cinfo;
459 const char *primaryfile;
460 const unsigned char *primaryfilechksum;
461 Id primaryfilechksumtype;
462 const char *descrdir;
466 unsigned char cookie[32];
468 repo = repo_create(pool, "@System");
469 printf("rpm database:");
470 if (stat("/var/lib/rpm/Packages", &stb))
471 memset(&stb, 0, sizeof(&stb));
472 calc_checksum_stat(&stb, REPOKEY_TYPE_SHA256, cookie);
473 if (usecachedrepo(repo, cookie))
478 printf(" reading\n");
482 repo_add_products(repo, PRODUCTS_PATH, 0, REPO_NO_INTERNALIZE);
484 if ((ofp = fopen(calccachepath(repo), "r")) != 0)
486 Repo *ref = repo_create(pool, "@System.old");
487 if (!repo_add_solv(ref, ofp))
489 repo_add_rpmdb(repo, ref, 0, REPO_REUSE_REPODATA);
496 repo_add_rpmdb(repo, 0, 0, REPO_REUSE_REPODATA);
497 writecachedrepo(repo, cookie);
499 pool_set_installed(pool, repo);
501 for (i = 0; i < nrepoinfos; i++)
503 cinfo = repoinfos + i;
507 repo = repo_create(pool, cinfo->alias);
509 repo->appdata = cinfo;
510 repo->priority = 99 - cinfo->priority;
512 if (!cinfo->autorefresh && usecachedrepo(repo, 0))
514 printf("repo '%s':", cinfo->alias);
521 printf("rpmmd repo '%s':", cinfo->alias);
523 if ((fp = curlfopen(cinfo, "repodata/repomd.xml", 0, 0, 0)) == 0)
525 printf(" no data, skipped\n");
530 calc_checksum_fp(fp, REPOKEY_TYPE_SHA256, cookie);
531 if (usecachedrepo(repo, cookie))
537 printf(" reading\n");
538 repo_add_repomdxml(repo, fp, 0);
541 primaryfilechksum = 0;
542 primaryfilechksumtype = 0;
543 dataiterator_init(&di, pool, repo, SOLVID_META, REPOSITORY_REPOMD_TYPE, "primary", SEARCH_STRING);
544 dataiterator_prepend_keyname(&di, REPOSITORY_REPOMD);
545 if (dataiterator_step(&di))
547 dataiterator_setpos_parent(&di);
548 primaryfile = pool_lookup_str(pool, SOLVID_POS, REPOSITORY_REPOMD_LOCATION);
549 primaryfilechksum = pool_lookup_bin_checksum(pool, SOLVID_POS, REPOSITORY_REPOMD_CHECKSUM, &primaryfilechksumtype);
551 dataiterator_free(&di);
553 primaryfile = "repodata/primary.xml.gz";
554 if ((fp = curlfopen(cinfo, primaryfile, 1, primaryfilechksum, primaryfilechksumtype)) == 0)
556 repo_add_rpmmd(repo, fp, 0, 0);
558 writecachedrepo(repo, cookie);
561 printf("susetags repo '%s':", cinfo->alias);
563 repo = repo_create(pool, cinfo->alias);
565 repo->appdata = cinfo;
566 repo->priority = 99 - cinfo->priority;
569 if ((fp = curlfopen(cinfo, "content", 0, 0, 0)) != 0)
571 calc_checksum_fp(fp, REPOKEY_TYPE_SHA256, cookie);
572 if (usecachedrepo(repo, cookie))
578 havecontent = 1; /* ok to write cache */
579 repo_add_content(repo, fp, 0);
581 defvendor = repo_lookup_id(repo, SOLVID_META, SUSETAGS_DEFAULTVENDOR);
582 descrdir = repo_lookup_str(repo, SOLVID_META, SUSETAGS_DESCRDIR);
585 descrdir = "suse/setup/descr";
586 printf(" reading\n");
587 if ((fp = curlfopen(cinfo, pool_tmpjoin(pool, descrdir, "/packages.gz", 0), 1, 0, 0)) == 0)
588 if ((fp = curlfopen(cinfo, pool_tmpjoin(pool, descrdir, "/packages", 0), 0, 0, 0)) == 0)
590 repo_add_susetags(repo, fp, defvendor, 0, 0);
593 writecachedrepo(repo, cookie);
596 printf("unsupported repo '%s': skipped\n", cinfo->alias);
605 mkselect(Pool *pool, const char *arg, int flags, Queue *out)
611 id = str2id(pool, arg, 0);
614 FOR_PROVIDES(p, pp, id)
616 Solvable *s = pool_id2solvable(pool, p);
619 type = SOLVER_SOLVABLE_NAME;
622 type = SOLVER_SOLVABLE_PROVIDES;
627 /* did not find a solvable, see if it's a relation */
628 if ((r = strpbrk(arg, "<=>")) != 0)
632 for (r2 = r; r2 > arg && (r2[-1] == ' ' || r2[-1] == '\t'); )
634 rname = r2 > arg ? strn2id(pool, arg, r2 - arg, 1) : 0;
646 while (*r == ' ' || *r == '\t')
648 revr = *r ? str2id(pool, r, 1) : 0;
649 rid = rname && revr ? rel2id(pool, rname, revr, rflags, 1) : 0;
652 FOR_PROVIDES(p, pp, rid)
654 Solvable *s = pool_id2solvable(pool, p);
655 if (pool_match_nevr(pool, s, rid))
657 type = SOLVER_SOLVABLE_NAME;
660 type = SOLVER_SOLVABLE_PROVIDES;
669 queue_push(out, type);
675 yesno(const char *str)
677 char inbuf[128], *ip;
684 if (!(ip = fgets(inbuf, sizeof(inbuf), stdin)))
689 while (*ip == ' ' || *ip == '\t')
696 if (*ip == 'y' || *ip == 'n')
697 return *ip == 'y' ? 1 : 0;
709 fc_cb(Pool *pool, Id p, void *cbdata)
711 struct fcstate *fcstate = cbdata;
719 rpm_byrpmdbid(0, 0, &fcstate->rpmdbstate);
722 s = pool_id2solvable(pool, p);
723 if (pool->installed && s->repo == pool->installed)
725 if (!s->repo->rpmdbid)
727 rpmdbid = s->repo->rpmdbid[p - s->repo->start];
730 return rpm_byrpmdbid(rpmdbid, 0, &fcstate->rpmdbstate);
732 for (i = 0; i < fcstate->newpkgscnt; i++)
733 if (fcstate->checkq->elements[i] == p)
735 if (i == fcstate->newpkgscnt)
737 fp = fcstate->newpkgsfps[i];
741 return rpm_byfp(fp, solvable2str(pool, s), &fcstate->rpmdbstate);
745 runrpm(const char *arg, const char *name, int dupfd3)
750 if ((pid = fork()) == (pid_t)-1)
757 if (dupfd3 != -1 && dupfd3 != 3)
763 fcntl(3, F_SETFD, 0); /* clear CLOEXEC */
764 if (strcmp(arg, "-e") == 0)
765 execlp("rpm", "rpm", arg, "--nodeps", "--nodigest", "--nosignature", name, (char *)0);
767 execlp("rpm", "rpm", arg, "--force", "--nodeps", "--nodigest", "--nosignature", name, (char *)0);
771 while (waitpid(pid, &status, 0) != pid)
775 printf("rpm failed\n");
781 nscallback(Pool *pool, void *data, Id name, Id evr)
783 if (name == NAMESPACE_PRODUCTBUDDY)
785 /* SUSE specific hack: each product has an associated rpm */
786 Solvable *s = pool->solvables + evr;
789 cap = str2id(pool, pool_tmpjoin(pool, "product(", id2str(pool, s->name) + 8, ")"), 0);
792 cap = rel2id(pool, cap, s->evr, REL_EQ, 0);
795 FOR_PROVIDES(p, pp, cap)
797 Solvable *ps = pool->solvables + p;
798 if (ps->repo == s->repo && ps->arch == s->arch)
808 main(int argc, char **argv)
812 struct repoinfo *repoinfos;
814 int i, mode, newpkgs;
818 char inbuf[128], *ip;
822 struct fcstate fcstate;
828 fprintf(stderr, "Usage: solv install|erase|update|show <select>\n");
831 if (!strcmp(argv[0], "install") || !strcmp(argv[0], "in"))
832 mode = SOLVER_INSTALL;
833 else if (!strcmp(argv[0], "erase") || !strcmp(argv[0], "rm"))
835 else if (!strcmp(argv[0], "show"))
837 else if (!strcmp(argv[0], "update") || !strcmp(argv[0], "up"))
838 mode = SOLVER_UPDATE;
839 else if (!strcmp(argv[0], "dist-upgrade") || !strcmp(argv[0], "dup"))
841 mode = SOLVER_UPDATE;
846 fprintf(stderr, "Usage: solv install|erase|update|show <select>\n");
850 pool = pool_create();
851 pool->nscallback = nscallback;
852 // pool_setdebuglevel(pool, 2);
854 repoinfos = read_repoinfos(pool, REPOINFO_PATH, &nrepoinfos);
855 read_repos(pool, repoinfos, nrepoinfos);
856 // FOR_REPOS(i, repo)
857 // printf("%s: %d solvables\n", repo->name, repo->nsolvables);
858 pool_addfileprovides(pool);
859 pool_createwhatprovides(pool);
862 for (i = 1; i < argc; i++)
863 mkselect(pool, argv[i], 0, &job);
864 if (!job.count && mode == SOLVER_UPDATE)
868 printf("no package matched\n");
874 /* show mode, no solver needed */
875 for (i = 0; i < job.count; i += 2)
877 FOR_JOB_SELECT(p, pp, job.elements[i], job.elements[i + 1])
879 Solvable *s = pool_id2solvable(pool, p);
880 printf(" - %s [%s]\n", solvable2str(pool, s), s->repo->name);
887 for (i = 0; i < job.count; i += 2)
888 job.elements[i] |= mode;
891 // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, str2id(pool, "kernel-pae", 1));
892 // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, str2id(pool, "kernel-pae-base", 1));
893 // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, str2id(pool, "kernel-pae-extra", 1));
898 Id problem, solution;
901 solv = solver_create(pool);
902 solv->ignorealreadyrecommended = 1;
903 solv->updatesystem = updateall;
904 solv->dosplitprovides = updateall;
905 if (updateall && distupgrade)
907 solv->distupgrade = 1;
908 solv->allowdowngrade = 1;
909 solv->allowarchchange = 1;
910 solv->allowvendorchange = 1;
912 // queue_push2(&job, SOLVER_DISTUPGRADE, 3);
913 solver_solve(solv, &job);
914 if (!solv->problems.count)
916 pcnt = solver_problem_count(solv);
917 printf("Found %d problems:\n", pcnt);
918 for (problem = 1; problem <= pcnt; problem++)
921 printf("Problem %d:\n", problem);
922 solver_printprobleminfo(solv, problem);
924 scnt = solver_solution_count(solv, problem);
925 for (solution = 1; solution <= scnt; solution++)
927 printf("Solution %d:\n", solution);
928 solver_printsolution(solv, problem, solution);
933 printf("Please choose a solution: ");
936 if (!(ip = fgets(inbuf, sizeof(inbuf), stdin)))
941 while (*ip == ' ' || *ip == '\t')
943 if (*ip >= '0' && *ip <= '9')
946 if (take >= 1 && take <= scnt)
962 solver_take_solution(solv, problem, take, &job);
967 if (!solv->trans.steps.count)
969 printf("Nothing to do.\n");
973 printf("Transaction summary:\n\n");
974 solver_printtransaction(solv);
975 if (!yesno("OK to continue (y/n)? "))
981 trans = &solv->trans;
983 newpkgs = transaction_installedresult(trans, &checkq);
988 printf("Downloading %d packages\n", newpkgs);
989 newpkgsfps = sat_calloc(newpkgs, sizeof(*newpkgsfps));
990 for (i = 0; i < newpkgs; i++)
992 unsigned int medianr;
995 struct repoinfo *cinfo;
996 const unsigned char *chksum;
999 p = checkq.elements[i];
1000 s = pool_id2solvable(pool, p);
1001 cinfo = s->repo->appdata;
1004 printf("%s: no repository information\n", s->repo->name);
1007 loc = solvable_get_location(s, &medianr);
1010 if (cinfo->type == TYPE_SUSETAGS)
1012 const char *datadir = repo_lookup_str(cinfo->repo, SOLVID_META, SUSETAGS_DATADIR);
1013 loc = pool_tmpjoin(pool, datadir ? datadir : "suse", "/", loc);
1016 chksum = solvable_lookup_bin_checksum(s, SOLVABLE_CHECKSUM, &chksumtype);
1017 if ((newpkgsfps[i] = curlfopen(cinfo, loc, 0, chksum, chksumtype)) == 0)
1019 printf("%s: %s not found in repository\n", s->repo->name, loc);
1029 printf("Searching for file conflicts\n");
1030 queue_init(&conflicts);
1031 fcstate.rpmdbstate = 0;
1032 fcstate.newpkgscnt = newpkgs;
1033 fcstate.checkq = &checkq;
1034 fcstate.newpkgsfps = newpkgsfps;
1035 pool_findfileconflicts(pool, &checkq, newpkgs, &conflicts, &fc_cb, &fcstate);
1036 if (conflicts.count)
1039 for (i = 0; i < conflicts.count; i += 5)
1040 printf("file %s of package %s conflicts with package %s\n", id2str(pool, conflicts.elements[i]), solvid2str(pool, conflicts.elements[i + 1]), solvid2str(pool, conflicts.elements[i + 3]));
1042 if (yesno("Re-run solver (y/n/q)? "))
1044 for (i = 0; i < newpkgs; i++)
1046 fclose(newpkgsfps[i]);
1047 newpkgsfps = sat_free(newpkgsfps);
1049 pool_add_fileconflicts_deps(pool, &conflicts);
1050 pool_createwhatprovides(pool); /* Hmm... */
1054 queue_free(&conflicts);
1057 printf("Committing transaction:\n\n");
1058 transaction_order(trans, 0);
1059 for (i = 0; i < trans->steps.count; i++)
1061 const char *evr, *evrp, *nvra;
1066 p = trans->steps.elements[i];
1067 s = pool_id2solvable(pool, p);
1068 Id type = transaction_type(trans, p, SOLVER_TRANSACTION_RPM_ONLY);
1071 case SOLVER_TRANSACTION_ERASE:
1072 printf("erase %s\n", solvid2str(pool, p));
1073 if (!s->repo->rpmdbid || !s->repo->rpmdbid[p - s->repo->start])
1075 /* strip epoch from evr */
1076 evr = evrp = id2str(pool, s->evr);
1077 while (*evrp >= '0' && *evrp <= '9')
1079 if (evrp > evr && evrp[0] == ':' && evrp[1])
1081 nvra = pool_tmpjoin(pool, id2str(pool, s->name), "-", evr);
1082 nvra = pool_tmpjoin(pool, nvra, ".", id2str(pool, s->arch));
1083 runrpm("-e", nvra, -1); /* to bad that --querybynumber doesn't work */
1085 case SOLVER_TRANSACTION_INSTALL:
1086 case SOLVER_TRANSACTION_MULTIINSTALL:
1087 printf("install %s\n", solvid2str(pool, p));
1088 for (j = 0; j < newpkgs; j++)
1089 if (checkq.elements[j] == p)
1091 fp = j < newpkgs ? newpkgsfps[j] : 0;
1095 lseek(fileno(fp), 0, SEEK_SET);
1096 runrpm(type == SOLVER_TRANSACTION_MULTIINSTALL ? "-i" : "-U", "/dev/fd/3", fileno(fp));
1105 for (i = 0; i < newpkgs; i++)
1107 fclose(newpkgsfps[i]);
1108 sat_free(newpkgsfps);
1109 queue_free(&checkq);