Date: Wednesday, February 21, 2007 @ 03:34:37 Author: dan Path: /home/cvs-pacman/pacman-lib Modified: TODO.dan (1.13 -> 1.14) lib/libalpm/be_files.c (1.28 -> 1.29) lib/libalpm/cache.c (1.31 -> 1.32) lib/libalpm/db.h (1.24 -> 1.25) lib/libalpm/deps.c (1.68 -> 1.69) lib/libalpm/package.c (1.72 -> 1.73) lib/libalpm/trans.c (1.36 -> 1.37) * Fixed inconsistency of args- _alpm_db_read, _alpm_db_write. ------------------------+ TODO.dan | 2 - lib/libalpm/be_files.c | 6 ++--- lib/libalpm/cache.c | 2 - lib/libalpm/db.h | 2 - lib/libalpm/deps.c | 12 +++++------ lib/libalpm/package.c | 48 +++++++++++++++++++++++------------------------ lib/libalpm/trans.c | 4 +-- 7 files changed, 37 insertions(+), 39 deletions(-) Index: pacman-lib/TODO.dan diff -u pacman-lib/TODO.dan:1.13 pacman-lib/TODO.dan:1.14 --- pacman-lib/TODO.dan:1.13 Wed Feb 21 03:16:26 2007 +++ pacman-lib/TODO.dan Wed Feb 21 03:34:36 2007 @@ -112,8 +112,6 @@ Add localized pkgdesc variables to makepkg. -Fix inconsistency of args- _alpm_db_read, _alpm_db_write - --print-uri option to sync should not require saying yes or no to up to date Add testing scripts to pactest for issues we have been working on (especially Index: pacman-lib/lib/libalpm/be_files.c diff -u pacman-lib/lib/libalpm/be_files.c:1.28 pacman-lib/lib/libalpm/be_files.c:1.29 --- pacman-lib/lib/libalpm/be_files.c:1.28 Wed Feb 21 01:44:14 2007 +++ pacman-lib/lib/libalpm/be_files.c Wed Feb 21 03:34:36 2007 @@ -183,7 +183,7 @@ _alpm_log(PM_LOG_ERROR, _("invalid name for dabatase entry '%s'"), ent->d_name); return(NULL); } - if(_alpm_db_read(db, inforeq, pkg) == -1) { + if(_alpm_db_read(db, pkg, inforeq) == -1) { /* TODO removed corrupt entry from the FS here */ FREEPKG(pkg); } @@ -193,7 +193,7 @@ return(pkg); } -int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info) +int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) { FILE *fp = NULL; struct stat buf; @@ -471,7 +471,7 @@ return(-1); } -int _alpm_db_write(pmdb_t *db, pmpkg_t *info, unsigned int inforeq) +int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) { FILE *fp = NULL; char path[PATH_MAX]; Index: pacman-lib/lib/libalpm/cache.c diff -u pacman-lib/lib/libalpm/cache.c:1.31 pacman-lib/lib/libalpm/cache.c:1.32 --- pacman-lib/lib/libalpm/cache.c:1.31 Wed Feb 21 01:44:14 2007 +++ pacman-lib/lib/libalpm/cache.c Wed Feb 21 03:34:36 2007 @@ -124,7 +124,7 @@ for(p = db->pkgcache; p; p = p->next) { pmpkg_t *pkg = (pmpkg_t *)p->data; if(infolevel != INFRQ_NONE && !(pkg->infolevel & infolevel)) { - if(_alpm_db_read(db, infolevel, pkg) == -1) { + if(_alpm_db_read(db, pkg, infolevel) == -1) { /* TODO should we actually remove from the filesystem here as well? */ _alpm_db_remove_pkgfromcache(db, pkg); } else { Index: pacman-lib/lib/libalpm/db.h diff -u pacman-lib/lib/libalpm/db.h:1.24 pacman-lib/lib/libalpm/db.h:1.25 --- pacman-lib/lib/libalpm/db.h:1.24 Tue Jan 30 21:58:12 2007 +++ pacman-lib/lib/libalpm/db.h Wed Feb 21 03:34:36 2007 @@ -59,7 +59,7 @@ void _alpm_db_close(pmdb_t *db); void _alpm_db_rewind(pmdb_t *db); pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, pmdbinfrq_t inforeq); -int _alpm_db_read(pmdb_t *db, pmdbinfrq_t inforeq, pmpkg_t *info); +int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq); int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq); int _alpm_db_remove(pmdb_t *db, pmpkg_t *info); int _alpm_db_getlastupdate(pmdb_t *db, char *ts); Index: pacman-lib/lib/libalpm/deps.c diff -u pacman-lib/lib/libalpm/deps.c:1.68 pacman-lib/lib/libalpm/deps.c:1.69 --- pacman-lib/lib/libalpm/deps.c:1.68 Tue Feb 20 03:44:32 2007 +++ pacman-lib/lib/libalpm/deps.c Wed Feb 21 03:34:36 2007 @@ -223,7 +223,7 @@ _alpm_log(PM_LOG_DEBUG, _("cannot find package installed '%s'"), tp->name); continue; } - _alpm_db_read(db, INFRQ_DEPENDS, oldpkg); + _alpm_db_read(db, oldpkg, INFRQ_DEPENDS); for(j = oldpkg->requiredby; j; j = j->next) { pmpkg_t *p; found = 0; @@ -235,7 +235,7 @@ /* this package also in the upgrade list, so don't worry about it */ continue; } - _alpm_db_read(db, INFRQ_DEPENDS, p); + _alpm_db_read(db, p, INFRQ_DEPENDS); for(k = p->depends; k && !found; k = k->next) { /* find the dependency info in p->depends */ _alpm_splitdep(k->data, &depend); @@ -278,7 +278,7 @@ /* ensure package has depends data */ pmdb_t *pkgdb = tp->data; - _alpm_db_read(pkgdb, INFRQ_DEPENDS, tp); + _alpm_db_read(pkgdb, tp, INFRQ_DEPENDS); if(!tp->depends) { _alpm_log(PM_LOG_DEBUG, _("no dependencies for target '%s'"), tp->name); } @@ -503,7 +503,7 @@ pmpkg_t *provpkg = k->data; if(can_remove_package(db, provpkg, newtargs)) { pmpkg_t *pkg = _alpm_pkg_new(provpkg->name, provpkg->version); - _alpm_db_read(db, INFRQ_ALL, pkg); + _alpm_db_read(db, pkg, INFRQ_ALL); _alpm_log(PM_LOG_DEBUG, _("adding '%s' to the targets"), pkg->name); @@ -515,7 +515,7 @@ FREELISTPTR(provides); } else if(can_remove_package(db, dep, newtargs)) { pmpkg_t *pkg = _alpm_pkg_new(dep->name, dep->version); - _alpm_db_read(db, INFRQ_ALL, pkg); + _alpm_db_read(db, pkg, INFRQ_ALL); _alpm_log(PM_LOG_DEBUG, _("adding '%s' to the targets"), pkg->name); @@ -579,7 +579,7 @@ /* check literals */ for(j = dbs_sync; !sync && j; j = j->next) { sync = _alpm_db_get_pkgfromcache(j->data, miss->depend.name); - _alpm_db_read(j->data, INFRQ_DEPENDS, sync); + _alpm_db_read(j->data, sync, INFRQ_DEPENDS); } /* check provides */ for(j = dbs_sync; !sync && j; j = j->next) { Index: pacman-lib/lib/libalpm/package.c diff -u pacman-lib/lib/libalpm/package.c:1.72 pacman-lib/lib/libalpm/package.c:1.73 --- pacman-lib/lib/libalpm/package.c:1.72 Sun Feb 18 17:07:11 2007 +++ pacman-lib/lib/libalpm/package.c Wed Feb 21 03:34:37 2007 @@ -137,7 +137,7 @@ if(pkg->origin == PKG_FROM_CACHE) { /* ensure we have the /desc file, which contains the 'force' option */ - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } /* compare versions and see if we need to upgrade */ @@ -598,7 +598,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->desc; } @@ -612,7 +612,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->url; } @@ -626,7 +626,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->builddate; } @@ -638,7 +638,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->buildtype; } @@ -652,7 +652,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->installdate; } @@ -666,7 +666,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->packager; } @@ -680,7 +680,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->md5sum; } @@ -694,7 +694,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->sha1sum; } @@ -708,7 +708,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->arch; } @@ -722,7 +722,7 @@ ASSERT(pkg != NULL, return(-1)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->size; } @@ -736,7 +736,7 @@ ASSERT(pkg != NULL, return(-1)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->isize; } @@ -750,7 +750,7 @@ ASSERT(pkg != NULL, return(-1)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->reason; } @@ -764,7 +764,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->license; } @@ -778,7 +778,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->data, INFRQ_DESC, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } return pkg->groups; } @@ -793,7 +793,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DEPENDS)) { - _alpm_db_read(pkg->data, INFRQ_DEPENDS, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DEPENDS); } return pkg->depends; } @@ -807,7 +807,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DEPENDS)) { - _alpm_db_read(pkg->data, INFRQ_DEPENDS, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DEPENDS); } return pkg->removes; } @@ -821,7 +821,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DEPENDS)) { - _alpm_db_read(pkg->data, INFRQ_DEPENDS, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DEPENDS); } return pkg->requiredby; } @@ -835,7 +835,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DEPENDS)) { - _alpm_db_read(pkg->data, INFRQ_DEPENDS, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DEPENDS); } return pkg->conflicts; } @@ -849,7 +849,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DEPENDS)) { - _alpm_db_read(pkg->data, INFRQ_DEPENDS, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DEPENDS); } return pkg->provides; } @@ -863,7 +863,7 @@ ASSERT(pkg != NULL, return(NULL)); if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DEPENDS)) { - _alpm_db_read(pkg->data, INFRQ_DEPENDS, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_DEPENDS); } return pkg->replaces; } @@ -878,7 +878,7 @@ if(pkg->origin == PKG_FROM_CACHE && pkg->data == handle->db_local && !(pkg->infolevel & INFRQ_FILES)) { - _alpm_db_read(pkg->data, INFRQ_FILES, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_FILES); } return pkg->files; } @@ -893,7 +893,7 @@ if(pkg->origin == PKG_FROM_CACHE && pkg->data == handle->db_local && !(pkg->infolevel & INFRQ_FILES)) { - _alpm_db_read(pkg->data, INFRQ_FILES, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_FILES); } return pkg->backup; } @@ -908,7 +908,7 @@ if(pkg->origin == PKG_FROM_CACHE && pkg->data == handle->db_local && !(pkg->infolevel & INFRQ_SCRIPTLET)) { - _alpm_db_read(pkg->data, INFRQ_SCRIPTLET, pkg); + _alpm_db_read(pkg->data, pkg, INFRQ_SCRIPTLET); } return pkg->scriptlet; } Index: pacman-lib/lib/libalpm/trans.c diff -u pacman-lib/lib/libalpm/trans.c:1.36 pacman-lib/lib/libalpm/trans.c:1.37 --- pacman-lib/lib/libalpm/trans.c:1.36 Mon Feb 19 21:14:27 2007 +++ pacman-lib/lib/libalpm/trans.c Wed Feb 21 03:34:37 2007 @@ -294,7 +294,7 @@ found_provides = 1; /* Ensure package has the right newpkg */ - _alpm_db_read(localdb, INFRQ_DEPENDS, deppkg); + _alpm_db_read(localdb, deppkg, INFRQ_DEPENDS); _alpm_log(PM_LOG_DEBUG, _("updating 'requiredby' field for package '%s'"), deppkg->name); if(trans->type == PM_TRANS_TYPE_REMOVE) { @@ -318,7 +318,7 @@ } /* Ensure package has the right newpkg */ - _alpm_db_read(localdb, INFRQ_DEPENDS, deppkg); + _alpm_db_read(localdb, deppkg, INFRQ_DEPENDS); _alpm_log(PM_LOG_DEBUG, _("updating 'requiredby' field for package '%s'"), deppkg->name); if(trans->type == PM_TRANS_TYPE_REMOVE) {