Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=9c065f04f6144553de69aa897e8e086a7b8ac1cb
commit 9c065f04f6144553de69aa897e8e086a7b8ac1cb Author: Michel Hermier <[email protected]> Date: Thu Oct 31 09:18:07 2013 +0100 libpacman: Move _pacman_db_whatprovides in db.c, and remove now empty provide.c/.h. diff --git a/lib/libpacman/Makefile.am b/lib/libpacman/Makefile.am index 75529d8..6c4dbca 100644 --- a/lib/libpacman/Makefile.am +++ b/lib/libpacman/Makefile.am @@ -27,7 +27,6 @@ TARGETS = \ cache.c \ conflict.c \ deps.c \ - provide.c \ versioncmp.c \ backup.c \ packages_transaction.c \ diff --git a/lib/libpacman/add.c b/lib/libpacman/add.c index 8831dd4..ce0b320 100644 --- a/lib/libpacman/add.c +++ b/lib/libpacman/add.c @@ -55,7 +55,6 @@ #include "backup.h" #include "package.h" #include "db.h" -#include "provide.h" #include "conflict.h" #include "remove.h" #include "handle.h" diff --git a/lib/libpacman/cache.c b/lib/libpacman/cache.c index e4d9d37..c06447c 100644 --- a/lib/libpacman/cache.c +++ b/lib/libpacman/cache.c @@ -153,6 +153,28 @@ pmpkg_t *_pacman_db_get_pkgfromcache(pmdb_t *db, const char *target) return(_pacman_pkg_isin(target, _pacman_db_get_pkgcache(db))); } +/* return a pmlist_t of packages in "db" that provide "package" + */ +pmlist_t *_pacman_db_whatprovides(pmdb_t *db, char *package) +{ + pmlist_t *pkgs = NULL; + pmlist_t *lp; + + if(db == NULL || _pacman_strempty(package)) { + return(NULL); + } + + for(lp = _pacman_db_get_pkgcache(db); lp; lp = lp->next) { + pmpkg_t *info = lp->data; + + if(_pacman_list_is_strin(package, _pacman_pkg_getinfo(info, PM_PKG_PROVIDES))) { + pkgs = _pacman_list_add(pkgs, info); + } + } + + return(pkgs); +} + /* Returns a new group cache from db. */ int _pacman_db_load_grpcache(pmdb_t *db) diff --git a/lib/libpacman/cache.h b/lib/libpacman/cache.h index d0a93a5..d8c8946 100644 --- a/lib/libpacman/cache.h +++ b/lib/libpacman/cache.h @@ -33,6 +33,7 @@ int _pacman_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg); int _pacman_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg); pmlist_t *_pacman_db_get_pkgcache(pmdb_t *db); pmpkg_t *_pacman_db_get_pkgfromcache(pmdb_t *db, const char *target); +pmlist_t *_pacman_db_whatprovides(pmdb_t *db, char *package); /* groups */ int _pacman_db_load_grpcache(pmdb_t *db); void _pacman_db_free_grpcache(pmdb_t *db); diff --git a/lib/libpacman/deps.c b/lib/libpacman/deps.c index a04ce23..0e61118 100644 --- a/lib/libpacman/deps.c +++ b/lib/libpacman/deps.c @@ -40,7 +40,6 @@ #include "package.h" #include "db.h" #include "cache.h" -#include "provide.h" #include "versioncmp.h" #include "handle.h" diff --git a/lib/libpacman/pacman.c b/lib/libpacman/pacman.c index 68f8198..553e337 100644 --- a/lib/libpacman/pacman.c +++ b/lib/libpacman/pacman.c @@ -58,9 +58,7 @@ #include "remove.h" #include "sync.h" #include "handle.h" -#include "provide.h" #include "server.h" -#include "pacman.h" #define min(X, Y) ((X) < (Y) ? (X) : (Y)) diff --git a/lib/libpacman/provide.c b/lib/libpacman/provide.c deleted file mode 100644 index 2f5e478..0000000 --- a/lib/libpacman/provide.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * provide.c - * - * Copyright (c) 2002-2006 by Judd Vinet <[email protected]> - * Copyright (c) 2007 by Miklos Vajna <[email protected]> - * - * 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> - -/* pacman-g2 */ -#include "provide.h" - -#include "cache.h" -#include "list.h" -#include "db.h" -#include "util.h" - -/* return a pmlist_t of packages in "db" that provide "package" - */ -pmlist_t *_pacman_db_whatprovides(pmdb_t *db, char *package) -{ - pmlist_t *pkgs = NULL; - pmlist_t *lp; - - if(db == NULL || _pacman_strempty(package)) { - return(NULL); - } - - for(lp = _pacman_db_get_pkgcache(db); lp; lp = lp->next) { - pmpkg_t *info = lp->data; - - if(_pacman_list_is_strin(package, _pacman_pkg_getinfo(info, PM_PKG_PROVIDES))) { - pkgs = _pacman_list_add(pkgs, info); - } - } - - return(pkgs); -} - -/* vim: set ts=2 sw=2 noet: */ diff --git a/lib/libpacman/provide.h b/lib/libpacman/provide.h deleted file mode 100644 index 061e79d..0000000 --- a/lib/libpacman/provide.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * provide.h - * - * Copyright (c) 2002-2006 by Judd Vinet <[email protected]> - * - * 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 _PACMAN_PROVIDE_H -#define _PACMAN_PROVIDE_H - -#include "config.h" - -#include "list.h" -#include "db.h" - -pmlist_t *_pacman_db_whatprovides(pmdb_t *db, char *package); - -#endif /* _PACMAN_PROVIDE_H */ - -/* vim: set ts=2 sw=2 noet: */ diff --git a/lib/libpacman/remove.c b/lib/libpacman/remove.c index 58e51ce..9aa65ff 100644 --- a/lib/libpacman/remove.c +++ b/lib/libpacman/remove.c @@ -54,7 +54,6 @@ #include "package.h" #include "db.h" #include "cache.h" -#include "provide.h" #include "handle.h" #include "pacman.h" #include "packages_transaction.h" diff --git a/lib/libpacman/sync.c b/lib/libpacman/sync.c index 514fa11..a8c6ff6 100644 --- a/lib/libpacman/sync.c +++ b/lib/libpacman/sync.c @@ -47,7 +47,6 @@ #include "cache.h" #include "deps.h" #include "conflict.h" -#include "provide.h" #include "trans.h" #include "util.h" #include "sync.h" diff --git a/lib/libpacman/trans_sysupgrade.c b/lib/libpacman/trans_sysupgrade.c index 768b01c..4fc3aec 100644 --- a/lib/libpacman/trans_sysupgrade.c +++ b/lib/libpacman/trans_sysupgrade.c @@ -46,7 +46,6 @@ #include "cache.h" #include "deps.h" #include "conflict.h" -#include "provide.h" #include "trans.h" #include "util.h" #include "sync.h" _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
