#include "repo_solv.h"
#include "repo_write.h"
-#ifndef DEBIAN
+#ifdef ENABLE_RPMDB
#include "repo_rpmdb.h"
-#else
+#include "pool_fileconflicts.h"
+#endif
+#ifdef ENABLE_DEBIAN
#include "repo_deb.h"
#endif
-#include "repo_products.h"
+#ifdef ENABLE_RPMMD
#include "repo_rpmmd.h"
-#include "repo_susetags.h"
#include "repo_repomdxml.h"
#include "repo_updateinfoxml.h"
#include "repo_deltainfoxml.h"
+#endif
+#ifdef ENABLE_SUSEREPO
+#include "repo_products.h"
+#include "repo_susetags.h"
#include "repo_content.h"
-#include "pool_fileconflicts.h"
-#include "sat_xfopen.h"
+#endif
+#include "solv_xfopen.h"
#ifdef FEDORA
# define REPOINFO_PATH "/etc/yum.repos.d"
-#else
+#endif
+#ifdef SUSE
# define REPOINFO_PATH "/etc/zypp/repos.d"
# define PRODUCTS_PATH "/etc/products.d"
# define SOFTLOCKS_PATH "/var/lib/zypp/SoftLocks"
if (!line)
{
- sat_free(releaseevr);
+ solv_free(releaseevr);
releaseevr = 0;
- sat_free(basearch);
+ solv_free(basearch);
basearch = 0;
return 0;
}
#define TYPE_PLAINDIR 3
#define TYPE_DEBIAN 4
+#ifndef NOSYSTEM
static int
read_repoinfos_sort(const void *ap, const void *bp)
{
const struct repoinfo *b = bp;
return strcmp(a->alias, b->alias);
}
+#endif
-#ifndef DEBIAN
+#if defined(SUSE) || defined(FEDORA)
struct repoinfo *
-read_repoinfos(Pool *pool, const char *reposdir, int *nrepoinfosp)
+read_repoinfos(Pool *pool, int *nrepoinfosp)
{
+ const char *reposdir = REPOINFO_PATH;
char buf[4096];
char buf2[4096], *kp, *vp, *kpe;
DIR *dir;
if (!vp)
continue;
*vp = 0;
- repoinfos = sat_extend(repoinfos, nrepoinfos, 1, sizeof(*repoinfos), 15);
+ repoinfos = solv_extend(repoinfos, nrepoinfos, 1, sizeof(*repoinfos), 15);
cinfo = repoinfos + nrepoinfos++;
memset(cinfo, 0, sizeof(*cinfo));
cinfo->alias = strdup(kp + 1);
return repoinfos;
}
-#else
+#endif
+
+#ifdef DEBIAN
struct repoinfo *
-read_repoinfos(Pool *pool, const char *reposdir, int *nrepoinfosp)
+read_repoinfos(Pool *pool, int *nrepoinfosp)
{
FILE *fp;
char buf[4096];
kp++;
if (!*kp)
continue;
- repoinfos = sat_extend(repoinfos, nrepoinfos, 1, sizeof(*repoinfos), 15);
+ repoinfos = solv_extend(repoinfos, nrepoinfos, 1, sizeof(*repoinfos), 15);
cinfo = repoinfos + nrepoinfos++;
memset(cinfo, 0, sizeof(*cinfo));
cinfo->baseurl = strdup(url);
- cinfo->alias = sat_dupjoin(url, "/", distro);
+ cinfo->alias = solv_dupjoin(url, "/", distro);
cinfo->name = strdup(distro);
cinfo->type = TYPE_DEBIAN;
cinfo->enabled = 1;
kp++;
if (*kp)
*kp++ = 0;
- cinfo->components = sat_extend(cinfo->components, cinfo->ncomponents, 1, sizeof(*cinfo->components), 15);
+ cinfo->components = solv_extend(cinfo->components, cinfo->ncomponents, 1, sizeof(*cinfo->components), 15);
cinfo->components[cinfo->ncomponents++] = strdup(compo);
}
}
#endif
+#ifdef NOSYSTEM
+struct repoinfo *
+read_repoinfos(Pool *pool, int *nrepoinfosp)
+{
+ *nrepoinfosp = 0;
+ return 0;
+}
+#endif
+
+
void
free_repoinfos(struct repoinfo *repoinfos, int nrepoinfos)
{
for (i = 0; i < nrepoinfos; i++)
{
struct repoinfo *cinfo = repoinfos + i;
- sat_free(cinfo->name);
- sat_free(cinfo->alias);
- sat_free(cinfo->path);
- sat_free(cinfo->metalink);
- sat_free(cinfo->mirrorlist);
- sat_free(cinfo->baseurl);
+ solv_free(cinfo->name);
+ solv_free(cinfo->alias);
+ solv_free(cinfo->path);
+ solv_free(cinfo->metalink);
+ solv_free(cinfo->mirrorlist);
+ solv_free(cinfo->baseurl);
for (j = 0; j < cinfo->ncomponents; j++)
- sat_free(cinfo->components[j]);
- sat_free(cinfo->components);
+ solv_free(cinfo->components[j]);
+ solv_free(cinfo->components);
}
- sat_free(repoinfos);
+ solv_free(repoinfos);
}
static inline int
void *h;
int l;
- h = sat_chksum_create(chksumtype);
+ h = solv_chksum_create(chksumtype);
if (!h)
{
printf("%s: unknown checksum type\n", file);
return 0;
}
while ((l = read(fd, buf, sizeof(buf))) > 0)
- sat_chksum_add(h, buf, l);
+ solv_chksum_add(h, buf, l);
lseek(fd, 0, SEEK_SET);
l = 0;
- sum = sat_chksum_get(h, &l);
+ sum = solv_chksum_get(h, &l);
if (memcmp(sum, chksum, l))
{
printf("%s: checksum mismatch\n", file);
- sat_chksum_free(h, 0);
+ solv_chksum_free(h, 0);
return 0;
}
- sat_chksum_free(h, 0);
+ solv_chksum_free(h, 0);
return 1;
}
char portstr[16];
struct addrinfo hints, *result;;
- fds = sat_calloc(nurls, sizeof(*fds));
- socks = sat_calloc(nurls, sizeof(*socks));
+ fds = solv_calloc(nurls, sizeof(*fds));
+ socks = solv_calloc(nurls, sizeof(*socks));
for (i = 0; i < nurls; i++)
{
socks[i] = -1;
if (chksumtypep && !*chksumtypep && !strncmp(bp, "<hash type=\"sha256\">", 20))
{
bp += 20;
- if (sat_hex2bin((const char **)&bp, chksump, 32) == 32)
+ if (solv_hex2bin((const char **)&bp, chksump, 32) == 32)
*chksumtypep = REPOKEY_TYPE_SHA256;
continue;
}
*ep = 0;
if (strncmp(bp, "http", 4))
continue;
- urls = sat_extend(urls, nurls, 1, sizeof(*urls), 15);
+ urls = solv_extend(urls, nurls, 1, sizeof(*urls), 15);
urls[nurls++] = strdup(bp);
}
if (nurls)
bp = urls[0];
urls[0] = 0;
for (i = 0; i < nurls; i++)
- sat_free(urls[i]);
- sat_free(urls);
+ solv_free(urls[i]);
+ solv_free(urls);
ep = strchr(bp, '/');
if ((ep = strchr(ep + 2, '/')) != 0)
{
l = strlen(bp);
while (l > 0 && (bp[l - 1] == ' ' || bp[l - 1] == '\t' || bp[l - 1] == '\n'))
bp[--l] = 0;
- urls = sat_extend(urls, nurls, 1, sizeof(*urls), 15);
+ urls = solv_extend(urls, nurls, 1, sizeof(*urls), 15);
urls[nurls++] = strdup(bp);
}
if (nurls)
bp = urls[0];
urls[0] = 0;
for (i = 0; i < nurls; i++)
- sat_free(urls[i]);
- sat_free(urls);
+ solv_free(urls[i]);
+ solv_free(urls);
ep = strchr(bp, '/');
if ((ep = strchr(ep + 2, '/')) != 0)
{
return 0;
}
if (uncompress)
- return sat_xfopen_fd(".gz", fd, "r");
+ return solv_xfopen_fd(".gz", fd, "r");
fcntl(fd, F_SETFD, FD_CLOEXEC);
return fdopen(fd, "r");
}
calc_checksum_fp(FILE *fp, Id chktype, unsigned char *out)
{
char buf[4096];
- void *h = sat_chksum_create(chktype);
+ void *h = solv_chksum_create(chktype);
int l;
- sat_chksum_add(h, CHKSUM_IDENT, strlen(CHKSUM_IDENT));
+ solv_chksum_add(h, CHKSUM_IDENT, strlen(CHKSUM_IDENT));
while ((l = fread(buf, 1, sizeof(buf), fp)) > 0)
- sat_chksum_add(h, buf, l);
+ solv_chksum_add(h, buf, l);
rewind(fp);
- sat_chksum_free(h, out);
+ solv_chksum_free(h, out);
}
void
calc_checksum_stat(struct stat *stb, Id chktype, unsigned char *out)
{
- void *h = sat_chksum_create(chktype);
- sat_chksum_add(h, CHKSUM_IDENT, strlen(CHKSUM_IDENT));
- sat_chksum_add(h, &stb->st_dev, sizeof(stb->st_dev));
- sat_chksum_add(h, &stb->st_ino, sizeof(stb->st_ino));
- sat_chksum_add(h, &stb->st_size, sizeof(stb->st_size));
- sat_chksum_add(h, &stb->st_mtime, sizeof(stb->st_mtime));
- sat_chksum_free(h, out);
+ void *h = solv_chksum_create(chktype);
+ solv_chksum_add(h, CHKSUM_IDENT, strlen(CHKSUM_IDENT));
+ solv_chksum_add(h, &stb->st_dev, sizeof(stb->st_dev));
+ solv_chksum_add(h, &stb->st_ino, sizeof(stb->st_ino));
+ solv_chksum_add(h, &stb->st_size, sizeof(stb->st_size));
+ solv_chksum_add(h, &stb->st_mtime, sizeof(stb->st_mtime));
+ solv_chksum_free(h, out);
}
void
flags |= REPO_LOCALPOOL; /* no local pool for DL so that we can compare IDs */
}
- if (repo_add_solv_flags(repo, fp, flags))
+ if (repo_add_solv(repo, fp, flags))
{
fclose(fp);
return 0;
cinfo = repo->appdata;
mkdir(SOLVCACHE_PATH, 0755);
/* use dupjoin instead of tmpjoin because tmpl must survive repo_write */
- tmpl = sat_dupjoin(SOLVCACHE_PATH, "/", ".newsolv-XXXXXX");
+ tmpl = solv_dupjoin(SOLVCACHE_PATH, "/", ".newsolv-XXXXXX");
fd = mkstemp(tmpl);
if (fd < 0)
{
onepiece = 0;
if (!info)
- repo_write(repo, fp, repo_write_stdkeyfilter, 0, 0);
+ repo_write(repo, fp);
else if (repoext)
- repodata_write(info, fp, repo_write_stdkeyfilter, 0);
+ repodata_write(info, fp);
else
{
int oldnrepodata = repo->nrepodata;
- repo->nrepodata = 1; /* XXX: do this right */
- repo_write(repo, fp, repo_write_stdkeyfilter, 0, 0);
+ repo->nrepodata = oldnrepodata > 2 ? 2 : oldnrepodata; /* XXX: do this right */
+ repo_write(repo, fp);
repo->nrepodata = oldnrepodata;
onepiece = 0;
}
{
/* main repo */
repo_empty(repo, 1);
- if (repo_add_solv_flags(repo, fp, SOLV_ADD_NO_STUBS))
+ if (repo_add_solv(repo, fp, SOLV_ADD_NO_STUBS))
{
/* oops, no way to recover from here */
fprintf(stderr, "internal error\n");
repodata_extend_block(info, repo->start, repo->end - repo->start);
info->state = REPODATA_LOADING;
/* no need for LOCALPOOL as pool already contains ids */
- repo_add_solv_flags(repo, fp, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES);
+ repo_add_solv(repo, fp, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES);
info->state = REPODATA_AVAILABLE; /* in case the load failed */
}
fclose(fp);
read_sigs()
{
Pool *sigpool = pool_create();
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB_PUBKEY)
Repo *repo = repo_create(sigpool, "rpmdbkeys");
repo_add_rpmdb_pubkeys(repo, 0, 0);
#endif
}
+#ifdef ENABLE_RPMMD
/* repomd helpers */
static inline const char *
struct repoinfo *cinfo;
const unsigned char *filechksum;
Id filechksumtype;
+ int r = 0;
cinfo = repo->appdata;
repomdtype = repodata_lookup_str(data, SOLVID_META, REPOSITORY_REPOMD_TYPE);
if ((fp = curlfopen(cinfo, filename, iscompressed(filename), filechksum, filechksumtype, 0)) == 0)
return 0;
if (!strcmp(ext, "FL"))
- repo_add_rpmmd(repo, fp, ext, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES);
+ r = repo_add_rpmmd(repo, fp, ext, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES);
else if (!strcmp(ext, "DL"))
- repo_add_deltainfoxml(repo, fp, REPO_USE_LOADING);
+ r = repo_add_deltainfoxml(repo, fp, REPO_USE_LOADING);
fclose(fp);
+ if (r)
+ {
+ printf("%s\n", pool_errstr(repo->pool));
+ return 0;
+ }
writecachedrepo(repo, data, ext, cinfo->extcookie);
return 1;
}
+#endif
+
+#ifdef ENABLE_SUSEREPO
/* susetags helpers */
static inline const char *
filechksum = repodata_lookup_bin_checksum(data, SOLVID_META, SUSETAGS_FILE_CHECKSUM, &filechksumtype);
if ((fp = curlfopen(cinfo, pool_tmpjoin(repo->pool, descrdir, "/", filename), iscompressed(filename), filechksum, filechksumtype, 0)) == 0)
return 0;
- repo_add_susetags(repo, fp, defvendor, ext, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES);
+ if (repo_add_susetags(repo, fp, defvendor, ext, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES))
+ {
+ fclose(fp);
+ printf("%s\n", pool_errstr(repo->pool));
+ return 0;
+ }
fclose(fp);
writecachedrepo(repo, data, ext, cinfo->extcookie);
return 1;
}
+#endif
load_stub(Pool *pool, Repodata *data, void *dp)
{
struct repoinfo *cinfo = data->repo->appdata;
- if (cinfo->type == TYPE_SUSETAGS)
- return susetags_load_ext(data->repo, data);
- if (cinfo->type == TYPE_RPMMD)
- return repomd_load_ext(data->repo, data);
- return 0;
+ switch (cinfo->type)
+ {
+#ifdef ENABLE_SUSEREPO
+ case TYPE_SUSETAGS:
+ return susetags_load_ext(data->repo, data);
+#endif
+#ifdef ENABLE_RPMMD
+ case TYPE_RPMMD:
+ return repomd_load_ext(data->repo, data);
+#endif
+ default:
+ return 0;
+ }
}
static unsigned char installedcookie[32];
-#ifdef DEBIAN
+#ifdef ENABLE_DEBIAN
const char *
debian_find_component(struct repoinfo *cinfo, FILE *fp, char *comp, const unsigned char **chksump, Id *chksumtypep)
if (basearch[0] == 'i' && basearch[1] && !strcmp(basearch + 2, "86"))
basearch[1] = '3';
}
- binarydir = sat_dupjoin("binary-", basearch, "/");
+ binarydir = solv_dupjoin("binary-", basearch, "/");
lbinarydir = strlen(binarydir);
compl = strlen(comp);
rewind(fp);
curchksumtype = 0;
filename = 0;
- chksum = sat_malloc(32);
+ chksum = solv_malloc(32);
chksumtype = 0;
while(fgets(buf, sizeof(buf), fp))
{
int curl;
if (filename && !strcmp(bp, "Packages"))
continue;
- curl = sat_chksum_len(curchksumtype);
- if (!curl || (chksumtype && sat_chksum_len(chksumtype) > curl))
+ curl = solv_chksum_len(curchksumtype);
+ if (!curl || (chksumtype && solv_chksum_len(chksumtype) > curl))
continue;
- if (sat_hex2bin(&ch, curchksum, sizeof(curchksum)) != curl)
+ if (solv_hex2bin((const char **)&ch, curchksum, sizeof(curchksum)) != curl)
continue;
- sat_free(filename);
+ solv_free(filename);
filename = strdup(fn);
chksumtype = curchksumtype;
memcpy(chksum, curchksum, curl);
free(binarydir);
if (filename)
{
- fn = sat_dupjoin("/", filename, 0);
- sat_free(filename);
- filename = sat_dupjoin("dists/", cinfo->name, fn);
- sat_free(fn);
+ fn = solv_dupjoin("/", filename, 0);
+ solv_free(filename);
+ filename = solv_dupjoin("dists/", cinfo->name, fn);
+ solv_free(fn);
}
if (!chksumtype)
- chksum = sat_free(chksum);
+ chksum = solv_free(chksum);
*chksump = chksum;
*chksumtypep = chksumtype;
return filename;
const char *filename;
const unsigned char *filechksum;
Id filechksumtype;
+#ifdef ENABLE_SUSEREPO
const char *descrdir;
int defvendor;
+#endif
struct stat stb;
Pool *sigpool = 0;
+#if defined(ENABLE_SUSEREPO) || defined(ENABLE_RPMMD)
Repodata *data;
+#endif
int badchecksum;
int dorefresh;
-#ifdef DEBIAN
+#if defined(ENABLE_DEBIAN)
FILE *fpr;
int j;
#endif
repo = repo_create(pool, "@System");
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
printf("rpm database:");
if (stat("/var/lib/rpm/Packages", &stb))
memset(&stb, 0, sizeof(&stb));
-#else
+#endif
+#if defined(ENABLE_DEBIAN) && defined(DEBIAN)
printf("dpgk database:");
if (stat("/var/lib/dpkg/status", &stb))
memset(&stb, 0, sizeof(&stb));
#endif
+#ifdef NOSYSTEM
+ printf("no installed database:");
+ memset(&stb, 0, sizeof(&stb));
+#endif
calc_checksum_stat(&stb, REPOKEY_TYPE_SHA256, installedcookie);
if (usecachedrepo(repo, 0, installedcookie, 0))
printf(" cached\n");
else
{
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
FILE *ofp;
int done = 0;
#endif
printf(" reading\n");
-#ifdef PRODUCTS_PATH
- repo_add_products(repo, PRODUCTS_PATH, 0, REPO_NO_INTERNALIZE);
-#endif
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
+# if defined(ENABLE_SUSEREPO) && defined(PRODUCTS_PATH)
+ if (repo_add_products(repo, PRODUCTS_PATH, 0, REPO_NO_INTERNALIZE))
+ {
+ fprintf(stderr, "product reading failed: %s\n", pool_errstr(pool));
+ exit(1);
+ }
+# endif
if ((ofp = fopen(calccachepath(repo, 0), "r")) != 0)
{
Repo *ref = repo_create(pool, "@System.old");
- if (!repo_add_solv(ref, ofp))
+ if (!repo_add_solv(ref, ofp, 0))
{
- repo_add_rpmdb(repo, ref, 0, REPO_REUSE_REPODATA);
+ if (repo_add_rpmdb(repo, ref, 0, REPO_REUSE_REPODATA))
+ {
+ fprintf(stderr, "installed db: %s\n", pool_errstr(pool));
+ exit(1);
+ }
done = 1;
}
fclose(ofp);
repo_free(ref, 1);
}
if (!done)
- repo_add_rpmdb(repo, 0, 0, REPO_REUSE_REPODATA);
-#else
- repo_add_debdb(repo, 0, REPO_REUSE_REPODATA);
+ {
+ if (repo_add_rpmdb(repo, 0, 0, REPO_REUSE_REPODATA))
+ {
+ fprintf(stderr, "installed db: %s\n", pool_errstr(pool));
+ exit(1);
+ }
+ }
+#endif
+#if defined(ENABLE_DEBIAN) && defined(DEBIAN)
+ if (repo_add_debdb(repo, 0, REPO_REUSE_REPODATA))
+ {
+ fprintf(stderr, "installed db: %s\n", pool_errstr(pool));
+ exit(1);
+ }
#endif
writecachedrepo(repo, 0, 0, installedcookie);
}
badchecksum = 0;
switch (cinfo->type)
{
+#ifdef ENABLE_RPMMD
case TYPE_RPMMD:
printf("rpmmd repo '%s':", cinfo->alias);
fflush(stdout);
}
fclose(sigfp);
}
- repo_add_repomdxml(repo, fp, 0);
+ if (repo_add_repomdxml(repo, fp, 0))
+ {
+ printf("repomd.xml: %s\n", pool_errstr(pool));
+ fclose(fp);
+ break; /* hopeless */
+ }
fclose(fp);
printf(" fetching\n");
filename = repomd_find(repo, "primary", &filechksum, &filechksumtype);
if (filename && (fp = curlfopen(cinfo, filename, iscompressed(filename), filechksum, filechksumtype, &badchecksum)) != 0)
{
- repo_add_rpmmd(repo, fp, 0, 0);
+ if (repo_add_rpmmd(repo, fp, 0, 0))
+ {
+ printf("primary: %s\n", pool_errstr(pool));
+ badchecksum = 1;
+ }
fclose(fp);
}
if (badchecksum)
filename = repomd_find(repo, "updateinfo", &filechksum, &filechksumtype);
if (filename && (fp = curlfopen(cinfo, filename, iscompressed(filename), filechksum, filechksumtype, &badchecksum)) != 0)
{
- repo_add_updateinfoxml(repo, fp, 0);
+ if (repo_add_updateinfoxml(repo, fp, 0))
+ {
+ printf("updateinfo: %s\n", pool_errstr(pool));
+ badchecksum = 1;
+ }
fclose(fp);
}
writecachedrepo(repo, 0, 0, cinfo->cookie);
repodata_create_stubs(repo_last_repodata(repo));
break;
+#endif
+#ifdef ENABLE_SUSEREPO
case TYPE_SUSETAGS:
printf("susetags repo '%s':", cinfo->alias);
fflush(stdout);
fclose(sigfp);
}
}
- repo_add_content(repo, fp, 0);
+ if (repo_add_content(repo, fp, 0))
+ {
+ printf("content: %s\n", pool_errstr(pool));
+ fclose(fp);
+ break; /* hopeless */
+ }
fclose(fp);
defvendor = repo_lookup_id(repo, SOLVID_META, SUSETAGS_DEFAULTVENDOR);
descrdir = repo_lookup_str(repo, SOLVID_META, SUSETAGS_DESCRDIR);
printf(" fetching\n");
if ((fp = curlfopen(cinfo, pool_tmpjoin(pool, descrdir, "/", filename), iscompressed(filename), filechksum, filechksumtype, &badchecksum)) == 0)
break; /* hopeless */
- repo_add_susetags(repo, fp, defvendor, 0, REPO_NO_INTERNALIZE|SUSETAGS_RECORD_SHARES);
+ if (repo_add_susetags(repo, fp, defvendor, 0, REPO_NO_INTERNALIZE|SUSETAGS_RECORD_SHARES))
+ {
+ printf("packages: %s\n", pool_errstr(pool));
+ fclose(fp);
+ break; /* hopeless */
+ }
fclose(fp);
/* add default language */
filename = susetags_find(repo, "packages.en.gz", &filechksum, &filechksumtype);
{
if ((fp = curlfopen(cinfo, pool_tmpjoin(pool, descrdir, "/", filename), iscompressed(filename), filechksum, filechksumtype, &badchecksum)) != 0)
{
- repo_add_susetags(repo, fp, defvendor, 0, REPO_NO_INTERNALIZE|REPO_REUSE_REPODATA|REPO_EXTEND_SOLVABLES);
+ if (repo_add_susetags(repo, fp, defvendor, 0, REPO_NO_INTERNALIZE|REPO_REUSE_REPODATA|REPO_EXTEND_SOLVABLES))
+ {
+ printf("packages.en: %s\n", pool_errstr(pool));
+ badchecksum = 1;
+ }
+ fclose(fp);
+ }
+ }
+ filename = susetags_find(repo, "patterns", &filechksum, &filechksumtype);
+ if (filename)
+ {
+ if ((fp = curlfopen(cinfo, pool_tmpjoin(pool, descrdir, "/", filename), iscompressed(filename), filechksum, filechksumtype, &badchecksum)) != 0)
+ {
+ char pbuf[256];
+ while (fgets(pbuf, sizeof(pbuf), fp))
+ {
+ int l = strlen(pbuf);
+ FILE *fp2;
+ if (l && pbuf[l - 1] == '\n')
+ pbuf[--l] = 0;
+ if (!*pbuf || *pbuf == '.' || strchr(pbuf, '/') != 0)
+ continue;
+ filename = susetags_find(repo, pbuf, &filechksum, &filechksumtype);
+ if (filename && (fp2 = curlfopen(cinfo, pool_tmpjoin(pool, descrdir, "/", filename), iscompressed(filename), filechksum, filechksumtype, &badchecksum)) != 0)
+ {
+ if (repo_add_susetags(repo, fp2, defvendor, 0, REPO_NO_INTERNALIZE))
+ {
+ printf("%s: %s\n", pbuf, pool_errstr(pool));
+ badchecksum = 1;
+ }
+ fclose(fp2);
+ }
+ }
fclose(fp);
}
}
writecachedrepo(repo, 0, 0, cinfo->cookie);
repodata_create_stubs(repo_last_repodata(repo));
break;
+#endif
-#ifdef DEBIAN
+#if defined(ENABLE_DEBIAN)
case TYPE_DEBIAN:
printf("debian repo '%s':", cinfo->alias);
fflush(stdout);
- filename = sat_dupjoin("dists/", cinfo->name, "/Release");
+ filename = solv_dupjoin("dists/", cinfo->name, "/Release");
if ((fpr = curlfopen(cinfo, filename, 0, 0, 0, 0)) == 0)
{
printf(" no Release file, skipped\n");
free((char *)filename);
break;
}
- sat_free((char *)filename);
+ solv_free((char *)filename);
if (cinfo->repo_gpgcheck)
{
- filename = sat_dupjoin("dists/", cinfo->name, "/Release.gpg");
+ filename = solv_dupjoin("dists/", cinfo->name, "/Release.gpg");
sigfp = curlfopen(cinfo, filename, 0, 0, 0, 0);
- sat_free((char *)filename);
+ solv_free((char *)filename);
if (!sigfp)
{
printf(" unsigned, skipped\n");
}
if ((fp = curlfopen(cinfo, filename, iscompressed(filename), filechksum, filechksumtype, &badchecksum)) != 0)
{
- repo_add_debpackages(repo, fp, 0);
+ if (repo_add_debpackages(repo, fp, 0))
+ {
+ printf("component %s: %s\n", cinfo->components[j], pool_errstr(pool));
+ badchecksum = 1;
+ }
fclose(fp);
}
- sat_free((char *)filechksum);
- sat_free((char *)filename);
+ solv_free((char *)filechksum);
+ solv_free((char *)filename);
}
fclose(fpr);
if (!badchecksum)
if (mq.count)
{
/* here we assume that repo == vendor, so we also set SOLVER_SETVENDOR */
+ Id flags = (job->elements[i] & SOLVER_SETMASK) | SOLVER_SETVENDOR | SOLVER_SETREPO;
+ if ((job->elements[i] & SOLVER_SELECTMASK) == SOLVER_SOLVABLE_NAME)
+ flags |= SOLVER_SETNAME;
if (mq.count == 1)
{
- job->elements[j] = SOLVER_SOLVABLE | (job->elements[i] & SOLVER_SETMASK) | SOLVER_SETVENDOR | SOLVER_SETREPO | SOLVER_NOAUTOSET;
+ job->elements[j] = SOLVER_SOLVABLE | SOLVER_NOAUTOSET | flags;
job->elements[j + 1] = mq.elements[0];
}
else
{
- job->elements[j] = SOLVER_SOLVABLE_ONE_OF | (job->elements[i] & SOLVER_SETMASK) | SOLVER_SETVENDOR | SOLVER_SETREPO;
+ job->elements[j] = SOLVER_SOLVABLE_ONE_OF | flags;
job->elements[j + 1] = pool_queuetowhatprovides(pool, &mq);
}
j += 2;
}
}
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
struct fcstate {
FILE **newpkgsfps;
#endif
-#ifdef DEBIAN
+#if defined(ENABLE_DEBIAN) && defined(DEBIAN)
void
rundpkg(const char *arg, const char *name, int dupfd3)
nscallback(Pool *pool, void *data, Id name, Id evr)
{
if (name == NAMESPACE_PRODUCTBUDDY)
- {
+ {
/* SUSE specific hack: each product has an associated rpm */
- Solvable *s = pool->solvables + evr;
- Id p, pp, cap;
-
+ Solvable *s = pool->solvables + evr;
+ Id p, pp, cap;
+ Id bestp = 0;
+
cap = pool_str2id(pool, pool_tmpjoin(pool, "product(", pool_id2str(pool, s->name) + 8, ")"), 0);
if (!cap)
return 0;
cap = pool_rel2id(pool, cap, s->evr, REL_EQ, 0);
if (!cap)
return 0;
- FOR_PROVIDES(p, pp, cap)
+ FOR_PROVIDES(p, pp, cap)
{
- Solvable *ps = pool->solvables + p;
+ Solvable *ps = pool->solvables + p;
if (ps->repo == s->repo && ps->arch == s->arch)
- break;
+ if (!bestp || pool_evrcmp(pool, pool->solvables[bestp].evr, ps->evr, EVRCMP_COMPARE) < 0)
+ bestp = p;
}
- return p;
+ return bestp;
}
return 0;
}
void
-rewrite_repos(Pool *pool, Id *addedfileprovides)
+rewrite_repos(Pool *pool, Queue *addedfileprovides, Queue *addedfileprovides_inst)
{
Repo *repo;
Repodata *data;
Map providedids;
Queue fileprovidesq;
- Id id;
- int i, j, n, nprovidedids;
+ int i, j, n;
struct repoinfo *cinfo;
map_init(&providedids, pool->ss.nstrings);
queue_init(&fileprovidesq);
- for (nprovidedids = 0; (id = addedfileprovides[nprovidedids]) != 0; nprovidedids++)
- MAPSET(&providedids, id);
+ for (i = 0; i < addedfileprovides->count; i++)
+ MAPSET(&providedids, addedfileprovides->elements[i]);
FOR_REPOS(i, repo)
{
- /* make sure this repo has just one main repodata */
- if (!repo->nrepodata)
- continue;
- cinfo = repo->appdata;
- data = repo->repodata + 0;
- if (data->store.pagefd == -1)
+ /* make sure all repodatas but the first are extensions */
+ if (repo->nrepodata < 2)
continue;
+ data = repo_id2repodata(repo, 1);
+ if (data->loadcallback)
+ continue;
+ for (j = 2; j < repo->nrepodata; j++)
+ {
+ Repodata *edata = repo_id2repodata(repo, j);
+ if (!edata->loadcallback)
+ break;
+ }
+ if (j < repo->nrepodata)
+ continue; /* found a non-externsion repodata, can't rewrite */
if (repodata_lookup_idarray(data, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, &fileprovidesq))
{
+ if (repo == pool->installed && addedfileprovides_inst)
+ {
+ for (j = 0; j < addedfileprovides->count; j++)
+ MAPCLR(&providedids, addedfileprovides->elements[j]);
+ for (j = 0; j < addedfileprovides_inst->count; j++)
+ MAPSET(&providedids, addedfileprovides_inst->elements[j]);
+ }
n = 0;
for (j = 0; j < fileprovidesq.count; j++)
if (MAPTST(&providedids, fileprovidesq.elements[j]))
n++;
- if (n == nprovidedids)
+ if (repo == pool->installed && addedfileprovides_inst)
+ {
+ for (j = 0; j < addedfileprovides_inst->count; j++)
+ MAPCLR(&providedids, addedfileprovides_inst->elements[j]);
+ for (j = 0; j < addedfileprovides->count; j++)
+ MAPSET(&providedids, addedfileprovides->elements[j]);
+ if (n == addedfileprovides_inst->count)
+ continue; /* nothing new added */
+ }
+ else if (n == addedfileprovides->count)
continue; /* nothing new added */
}
- /* oh my! */
- for (j = 0; addedfileprovides[j]; j++)
- repodata_add_idarray(data, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, addedfileprovides[j]);
+ repodata_set_idarray(data, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, repo == pool->installed && addedfileprovides_inst ? addedfileprovides_inst : addedfileprovides);
repodata_internalize(data);
+ cinfo = repo->appdata;
writecachedrepo(repo, data, 0, cinfo ? cinfo->cookie : installedcookie);
}
queue_free(&fileprovidesq);
map_free(&providedids);
}
+static void
+select_patches(Pool *pool, Queue *job)
+{
+ Id p, pp;
+ int pruneyou = 0;
+ Map installedmap, noobsmap;
+ Solvable *s;
+
+ map_init(&noobsmap, 0);
+ map_init(&installedmap, pool->nsolvables);
+ solver_calculate_noobsmap(pool, job, &noobsmap);
+ if (pool->installed)
+ FOR_REPO_SOLVABLES(pool->installed, p, s)
+ MAPSET(&installedmap, p);
+
+ /* install all patches */
+ for (p = 1; p < pool->nsolvables; p++)
+ {
+ const char *type;
+ int r;
+ Id p2;
+
+ s = pool->solvables + p;
+ if (strncmp(pool_id2str(pool, s->name), "patch:", 6) != 0)
+ continue;
+ FOR_PROVIDES(p2, pp, s->name)
+ {
+ Solvable *s2 = pool->solvables + p2;
+ if (s2->name != s->name)
+ continue;
+ r = pool_evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
+ if (r < 0 || (r == 0 && p > p2))
+ break;
+ }
+ if (p2)
+ continue;
+ type = solvable_lookup_str(s, SOLVABLE_PATCHCATEGORY);
+ if (type && !strcmp(type, "optional"))
+ continue;
+ r = solvable_trivial_installable_map(s, &installedmap, 0, &noobsmap);
+ if (r == -1)
+ continue;
+ if (solvable_lookup_bool(s, UPDATE_RESTART) && r == 0)
+ {
+ if (!pruneyou++)
+ queue_empty(job);
+ }
+ else if (pruneyou)
+ continue;
+ queue_push2(job, SOLVER_SOLVABLE, p);
+ }
+ map_free(&installedmap);
+ map_free(&noobsmap);
+}
+
#define MODE_LIST 0
#define MODE_INSTALL 1
#define MODE_ERASE 2
#define MODE_INFO 7
#define MODE_REPOLIST 8
#define MODE_SEARCH 9
-#define MODE_ERASECLEAN 10
void
usage(int r)
char inbuf[128], *ip;
int allpkgs = 0;
FILE **newpkgsfps;
- Id *addedfileprovides = 0;
+ Queue addedfileprovides;
+ Queue addedfileprovides_inst;
Id repofilter = 0;
+ int cleandeps = 0;
argc--;
argv++;
mainmode = MODE_ERASE;
mode = SOLVER_ERASE;
}
- else if (!strcmp(argv[0], "eraseclean") || !strcmp(argv[0], "rmclean"))
- {
- mainmode = MODE_ERASECLEAN;
- mode = SOLVER_ERASE;
- }
else if (!strcmp(argv[0], "list"))
{
mainmode = MODE_LIST;
else
usage(1);
+ if (argc > 1 && !strcmp(argv[1], "--clean"))
+ {
+ cleandeps = 1;
+ argc--;
+ argv++;
+ }
+
pool = pool_create();
#if 0
}
#endif
-#ifdef FEDORA
- pool->obsoleteusescolors = 1;
-#endif
pool_setloadcallback(pool, load_stub, 0);
pool->nscallback = nscallback;
// pool_setdebuglevel(pool, 2);
setarch(pool);
- repoinfos = read_repoinfos(pool, REPOINFO_PATH, &nrepoinfos);
+ repoinfos = read_repoinfos(pool, &nrepoinfos);
if (mainmode == MODE_REPOLIST)
{
{
int l;
l = strlen(argv[i]);
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
if (l <= 4 || strcmp(argv[i] + l - 4, ".rpm"))
continue;
-#else
+#endif
+#if defined(ENABLE_DEBIAN) && defined(DEBIAN)
if (l <= 4 || strcmp(argv[i] + l - 4, ".deb"))
continue;
#endif
exit(1);
}
if (!commandlinepkgs)
- commandlinepkgs = sat_calloc(argc, sizeof(Id));
+ commandlinepkgs = solv_calloc(argc, sizeof(Id));
if (!commandlinerepo)
commandlinerepo = repo_create(pool, "@commandline");
-#ifndef DEBIAN
+ p = 0;
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
p = repo_add_rpm(commandlinerepo, (const char *)argv[i], REPO_REUSE_REPODATA|REPO_NO_INTERNALIZE);
-#else
+#endif
+#if defined(ENABLE_DEBIAN) && defined(DEBIAN)
p = repo_add_deb(commandlinerepo, (const char *)argv[i], REPO_REUSE_REPODATA|REPO_NO_INTERNALIZE);
#endif
+ if (!p)
+ {
+ fprintf(stderr, "could not add '%s'\n", argv[i]);
+ exit(1);
+ }
commandlinepkgs[i] = p;
}
if (commandlinerepo)
// FOR_REPOS(i, repo)
// printf("%s: %d solvables\n", repo->name, repo->nsolvables);
- addedfileprovides = 0;
- pool_addfileprovides_ids(pool, pool->installed, &addedfileprovides);
- if (addedfileprovides && *addedfileprovides)
- rewrite_repos(pool, addedfileprovides);
- sat_free(addedfileprovides);
+ queue_init(&addedfileprovides);
+ queue_init(&addedfileprovides_inst);
+ pool_addfileprovides_queue(pool, &addedfileprovides, &addedfileprovides_inst);
+ if (addedfileprovides.count || addedfileprovides_inst.count)
+ rewrite_repos(pool, &addedfileprovides, &addedfileprovides_inst);
+ queue_free(&addedfileprovides);
+ queue_free(&addedfileprovides_inst);
pool_createwhatprovides(pool);
queue_init(&job);
queue_free(&job);
pool_free(pool);
free_repoinfos(repoinfos, nrepoinfos);
- sat_free(commandlinepkgs);
+ solv_free(commandlinepkgs);
#ifdef FEDORA
yum_substitute(pool, 0);
#endif
}
if (mainmode == MODE_PATCH)
- {
- int pruneyou = 0;
- Map installedmap;
- Solvable *s;
-
- map_init(&installedmap, pool->nsolvables);
- if (pool->installed)
- FOR_REPO_SOLVABLES(pool->installed, p, s)
- MAPSET(&installedmap, p);
-
- /* install all patches */
- for (p = 1; p < pool->nsolvables; p++)
- {
- const char *type;
- int r;
- Id p2;
-
- s = pool->solvables + p;
- if (strncmp(pool_id2str(pool, s->name), "patch:", 6) != 0)
- continue;
- FOR_PROVIDES(p2, pp, s->name)
- {
- Solvable *s2 = pool->solvables + p2;
- if (s2->name != s->name)
- continue;
- r = pool_evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
- if (r < 0 || (r == 0 && p > p2))
- break;
- }
- if (p2)
- continue;
- type = solvable_lookup_str(s, SOLVABLE_PATCHCATEGORY);
- if (type && !strcmp(type, "optional"))
- continue;
- r = solvable_trivial_installable_map(s, &installedmap, 0);
- if (r == -1)
- continue;
- if (solvable_lookup_bool(s, UPDATE_RESTART) && r == 0)
- {
- if (!pruneyou++)
- queue_empty(&job);
- }
- else if (pruneyou)
- continue;
- queue_push2(&job, SOLVER_SOLVABLE, p);
- }
- map_free(&installedmap);
- }
+ select_patches(pool, &job);
// add mode
for (i = 0; i < job.count; i += 2)
if (!p)
{
job.elements[i] |= SOLVER_INSTALL;
+ if (cleandeps)
+ job.elements[i] |= SOLVER_CLEANDEPS;
continue;
}
}
job.elements[i] |= mode;
- if (mainmode == MODE_ERASECLEAN)
+ if (cleandeps)
job.elements[i] |= SOLVER_CLEANDEPS;
}
- if (mainmode == MODE_DISTUPGRADE && allpkgs && repofilter)
- queue_push2(&job, SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_REPO, repofilter);
+ if (mainmode == MODE_DISTUPGRADE && allpkgs)
+ {
+ if (repofilter)
+ queue_push2(&job, SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_REPO, repofilter);
+ else
+ queue_push2(&job, SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL, 0);
+ }
+ if (mainmode == MODE_UPDATE && allpkgs)
+ {
+ if (repofilter)
+ queue_push2(&job, SOLVER_UPDATE|SOLVER_SOLVABLE_REPO, repofilter);
+ else
+ queue_push2(&job, SOLVER_UPDATE|SOLVER_SOLVABLE_ALL, 0);
+ }
+ if (mainmode == MODE_VERIFY && allpkgs)
+ {
+ if (repofilter)
+ queue_push2(&job, SOLVER_VERIFY|SOLVER_SOLVABLE_REPO, repofilter);
+ else
+ queue_push2(&job, SOLVER_VERIFY|SOLVER_SOLVABLE_ALL, 0);
+ }
// multiversion test
// queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, pool_str2id(pool, "kernel-pae", 1));
addsoftlocks(pool, &job);
#endif
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
rerunsolver:
#endif
for (;;)
int pcnt, scnt;
solv = solver_create(pool);
- solv->ignorealreadyrecommended = 1;
- solv->updatesystem = allpkgs && !repofilter && (mainmode == MODE_UPDATE || mainmode == MODE_DISTUPGRADE);
- solv->dosplitprovides = solv->updatesystem;
- solv->fixsystem = allpkgs && !repofilter && mainmode == MODE_VERIFY;
- if (mainmode == MODE_DISTUPGRADE && allpkgs && !repofilter)
- {
- solv->distupgrade = 1;
- solv->allowdowngrade = 1;
- solv->allowarchchange = 1;
- solv->allowvendorchange = 1;
- }
- if (mainmode == MODE_ERASE || mainmode == MODE_ERASECLEAN)
- solv->allowuninstall = 1; /* don't nag */
+ solver_set_flag(solv, SOLVER_FLAG_SPLITPROVIDES, 1);
+ if (mainmode == MODE_ERASE)
+ solver_set_flag(solv, SOLVER_FLAG_ALLOW_UNINSTALL, 1); /* don't nag */
if (!solver_solve(solv, &job))
break;
solv = 0;
}
- trans = &solv->trans;
+ trans = solver_create_transaction(solv);
if (!trans->steps.count)
{
printf("Nothing to do.\n");
+ transaction_free(trans);
solver_free(solv);
queue_free(&job);
pool_free(pool);
free_repoinfos(repoinfos, nrepoinfos);
- sat_free(commandlinepkgs);
+ solv_free(commandlinepkgs);
#ifdef FEDORA
yum_substitute(pool, 0);
#endif
}
printf("\n");
printf("Transaction summary:\n\n");
- solver_printtransaction(solv);
+ transaction_print(trans);
-#if !defined(FEDORA) && !defined(DEBIAN)
+#if defined(SUSE)
if (1)
{
DUChanges duc[4];
if (!yesno("OK to continue (y/n)? "))
{
printf("Abort.\n");
+ transaction_free(trans);
solver_free(solv);
queue_free(&job);
pool_free(pool);
free_repoinfos(repoinfos, nrepoinfos);
- sat_free(commandlinepkgs);
+ solv_free(commandlinepkgs);
#ifdef FEDORA
yum_substitute(pool, 0);
#endif
p = checkq.elements[i];
s = pool_id2solvable(pool, p);
- downloadsize += solvable_lookup_num(s, SOLVABLE_DOWNLOADSIZE, 0);
+ downloadsize += solvable_lookup_sizek(s, SOLVABLE_DOWNLOADSIZE, 0);
}
printf("Downloading %d packages, %d K\n", newpkgs, downloadsize);
- newpkgsfps = sat_calloc(newpkgs, sizeof(*newpkgsfps));
+ newpkgsfps = solv_calloc(newpkgs, sizeof(*newpkgsfps));
for (i = 0; i < newpkgs; i++)
{
unsigned int medianr;
const char *seqnum;
const char *seq;
const char *dloc;
+ const char *archstr;
FILE *fp;
char cmd[128];
int newfd;
+ archstr = pool_id2str(pool, s->arch);
+ if (strlen(archstr) > 10 || strchr(archstr, '\'') != 0)
+ continue;
+
seqname = pool_lookup_str(pool, SOLVID_POS, DELTA_SEQ_NAME);
seqevr = pool_lookup_str(pool, SOLVID_POS, DELTA_SEQ_EVR);
seqnum = pool_lookup_str(pool, SOLVID_POS, DELTA_SEQ_NUM);
seq = pool_tmpjoin(pool, seqname, "-", seqevr);
seq = pool_tmpappend(pool, seq, "-", seqnum);
+ if (strchr(seq, '\'') != 0)
+ continue;
#ifdef FEDORA
- sprintf(cmd, "/usr/bin/applydeltarpm -a %s -c -s ", pool_id2str(pool, s->arch));
+ sprintf(cmd, "/usr/bin/applydeltarpm -a '%s' -c -s '", archstr);
#else
- sprintf(cmd, "/usr/bin/applydeltarpm -c -s ");
+ sprintf(cmd, "/usr/bin/applydeltarpm -c -s '");
#endif
- if (system(pool_tmpjoin(pool, cmd, seq, 0)) != 0)
+ if (system(pool_tmpjoin(pool, cmd, seq, "'")) != 0)
continue; /* didn't match */
/* looks good, download delta */
chksumtype = 0;
/* got it, now reconstruct */
newfd = opentmpfile();
#ifdef FEDORA
- sprintf(cmd, "applydeltarpm -a %s /dev/fd/%d /dev/fd/%d", pool_id2str(pool, s->arch), fileno(fp), newfd);
+ sprintf(cmd, "applydeltarpm -a '%s' /dev/fd/%d /dev/fd/%d", archstr, fileno(fp), newfd);
#else
sprintf(cmd, "applydeltarpm /dev/fd/%d /dev/fd/%d", fileno(fp), newfd);
#endif
}
}
dataiterator_free(&di);
- sat_free(matchname);
+ solv_free(matchname);
}
-
+
if (newpkgsfps[i])
{
putchar('d');
putchar('\n');
}
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
if (newpkgs)
{
Queue conflicts;
for (i = 0; i < newpkgs; i++)
if (newpkgsfps[i])
fclose(newpkgsfps[i]);
- newpkgsfps = sat_free(newpkgsfps);
+ newpkgsfps = solv_free(newpkgsfps);
solver_free(solv);
pool_add_fileconflicts_deps(pool, &conflicts);
pool_createwhatprovides(pool); /* Hmm... */
transaction_order(trans, 0);
for (i = 0; i < trans->steps.count; i++)
{
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
const char *evr, *evrp, *nvra;
#endif
Solvable *s;
{
case SOLVER_TRANSACTION_ERASE:
printf("erase %s\n", pool_solvid2str(pool, p));
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
if (!s->repo->rpmdbid || !s->repo->rpmdbid[p - s->repo->start])
continue;
/* strip epoch from evr */
nvra = pool_tmpjoin(pool, pool_id2str(pool, s->name), "-", evr);
nvra = pool_tmpappend(pool, nvra, ".", pool_id2str(pool, s->arch));
runrpm("-e", nvra, -1); /* too bad that --querybynumber doesn't work */
-#else
+#endif
+#if defined(ENABLE_DEBIAN) && defined(DEBIAN)
rundpkg("--remove", pool_id2str(pool, s->name), 0);
#endif
break;
continue;
rewind(fp);
lseek(fileno(fp), 0, SEEK_SET);
-#ifndef DEBIAN
+#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
runrpm(type == SOLVER_TRANSACTION_MULTIINSTALL ? "-i" : "-U", "/dev/fd/3", fileno(fp));
-#else
+#endif
+#if defined(ENABLE_DEBIAN) && defined(DEBIAN)
rundpkg("--install", "/dev/fd/3", fileno(fp));
#endif
fclose(fp);
for (i = 0; i < newpkgs; i++)
if (newpkgsfps[i])
fclose(newpkgsfps[i]);
- sat_free(newpkgsfps);
+ solv_free(newpkgsfps);
queue_free(&checkq);
+ transaction_free(trans);
solver_free(solv);
queue_free(&job);
pool_free(pool);
free_repoinfos(repoinfos, nrepoinfos);
- sat_free(commandlinepkgs);
+ solv_free(commandlinepkgs);
#ifdef FEDORA
yum_substitute(pool, 0);
#endif