]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Allow an empty index file in repo_add_apk_repo
authorMichael Schroeder <mls@suse.de>
Wed, 18 Dec 2024 10:00:35 +0000 (11:00 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 18 Dec 2024 10:00:35 +0000 (11:00 +0100)
ext/repo_apk.c

index 481d63e1d4b9d468785a72b2dad7c76febde2e96..f174368687852e7658d0f0ec7333af507aa8610c 100644 (file)
@@ -498,7 +498,7 @@ repo_add_apk_repo(Repo *repo, FILE *fp, int flags)
   /* peek into first byte to find out if this is a compressed file */
   c = fgetc(fp);
   if (c == EOF)
-    return -1;
+    return (flags & APK_ADD_INDEX) != 0 ? 0 : -1;      /* an empty file is allowed for the v2 index */
   ungetc(c, fp);
 
   if (c == 0x1f)