[pacman-dev] [PATCH] Allow sync_prepare to work when no sync packages are being used

Allan McRae allan at archlinux.org
Wed Jan 15 01:16:08 EST 2014


Commit 9363e7dc allowed sync prepare to work when not sync packages were being
used and databases were missing.  However, it still required any databases
that were present had valid signatures (if these were required).  Relax this
further so that sync database status is not considered when on using local
package files.

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 lib/libalpm/sync.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 17a3e8e..5015237 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -387,15 +387,16 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
 		}
 	}
 
-	/* ensure all sync database are valid if we will be using them */
-	for(i = handle->dbs_sync; i; i = i->next) {
-		const alpm_db_t *db = i->data;
-		if(db->status & DB_STATUS_INVALID) {
-			RET_ERR(handle, ALPM_ERR_DB_INVALID, -1);
-		}
-		/* missing databases are not allowed if we have sync targets */
-		if(from_sync && db->status & DB_STATUS_MISSING) {
-			RET_ERR(handle, ALPM_ERR_DB_NOT_FOUND, -1);
+	/* ensure all sync database are present and valid if we will be using them */
+	if(from_sync) {
+		for(i = handle->dbs_sync; i; i = i->next) {
+			const alpm_db_t *db = i->data;
+			if(db->status & DB_STATUS_INVALID) {
+				RET_ERR(handle, ALPM_ERR_DB_INVALID, -1);
+			}
+			if(db->status & DB_STATUS_MISSING) {
+				RET_ERR(handle, ALPM_ERR_DB_NOT_FOUND, -1);
+			}
 		}
 	}
 
-- 
1.8.5.2



More information about the pacman-dev mailing list