Remove provide.c and provide.h .

This file only contained one private function : _alpm_db_whatprovides .
And the public alpm_db_whatprovides was in db.c , so I moved everything there.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: updated POTFILES.in as well]
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Chantry Xavier 2007-11-17 13:06:44 +01:00 committed by Dan McGee
parent d311ad067f
commit c8be7540a5
12 changed files with 29 additions and 100 deletions

View File

@ -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 \

View File

@ -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"

View File

@ -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: */

View File

@ -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);

View File

@ -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)

View File

@ -47,7 +47,6 @@
#include "db.h"
#include "cache.h"
#include "delta.h"
#include "provide.h"
#include "handle.h"
#include "deps.h"

View File

@ -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

View File

@ -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: */

View File

@ -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: */

View File

@ -46,7 +46,6 @@
#include "db.h"
#include "cache.h"
#include "deps.h"
#include "provide.h"
#include "handle.h"
#include "alpm.h"

View File

@ -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"

View File

@ -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