diff --git a/Makefile-rpm-ostree.am b/Makefile-rpm-ostree.am index 8a08ef7d..78821a3e 100644 --- a/Makefile-rpm-ostree.am +++ b/Makefile-rpm-ostree.am @@ -34,8 +34,6 @@ librpmostree_la_SOURCES = \ src/rpmostree-libcontainer.h \ src/rpmostree-console-progress.c \ src/rpmostree-console-progress.h \ - src/hif-utils.c \ - src/hif-utils.h \ src/rpmostree-cleanup.h \ src/rpmostree-treepkgdiff.c \ src/rpmostree-treepkgdiff.h \ diff --git a/src/hif-utils.c b/src/hif-utils.c deleted file mode 100644 index b125e16e..00000000 --- a/src/hif-utils.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Copyright (C) 2013 Richard Hughes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include -#include - -#include "hif-utils.h" - -/** - * hif_rc_to_gerror: - */ -gboolean -hif_rc_to_gerror (gint rc, GError **error) -{ - if (rc == 0) - return TRUE; - switch (rc) { - case HY_E_FAILED: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "general runtime error"); - break; - case HY_E_OP: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "client programming error"); - break; - case HY_E_LIBSOLV: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "error propagated from libsolv"); - break; - case HY_E_IO: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "I/O error"); - break; - case HY_E_CACHE_WRITE: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "cache write error"); - break; - case HY_E_QUERY: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "ill-formed query"); - break; - case HY_E_ARCH: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "unknown arch"); - break; - case HY_E_VALIDATION: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "validation check failed"); - break; - case HY_E_SELECTOR: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "ill-specified selector"); - break; - case HY_E_NO_SOLUTION: - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "goal found no solutions"); - break; - default: - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "no matching error enum %i", rc); - break; - } - return FALSE; -} diff --git a/src/hif-utils.h b/src/hif-utils.h deleted file mode 100644 index 54a1b445..00000000 --- a/src/hif-utils.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Copyright (C) 2013 Richard Hughes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __HIF_UTILS_H -#define __HIF_UTILS_H - -#include -#include -#include - -gboolean hif_rc_to_gerror (gint rc, - GError **error); - -#endif /* __HIF_UTILS_H */ diff --git a/src/rpmostree-cleanup.h b/src/rpmostree-cleanup.h index 41bbe034..81836290 100644 --- a/src/rpmostree-cleanup.h +++ b/src/rpmostree-cleanup.h @@ -29,7 +29,7 @@ #include #include #include -#include "hif-utils.h" +#include "libhif.h" #include "rpmostree-util.h" diff --git a/src/rpmostree-treepkgdiff.c b/src/rpmostree-treepkgdiff.c index f722e7ef..19b57489 100644 --- a/src/rpmostree-treepkgdiff.c +++ b/src/rpmostree-treepkgdiff.c @@ -47,7 +47,7 @@ rpmostree_get_pkglist_for_root (GFile *root, } rc = hy_sack_load_system_repo (sack, NULL, 0); - if (!hif_rc_to_gerror (rc, error)) + if (!hif_error_set_from_hawkey (rc, error)) { g_prefix_error (error, "Failed to load system repo: "); goto out;