From 16e18313da1b8e85141fbaf8f376305aa48d5330 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 28 Nov 2012 17:35:03 +0100 Subject: [PATCH] xbps_transaction: return proper errors if pkg is missing from repos. --- lib/transaction_ops.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/transaction_ops.c b/lib/transaction_ops.c index 64d378a..109a070 100644 --- lib/transaction_ops.c +++ lib/transaction_ops.c @@ -78,14 +78,14 @@ trans_find_pkg(struct xbps_handle *xhp, const char *pkg, bool bypattern, pkg_repod = xbps_rpool_find_pkg_exact(xhp, pkg); if (pkg_repod == NULL) { /* not found */ - return errno; + return ENOENT; } } else { if (((pkg_repod = xbps_rpool_find_pkg(xhp, pkg, bypattern, best)) == NULL) && ((pkg_repod = xbps_rpool_find_virtualpkg_conf(xhp, pkg, bypattern)) == NULL) && ((pkg_repod = xbps_rpool_find_virtualpkg(xhp, pkg, bypattern)) == NULL)) { /* not found */ - return errno; + return ENOENT; } } } else { @@ -96,7 +96,7 @@ trans_find_pkg(struct xbps_handle *xhp, const char *pkg, bool bypattern, pkg_repod = xbps_rpool_find_pkg(xhp, pkg, false, true); if (pkg_repod == NULL) { /* not found */ - return errno; + return ENOENT; } } prop_dictionary_get_cstring_nocopy(pkg_repod, "pkgname", &pkgname); @@ -181,12 +181,12 @@ trans_find_pkg(struct xbps_handle *xhp, const char *pkg, bool bypattern, * the "unsorted" array in transaction dictionary. */ if (!prop_array_add(unsorted, pkg_repod)) - return errno; + return EINVAL; xbps_dbg_printf(xhp, "%s-%s: added into the transaction (%s).\n", pkgname, repover, repoloc); - return rv; + return 0; } int -- 1.8.0.1