index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Chantry Xavier <shiningxc@gmail.com> | 2007-11-17 13:06:44 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-11-17 09:50:05 -0600 |
commit | c8be7540a50583194e971918099006a1736cfab7 (patch) | |
tree | f60c90adfe74a3a30535f0252880fa36b2d6264b /lib/libalpm | |
parent | d311ad067f47608252b9276df90087db98b1100f (diff) |
-rw-r--r-- | lib/libalpm/Makefile.am | 1 | ||||
-rw-r--r-- | lib/libalpm/add.c | 1 | ||||
-rw-r--r-- | lib/libalpm/db.c | 25 | ||||
-rw-r--r-- | lib/libalpm/db.h | 3 | ||||
-rw-r--r-- | lib/libalpm/deps.c | 1 | ||||
-rw-r--r-- | lib/libalpm/package.c | 1 | ||||
-rw-r--r-- | lib/libalpm/po/POTFILES.in | 4 | ||||
-rw-r--r-- | lib/libalpm/provide.c | 58 | ||||
-rw-r--r-- | lib/libalpm/provide.h | 32 | ||||
-rw-r--r-- | lib/libalpm/remove.c | 1 | ||||
-rw-r--r-- | lib/libalpm/sync.c | 1 | ||||
-rw-r--r-- | lib/libalpm/trans.c | 1 |
diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am index b84dcc33..6549066f 100644 --- a/lib/libalpm/Makefile.am +++ b/lib/libalpm/Makefile.am @@ -33,7 +33,6 @@ libalpm_la_SOURCES = \ log.h log.c \ md5.h md5.c \ package.h package.c \ - provide.h provide.c \ remove.h remove.c \ server.h server.c \ sync.h sync.c \ diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index a85c4d82..f6bab199 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -45,7 +45,6 @@ #include "backup.h" #include "package.h" #include "db.h" -#include "provide.h" #include "conflict.h" #include "deps.h" #include "remove.h" diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index f7621338..1e2e6b24 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -43,7 +43,6 @@ #include "util.h" #include "error.h" #include "server.h" -#include "provide.h" #include "handle.h" #include "cache.h" #include "alpm.h" @@ -780,4 +779,28 @@ pmdb_t *_alpm_db_register_sync(const char *treename) return(db); } +/* return a alpm_list_t of packages in "db" that provide "package" + */ +alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package) +{ + alpm_list_t *pkgs = NULL; + alpm_list_t *lp; + + ALPM_LOG_FUNC; + + if(db == NULL || package == NULL || strlen(package) == 0) { + return(NULL); + } + + for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) { + pmpkg_t *info = lp->data; + + if(alpm_list_find_str(alpm_pkg_get_provides(info), package)) { + pkgs = alpm_list_add(pkgs, info); + } + } + + return(pkgs); +} + /* vim: set ts=2 sw=2 noet: */ diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 4c559866..3d952126 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -57,6 +57,9 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles); pmdb_t *_alpm_db_register_local(void); pmdb_t *_alpm_db_register_sync(const char *treename); +/* Provision */ +alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package); + /* be.c, backend specific calls */ int _alpm_db_install(pmdb_t *db, const char *dbfile); int _alpm_db_open(pmdb_t *db); diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index aed8b253..4d3dbe98 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -36,7 +36,6 @@ #include "package.h" #include "db.h" #include "cache.h" -#include "provide.h" #include "handle.h" static pmgraph_t *_alpm_graph_new(void) diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index f96b7914..18d04e00 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -47,7 +47,6 @@ #include "db.h" #include "cache.h" #include "delta.h" -#include "provide.h" #include "handle.h" #include "deps.h" diff --git a/lib/libalpm/po/POTFILES.in b/lib/libalpm/po/POTFILES.in index 97df339e..80130f24 100644 --- a/lib/libalpm/po/POTFILES.in +++ b/lib/libalpm/po/POTFILES.in @@ -8,16 +8,16 @@ lib/libalpm/be_files.c lib/libalpm/cache.c lib/libalpm/conflict.c lib/libalpm/db.c -lib/libalpm/deps.c lib/libalpm/delta.c +lib/libalpm/deps.c lib/libalpm/error.c lib/libalpm/group.c lib/libalpm/handle.c lib/libalpm/log.c lib/libalpm/md5.c lib/libalpm/package.c -lib/libalpm/provide.c lib/libalpm/remove.c +lib/libalpm/server.c lib/libalpm/sync.c lib/libalpm/trans.c lib/libalpm/util.c diff --git a/lib/libalpm/provide.c b/lib/libalpm/provide.c deleted file mode 100644 index a580ec54..00000000 --- a/lib/libalpm/provide.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * provide.c - * - * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -#include "config.h" - -#include <stdlib.h> -#include <string.h> - -/* libalpm */ -#include "provide.h" -#include "alpm_list.h" -#include "cache.h" -#include "db.h" -#include "log.h" - -/* return a alpm_list_t of packages in "db" that provide "package" - */ -alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package) -{ - alpm_list_t *pkgs = NULL; - alpm_list_t *lp; - - ALPM_LOG_FUNC; - - if(db == NULL || package == NULL || strlen(package) == 0) { - return(NULL); - } - - for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) { - pmpkg_t *info = lp->data; - - if(alpm_list_find_str(alpm_pkg_get_provides(info), package)) { - pkgs = alpm_list_add(pkgs, info); - } - } - - return(pkgs); -} - -/* vim: set ts=2 sw=2 noet: */ diff --git a/lib/libalpm/provide.h b/lib/libalpm/provide.h deleted file mode 100644 index 3142ff12..00000000 --- a/lib/libalpm/provide.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * provide.h - * - * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ -#ifndef _ALPM_PROVIDE_H -#define _ALPM_PROVIDE_H - -#include "db.h" -#include "alpm_list.h" -#include "config.h" - -alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package); - -#endif /* _ALPM_PROVIDE_H */ - -/* vim: set ts=2 sw=2 noet: */ diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 50763578..018216fe 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -46,7 +46,6 @@ #include "db.h" #include "cache.h" #include "deps.h" -#include "provide.h" #include "handle.h" #include "alpm.h" diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 40dcffa9..44f06f14 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -42,7 +42,6 @@ #include "cache.h" #include "deps.h" #include "conflict.h" -#include "provide.h" #include "trans.h" #include "util.h" #include "handle.h" diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 66a9ce33..7e3cb60e 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -48,7 +48,6 @@ #include "alpm.h" #include "deps.h" #include "cache.h" -#include "provide.h" /** \addtogroup alpm_trans Transaction Functions * @brief Functions to manipulate libalpm transactions |