1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

renamed list_is_ptrin() in list_is_in()

This commit is contained in:
Aurelien Foret 2005-04-23 08:28:13 +00:00
parent 4fcec8f03f
commit 348cb923c7
5 changed files with 12 additions and 15 deletions

View File

@ -233,7 +233,7 @@ int alpm_db_update(PM_DB *db, char *archive, char *ts)
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
ASSERT(db != NULL && db != handle->db_local, RET_ERR(PM_ERR_WRONG_ARGS, -1)); ASSERT(db != NULL && db != handle->db_local, RET_ERR(PM_ERR_WRONG_ARGS, -1));
if(!pm_list_is_ptrin(db, handle->dbs_sync)) { if(!pm_list_is_in(db, handle->dbs_sync)) {
RET_ERR(PM_ERR_DB_NOT_FOUND, -1); RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
} }

View File

@ -210,7 +210,7 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
STRNCPY(miss->target, p->name, PKG_NAME_LEN); STRNCPY(miss->target, p->name, PKG_NAME_LEN);
STRNCPY(miss->depend.name, depend.name, PKG_NAME_LEN); STRNCPY(miss->depend.name, depend.name, PKG_NAME_LEN);
STRNCPY(miss->depend.version, depend.version, PKG_VERSION_LEN); STRNCPY(miss->depend.version, depend.version, PKG_VERSION_LEN);
if(!pm_list_is_ptrin(miss, baddeps)) { if(!pm_list_is_in(miss, baddeps)) {
baddeps = pm_list_add(baddeps, miss); baddeps = pm_list_add(baddeps, miss);
} else { } else {
FREE(miss); FREE(miss);
@ -238,7 +238,7 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
miss->depend.version[0] = '\0'; miss->depend.version[0] = '\0';
STRNCPY(miss->target, tp->name, PKG_NAME_LEN); STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
STRNCPY(miss->depend.name, dp->name, PKG_NAME_LEN); STRNCPY(miss->depend.name, dp->name, PKG_NAME_LEN);
if(!pm_list_is_ptrin(miss, baddeps)) { if(!pm_list_is_in(miss, baddeps)) {
baddeps = pm_list_add(baddeps, miss); baddeps = pm_list_add(baddeps, miss);
} else { } else {
FREE(miss); FREE(miss);
@ -255,7 +255,7 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
miss->depend.version[0] = '\0'; miss->depend.version[0] = '\0';
STRNCPY(miss->target, tp->name, PKG_NAME_LEN); STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
STRNCPY(miss->depend.name, a->name, PKG_NAME_LEN); STRNCPY(miss->depend.name, a->name, PKG_NAME_LEN);
if(!pm_list_is_ptrin(miss, baddeps)) { if(!pm_list_is_in(miss, baddeps)) {
baddeps = pm_list_add(baddeps, miss); baddeps = pm_list_add(baddeps, miss);
} else { } else {
FREE(miss); FREE(miss);
@ -274,7 +274,7 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
miss->depend.version[0] = '\0'; miss->depend.version[0] = '\0';
STRNCPY(miss->target, tp->name, PKG_NAME_LEN); STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
STRNCPY(miss->depend.name, info->name, PKG_NAME_LEN); STRNCPY(miss->depend.name, info->name, PKG_NAME_LEN);
if(!pm_list_is_ptrin(miss, baddeps)) { if(!pm_list_is_in(miss, baddeps)) {
baddeps = pm_list_add(baddeps, miss); baddeps = pm_list_add(baddeps, miss);
} else { } else {
FREE(miss); FREE(miss);
@ -415,7 +415,7 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
STRNCPY(miss->target, tp->name, PKG_NAME_LEN); STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
STRNCPY(miss->depend.name, depend.name, PKG_NAME_LEN); STRNCPY(miss->depend.name, depend.name, PKG_NAME_LEN);
STRNCPY(miss->depend.version, depend.version, PKG_VERSION_LEN); STRNCPY(miss->depend.version, depend.version, PKG_VERSION_LEN);
if(!pm_list_is_ptrin(miss, baddeps)) { if(!pm_list_is_in(miss, baddeps)) {
baddeps = pm_list_add(baddeps, miss); baddeps = pm_list_add(baddeps, miss);
} else { } else {
FREE(miss); FREE(miss);
@ -439,7 +439,7 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
miss->depend.version[0] = '\0'; miss->depend.version[0] = '\0';
STRNCPY(miss->target, tp->name, PKG_NAME_LEN); STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
STRNCPY(miss->depend.name, (char *)j->data, PKG_NAME_LEN); STRNCPY(miss->depend.name, (char *)j->data, PKG_NAME_LEN);
if(!pm_list_is_ptrin(miss, baddeps)) { if(!pm_list_is_in(miss, baddeps)) {
baddeps = pm_list_add(baddeps, miss); baddeps = pm_list_add(baddeps, miss);
} else { } else {
FREE(miss); FREE(miss);

View File

@ -217,7 +217,7 @@ int pm_list_count(PMList *list)
return(i); return(i);
} }
int pm_list_is_ptrin(void *needle, PMList *haystack) int pm_list_is_in(void *needle, PMList *haystack)
{ {
PMList *lp; PMList *lp;

View File

@ -52,7 +52,7 @@ PMList *pm_list_add(PMList *list, void *data);
PMList *pm_list_add_sorted(PMList *list, void *data, pm_fn_cmp fn); PMList *pm_list_add_sorted(PMList *list, void *data, pm_fn_cmp fn);
PMList* _alpm_list_remove(PMList* list, PMList* item); PMList* _alpm_list_remove(PMList* list, PMList* item);
int pm_list_count(PMList *list); int pm_list_count(PMList *list);
int pm_list_is_ptrin(void *needle, PMList *haystack); int pm_list_is_in(void *needle, PMList *haystack);
PMList *pm_list_is_strin(char *needle, PMList *haystack); PMList *pm_list_is_strin(char *needle, PMList *haystack);
PMList *pm_list_last(PMList *list); PMList *pm_list_last(PMList *list);
PMList *_alpm_list_reverse(PMList *list); PMList *_alpm_list_reverse(PMList *list);

View File

@ -401,7 +401,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
continue; continue;
} }
/* make sure this package wasn't already removed from the final list */ /* make sure this package wasn't already removed from the final list */
if(pm_list_is_ptrin(miss->target, exfinal)) { if(pm_list_is_in(miss->target, exfinal)) {
continue; continue;
} }
@ -455,7 +455,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
we won't be breaking anything by removing them. we won't be breaking anything by removing them.
If a broken dep is detected, make sure it's not from a If a broken dep is detected, make sure it's not from a
package that's in our final (upgrade) list. */ package that's in our final (upgrade) list. */
_alpm_log(PM_LOG_DEBUG, "checking dependencies of packages designated for removal"); /*_alpm_log(PM_LOG_DEBUG, "checking dependencies of packages designated for removal");*/
return(0); return(0);
@ -547,13 +547,10 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local)
trans_free(tr); trans_free(tr);
/* propagate replaced packages' requiredby fields to their new owners */ /* propagate replaced packages' requiredby fields to their new owners */
/* ORE
won't work because if replaced packages are already removed, the sync(REPLACES)
structures data field will point to unexisting data... */
_alpm_log(PM_LOG_FLOW1, "updating database for replaced packages dependencies"); _alpm_log(PM_LOG_FLOW1, "updating database for replaced packages dependencies");
for(i = trans->packages; i; i = i->next) { for(i = trans->packages; i; i = i->next) {
pmsyncpkg_t *sync = i->data; pmsyncpkg_t *sync = i->data;
if(sync->type == PM_SYNC_TYPE_REPLACE && sync->data) { if(sync->type == PM_SYNC_TYPE_REPLACE) {
PMList *j; PMList *j;
pmpkg_t *new = db_get_pkgfromcache(db_local, sync->pkg->name); pmpkg_t *new = db_get_pkgfromcache(db_local, sync->pkg->name);
for(j = sync->data; j; j = j->next) { for(j = sync->data; j; j = j->next) {