index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-07-29 17:03:07 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-08 16:56:48 -0500 |
commit | ef4757afa5d31ff6a6c09e3410c889f152826f4f (patch) | |
tree | a801e8b6d7bfc07a3d769993464a19d428c87f9b /lib/libalpm | |
parent | d9f9b87d3ff6621577aa15bf3304f73219f6d5f1 (diff) |
-rw-r--r-- | lib/libalpm/be_local.c | 14 | ||||
-rw-r--r-- | lib/libalpm/be_package.c | 4 | ||||
-rw-r--r-- | lib/libalpm/db.h | 3 |
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 49661e24..5d136c9e 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -533,6 +533,13 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) /* already loaded all of this info, do nothing */ return 0; } + + if(info->infolevel & INFRQ_ERROR) { + /* We've encountered an error loading this package before. Don't attempt + * repeated reloads, just give up. */ + return -1; + } + _alpm_log(db->handle, ALPM_LOG_FUNCTION, "loading package data for %s : level=0x%x\n", info->name, inforeq); @@ -619,6 +626,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) } fclose(fp); fp = NULL; + info->infolevel |= INFRQ_DESC; } /* FILES */ @@ -673,6 +681,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) } fclose(fp); fp = NULL; + info->infolevel |= INFRQ_FILES; } /* INSTALL */ @@ -681,15 +690,14 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) if(access(path, F_OK) == 0) { info->scriptlet = 1; } + info->infolevel |= INFRQ_SCRIPTLET; } - /* internal */ - info->infolevel |= inforeq; - free(pkgpath); return 0; error: + info->infolevel |= INFRQ_ERROR; free(pkgpath); if(fp) { fclose(fp); diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 7e90af71..f80790cd 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -436,9 +436,9 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, _alpm_log(handle, ALPM_LOG_DEBUG, "sorting package filelist for %s\n", pkgfile); newpkg->files.files = files_msort(files, files_count); newpkg->files.count = files_count; - newpkg->infolevel = INFRQ_ALL; + newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_FILES | INFRQ_SCRIPTLET; } else { - newpkg->infolevel = INFRQ_BASE | INFRQ_DESC; + newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_SCRIPTLET; } return newpkg; diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 5c7988b4..a09c7e26 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -40,7 +40,8 @@ typedef enum _alpm_dbinfrq_t { INFRQ_SCRIPTLET = (1 << 3), INFRQ_DSIZE = (1 << 4), /* ALL should be info stored in the package or database */ - INFRQ_ALL = 0x1F + INFRQ_ALL = 0x1F, + INFRQ_ERROR = (1 << 31) } alpm_dbinfrq_t; /** Database status. Bitflags. */ |