libopkg: expose abstract_pkg_fetch_by_name()
authorJo-Philipp Wich <jo@mein.io>
Wed, 15 Feb 2017 23:01:58 +0000 (00:01 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Feb 2017 16:02:30 +0000 (17:02 +0100)
We need this function in other places later in order to be able to fetch
abstract packages without implicitely creating them.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/pkg_hash.c
libopkg/pkg_hash.h

index f5c049507848e31748624079e69e7522ceb9abb8..821cc71886e735e7f70a0446b73e4e8f8416e848 100644 (file)
@@ -221,11 +221,6 @@ int pkg_hash_load_status_files(void)
        return 0;
 }
 
-static abstract_pkg_t *abstract_pkg_fetch_by_name(const char *pkg_name)
-{
-       return (abstract_pkg_t *) hash_table_get(&conf->pkg_hash, pkg_name);
-}
-
 pkg_t *pkg_hash_fetch_best_installation_candidate(abstract_pkg_t * apkg,
                                                  int (*constraint_fcn) (pkg_t *
                                                                         pkg,
index d87927832229952b4f10e84c58fe7b39f7b2c0e3..e72ffed88460a5c58d8af79a0e29258b4e88f52b 100644 (file)
@@ -36,6 +36,11 @@ int pkg_hash_load_status_files(void);
 
 void hash_insert_pkg(pkg_t * pkg, int set_status);
 
+static inline abstract_pkg_t *abstract_pkg_fetch_by_name(const char *pkg_name)
+{
+   return (abstract_pkg_t *) hash_table_get(&conf->pkg_hash, pkg_name);
+}
+
 abstract_pkg_t *ensure_abstract_pkg_by_name(const char *pkg_name);
 void pkg_hash_fetch_all_installed(pkg_vec_t * installed);
 pkg_t *pkg_hash_fetch_by_name_version(const char *pkg_name,