Combine reading from depends and desc in sync db

This will allow us to eventually combine the depends and desc entries
within the sync database.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2010-10-30 14:50:04 +10:00 committed by Dan McGee
parent 889c260cbf
commit a44c7b8956
1 changed files with 2 additions and 7 deletions

View File

@ -239,7 +239,7 @@ int _alpm_sync_db_read(pmdb_t *db, struct archive *archive, struct archive_entry
return(-1); return(-1);
} }
if(strcmp(filename, "desc") == 0) { if(strcmp(filename, "desc") == 0 || strcmp(filename, "depends") == 0) {
while(_alpm_archive_fgets(line, sizeof(line), archive) != NULL) { while(_alpm_archive_fgets(line, sizeof(line), archive) != NULL) {
_alpm_strtrim(line); _alpm_strtrim(line);
if(strcmp(line, "%NAME%") == 0) { if(strcmp(line, "%NAME%") == 0) {
@ -354,12 +354,7 @@ int _alpm_sync_db_read(pmdb_t *db, struct archive *archive, struct archive_entry
if(!pkg->epoch) { if(!pkg->epoch) {
pkg->epoch = 1; pkg->epoch = 1;
} }
} } else if(strcmp(line, "%DEPENDS%") == 0) {
}
} else if(strcmp(filename, "depends") == 0) {
while(_alpm_archive_fgets(line, sizeof(line), archive) != NULL) {
_alpm_strtrim(line);
if(strcmp(line, "%DEPENDS%") == 0) {
while(_alpm_archive_fgets(line, sizeof(line), archive) && while(_alpm_archive_fgets(line, sizeof(line), archive) &&
strlen(_alpm_strtrim(line))) { strlen(_alpm_strtrim(line))) {
pmdepend_t *dep = _alpm_splitdep(_alpm_strtrim(line)); pmdepend_t *dep = _alpm_splitdep(_alpm_strtrim(line));