[pacman-dev] [PATCH 1/3] Combine reading from depends and desc in sync db

Allan McRae allan at archlinux.org
Sat Oct 30 02:02:42 EDT 2010


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

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 lib/libalpm/be_sync.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index e1c7663..275a858 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -241,7 +241,7 @@ int _alpm_sync_db_read(pmdb_t *db, struct archive *archive, struct archive_entry
 		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) {
 			_alpm_strtrim(line);
 			if(strcmp(line, "%NAME%") == 0) {
@@ -356,12 +356,7 @@ int _alpm_sync_db_read(pmdb_t *db, struct archive *archive, struct archive_entry
 				if(!pkg->epoch) {
 					pkg->epoch = 1;
 				}
-			}
-		}
-	} else if(strcmp(filename, "depends") == 0) {
-		while(_alpm_archive_fgets(line, sizeof(line), archive) != NULL) {
-			_alpm_strtrim(line);
-			if(strcmp(line, "%DEPENDS%") == 0) {
+			} else if(strcmp(line, "%DEPENDS%") == 0) {
 				while(_alpm_archive_fgets(line, sizeof(line), archive) &&
 							strlen(_alpm_strtrim(line))) {
 					pmdepend_t *dep = _alpm_splitdep(_alpm_strtrim(line));
-- 
1.7.3.2



More information about the pacman-dev mailing list