From VMiklos <vmiklos@frugalware.org>

* alpm_db_update() fix up the level parameter
till now when it was "1", it meant false, which was not in sync with the C logic :)
This commit is contained in:
Aaron Griffin 2006-10-19 15:28:52 +00:00
parent 39790dcc18
commit e7f886aac3
2 changed files with 4 additions and 4 deletions

View File

@ -354,12 +354,12 @@ int alpm_db_setserver(pmdb_t *db, char *url)
}
/** Update a package database
* @param level control for checking lastupdate time
* @param level if true, then forces the update, otherwise update only in case
* @param db pointer to the package database to update
* @return 0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up
* to date
*/
int alpm_db_update(int level, PM_DB *db)
int alpm_db_update(int force, PM_DB *db)
{
PMList *lp;
char path[PATH_MAX];
@ -378,7 +378,7 @@ int alpm_db_update(int level, PM_DB *db)
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
}
if(level < 2) {
if(!force) {
/* get the lastupdate time */
_alpm_db_getlastupdate(db, lastupdate);
if(strlen(lastupdate) == 0) {

View File

@ -161,7 +161,7 @@ static int sync_synctree(int level, list_t *syncs)
for(i = syncs; i; i = i->next) {
sync_t *sync = (sync_t *)i->data;
ret = alpm_db_update(level, sync->db);
ret = alpm_db_update((level < 2 ? 0 : 1), sync->db);
if(ret > 0) {
if(pm_errno == PM_ERR_DB_SYNC) {
ERR(NL, _("failed to synchronize %s\n"), sync->treename);