From: Michael Schroeder Date: Mon, 16 Apr 2012 16:46:41 +0000 (+0200) Subject: - use pool_error instead of pool_debug in repo_add_arch_pkg X-Git-Tag: BASE-SuSE-Code-12_2-Branch~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=110d964b72381c40af080db682e322e33b5bedb5;p=platform%2Fupstream%2Flibsolv.git - use pool_error instead of pool_debug in repo_add_arch_pkg --- diff --git a/ext/repo_arch.c b/ext/repo_arch.c index 0a9089e..dfa2ac8 100644 --- a/ext/repo_arch.c +++ b/ext/repo_arch.c @@ -344,18 +344,18 @@ repo_add_arch_pkg(Repo *repo, const char *fn, int flags) data = repo_add_repodata(repo, flags); if ((fd = open(fn, O_RDONLY, 0)) < 0) { - pool_debug(pool, SOLV_ERROR, "repo_add_arch_pkg: %s: %s\n", fn, strerror(errno)); + pool_error(pool, -1, "%s: %s", fn, strerror(errno)); return 0; } if (fstat(fd, &stb)) { - pool_debug(pool, SOLV_ERROR, "repo_add_arch_pkg: %s: fstat failed\n", fn); + pool_error(pool, -1, "%s: fstat: %s", fn, strerror(errno)); close(fd); return 0; } if (!(fp = solv_xfopen_fd(fn, fd, "r"))) { - pool_debug(pool, SOLV_ERROR, "repo_add_arch_pkg: %s: fdopen failed\n", fn); + pool_error(pool, -1, "%s: fdopen failed", fn); close(fd); return 0; } @@ -435,8 +435,16 @@ repo_add_arch_pkg(Repo *repo, const char *fn, int flags) } freetarhead(&th); fclose(fp); + if (!s) + { + pool_error(pool, -1, "%s: not an arch package", fn); + if (pkgidhandle) + solv_chksum_free(pkgidhandle, 0); + return 0; + } if (s && !s->name) { + pool_error(pool, -1, "%s: package has no name", fn); repo_free_solvable(repo, s - pool->solvables, 1); s = 0; }