mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
* Fix group comparison issue and associated compilation warnings by using
the alpm strcmp operation which takes void* references. * We had this great visibility patch, but never actually took advantage of it. Added the right compile flag to make it work and added some more SYMEXPORTs where necessary to have a successful compile.
This commit is contained in:
parent
f94506396f
commit
7f7da2b5fc
@ -8,7 +8,7 @@ include_HEADERS = alpm_list.h alpm.h
|
|||||||
localedir = $(datadir)/locale
|
localedir = $(datadir)/locale
|
||||||
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
||||||
|
|
||||||
AM_CFLAGS = -pedantic -D_GNU_SOURCE $(CFLAGS)
|
AM_CFLAGS = -fvisibility=hidden -pedantic -D_GNU_SOURCE $(CFLAGS)
|
||||||
|
|
||||||
EXTRA_DIST = Doxyfile
|
EXTRA_DIST = Doxyfile
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
#include "remove.h"
|
#include "remove.h"
|
||||||
#include "handle.h"
|
#include "handle.h"
|
||||||
|
|
||||||
int SYMHIDDEN _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
|
int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
|
||||||
{
|
{
|
||||||
pmpkg_t *info = NULL;
|
pmpkg_t *info = NULL;
|
||||||
pmpkg_t *dummy;
|
pmpkg_t *dummy;
|
||||||
|
@ -1071,7 +1071,7 @@ int SYMEXPORT alpm_parse_config(char *file, alpm_cb_db_register callback, const
|
|||||||
/* This function is mostly the same as sync.c find_replacements and sysupgrade
|
/* This function is mostly the same as sync.c find_replacements and sysupgrade
|
||||||
* functions, and we should be able to combine them - this is an interim
|
* functions, and we should be able to combine them - this is an interim
|
||||||
* solution made for -Qu operation */
|
* solution made for -Qu operation */
|
||||||
alpm_list_t *alpm_get_upgrades()
|
alpm_list_t SYMEXPORT *alpm_get_upgrades()
|
||||||
{
|
{
|
||||||
alpm_list_t *syncpkgs = NULL;
|
alpm_list_t *syncpkgs = NULL;
|
||||||
alpm_list_t *i, *j, *k, *m;
|
alpm_list_t *i, *j, *k, *m;
|
||||||
|
@ -427,7 +427,7 @@ int SYMEXPORT alpm_list_count(const alpm_list_t *list)
|
|||||||
* @param haystack the list to search
|
* @param haystack the list to search
|
||||||
* @return 1 if `needle` is found, 0 otherwise
|
* @return 1 if `needle` is found, 0 otherwise
|
||||||
*/
|
*/
|
||||||
int alpm_list_find(alpm_list_t *haystack, const void *needle)
|
int SYMEXPORT alpm_list_find(alpm_list_t *haystack, const void *needle)
|
||||||
{
|
{
|
||||||
alpm_list_t *lp = haystack;
|
alpm_list_t *lp = haystack;
|
||||||
while(lp) {
|
while(lp) {
|
||||||
@ -446,7 +446,7 @@ int alpm_list_find(alpm_list_t *haystack, const void *needle)
|
|||||||
* @param haystack the list to search
|
* @param haystack the list to search
|
||||||
* @return 1 if `needle` is found, 0 otherwise
|
* @return 1 if `needle` is found, 0 otherwise
|
||||||
*/
|
*/
|
||||||
int alpm_list_find_str(alpm_list_t *haystack, const char *needle)
|
int SYMEXPORT alpm_list_find_str(alpm_list_t *haystack, const char *needle)
|
||||||
{
|
{
|
||||||
alpm_list_t *lp = haystack;
|
alpm_list_t *lp = haystack;
|
||||||
while(lp) {
|
while(lp) {
|
||||||
|
@ -213,8 +213,8 @@ int _alpm_db_load_grpcache(pmdb_t *db)
|
|||||||
grp->packages = alpm_list_add_sorted(grp->packages,
|
grp->packages = alpm_list_add_sorted(grp->packages,
|
||||||
/* gross signature forces us to
|
/* gross signature forces us to
|
||||||
* discard const */
|
* discard const */
|
||||||
(void *)alpm_pkg_get_name(pkg),
|
(void*)alpm_pkg_get_name(pkg),
|
||||||
strcmp);
|
_alpm_str_cmp);
|
||||||
db->grpcache = alpm_list_add_sorted(db->grpcache, grp, _alpm_grp_cmp);
|
db->grpcache = alpm_list_add_sorted(db->grpcache, grp, _alpm_grp_cmp);
|
||||||
} else {
|
} else {
|
||||||
alpm_list_t *j;
|
alpm_list_t *j;
|
||||||
@ -225,7 +225,9 @@ int _alpm_db_load_grpcache(pmdb_t *db)
|
|||||||
if(strcmp(grp->name, i->data) == 0) {
|
if(strcmp(grp->name, i->data) == 0) {
|
||||||
const char *pkgname = alpm_pkg_get_name(pkg);
|
const char *pkgname = alpm_pkg_get_name(pkg);
|
||||||
if(!alpm_list_find_str(grp->packages, pkgname)) {
|
if(!alpm_list_find_str(grp->packages, pkgname)) {
|
||||||
grp->packages = alpm_list_add_sorted(grp->packages, (void *)pkgname, strcmp);
|
grp->packages = alpm_list_add_sorted(grp->packages,
|
||||||
|
(void*)pkgname,
|
||||||
|
_alpm_str_cmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,7 +424,7 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
|
|||||||
return(baddeps);
|
return(baddeps);
|
||||||
}
|
}
|
||||||
|
|
||||||
pmdepend_t *alpm_splitdep(const char *depstring)
|
pmdepend_t SYMEXPORT *alpm_splitdep(const char *depstring)
|
||||||
{
|
{
|
||||||
pmdepend_t *depend;
|
pmdepend_t *depend;
|
||||||
char *ptr = NULL;
|
char *ptr = NULL;
|
||||||
|
@ -123,7 +123,7 @@ int _alpm_handle_free(pmhandle_t *handle)
|
|||||||
|
|
||||||
alpm_cb_log alpm_option_get_logcb() { return (handle ? handle->logcb : NULL); }
|
alpm_cb_log alpm_option_get_logcb() { return (handle ? handle->logcb : NULL); }
|
||||||
alpm_cb_download alpm_option_get_dlcb() { return (handle ? handle->dlcb : NULL); }
|
alpm_cb_download alpm_option_get_dlcb() { return (handle ? handle->dlcb : NULL); }
|
||||||
unsigned short alpm_option_get_logmask() { return handle->logmask; }
|
unsigned short SYMEXPORT alpm_option_get_logmask() { return handle->logmask; }
|
||||||
const char SYMEXPORT *alpm_option_get_root() { return handle->root; }
|
const char SYMEXPORT *alpm_option_get_root() { return handle->root; }
|
||||||
const char SYMEXPORT *alpm_option_get_dbpath() { return handle->dbpath; }
|
const char SYMEXPORT *alpm_option_get_dbpath() { return handle->dbpath; }
|
||||||
const char SYMEXPORT *alpm_option_get_cachedir() { return handle->cachedir; }
|
const char SYMEXPORT *alpm_option_get_cachedir() { return handle->cachedir; }
|
||||||
@ -139,7 +139,7 @@ unsigned short alpm_option_get_nopassiveftp() { return handle->nopassiveftp; }
|
|||||||
unsigned short SYMEXPORT alpm_option_get_chomp() { return handle->chomp; }
|
unsigned short SYMEXPORT alpm_option_get_chomp() { return handle->chomp; }
|
||||||
unsigned short alpm_option_get_usecolor() { return handle->use_color; }
|
unsigned short alpm_option_get_usecolor() { return handle->use_color; }
|
||||||
|
|
||||||
pmdb_t *alpm_option_get_localdb() { return handle->db_local; }
|
pmdb_t SYMEXPORT *alpm_option_get_localdb() { return handle->db_local; }
|
||||||
alpm_list_t SYMEXPORT *alpm_option_get_syncdbs()
|
alpm_list_t SYMEXPORT *alpm_option_get_syncdbs()
|
||||||
{
|
{
|
||||||
return handle->dbs_sync;
|
return handle->dbs_sync;
|
||||||
@ -151,7 +151,7 @@ void SYMEXPORT alpm_option_set_dlcb(alpm_cb_download cb) { handle->dlcb = cb; }
|
|||||||
|
|
||||||
void SYMEXPORT alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; }
|
void SYMEXPORT alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; }
|
||||||
|
|
||||||
void alpm_option_set_root(const char *root)
|
void SYMEXPORT alpm_option_set_root(const char *root)
|
||||||
{
|
{
|
||||||
if(handle->root) FREE(handle->root);
|
if(handle->root) FREE(handle->root);
|
||||||
/* According to the man page, realpath is safe to use IFF the second arg is
|
/* According to the man page, realpath is safe to use IFF the second arg is
|
||||||
@ -196,7 +196,7 @@ void SYMEXPORT alpm_option_set_dbpath(const char *dbpath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void alpm_option_set_cachedir(const char *cachedir)
|
void SYMEXPORT alpm_option_set_cachedir(const char *cachedir)
|
||||||
{
|
{
|
||||||
if(handle->cachedir) FREE(handle->cachedir);
|
if(handle->cachedir) FREE(handle->cachedir);
|
||||||
if(cachedir) {
|
if(cachedir) {
|
||||||
|
@ -247,7 +247,7 @@ int _alpm_versioncmp(const char *a, const char *b)
|
|||||||
return(*one ? 1 : -1);
|
return(*one ? 1 : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
|
int SYMEXPORT alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
|
||||||
{
|
{
|
||||||
int equal = 0;
|
int equal = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user