mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-09 04:57:59 -05:00
Remove lazy loading of deltas
Local packages do not have deltas so remove lazy loading of delta information. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
e464339e3b
commit
d39248120e
@ -196,7 +196,8 @@ alpm_list_t *_cache_get_replaces(pmpkg_t *pkg)
|
|||||||
|
|
||||||
alpm_list_t *_cache_get_deltas(pmpkg_t *pkg)
|
alpm_list_t *_cache_get_deltas(pmpkg_t *pkg)
|
||||||
{
|
{
|
||||||
LAZY_LOAD(INFRQ_DELTAS, NULL);
|
ASSERT(pkg != NULL, return(NULL));
|
||||||
|
/* local pkgs do not have deltas so nothing to load */
|
||||||
return pkg->deltas;
|
return pkg->deltas;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,29 +705,6 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
|||||||
fp = NULL;
|
fp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DELTAS */
|
|
||||||
if(inforeq & INFRQ_DELTAS) {
|
|
||||||
snprintf(path, PATH_MAX, "%sdeltas", pkgpath);
|
|
||||||
if((fp = fopen(path, "r"))) {
|
|
||||||
while(!feof(fp)) {
|
|
||||||
if(fgets(line, sizeof(line), fp) == NULL) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
_alpm_strtrim(line);
|
|
||||||
if(strcmp(line, "%DELTAS%") == 0) {
|
|
||||||
while(fgets(line, sizeof(line), fp) && strlen(_alpm_strtrim(line))) {
|
|
||||||
pmdelta_t *delta = _alpm_delta_parse(line);
|
|
||||||
if(delta) {
|
|
||||||
info->deltas = alpm_list_add(info->deltas, delta);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fclose(fp);
|
|
||||||
fp = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* INSTALL */
|
/* INSTALL */
|
||||||
if(inforeq & INFRQ_SCRIPTLET) {
|
if(inforeq & INFRQ_SCRIPTLET) {
|
||||||
snprintf(path, PATH_MAX, "%sinstall", pkgpath);
|
snprintf(path, PATH_MAX, "%sinstall", pkgpath);
|
||||||
|
@ -37,8 +37,7 @@ typedef enum _pmdbinfrq_t {
|
|||||||
INFRQ_DEPENDS = (1 << 2),
|
INFRQ_DEPENDS = (1 << 2),
|
||||||
INFRQ_FILES = (1 << 3),
|
INFRQ_FILES = (1 << 3),
|
||||||
INFRQ_SCRIPTLET = (1 << 4),
|
INFRQ_SCRIPTLET = (1 << 4),
|
||||||
INFRQ_DELTAS = (1 << 5),
|
INFRQ_DSIZE = (1 << 5),
|
||||||
INFRQ_DSIZE = (1 << 6),
|
|
||||||
/* ALL should be info stored in the package or database */
|
/* ALL should be info stored in the package or database */
|
||||||
INFRQ_ALL = 0x3F
|
INFRQ_ALL = 0x3F
|
||||||
} pmdbinfrq_t;
|
} pmdbinfrq_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user