1
0
mirror of https://github.com/openSUSE/libsolv.git synced 2026-02-05 12:45:46 +01:00

Rename APK_ADD_INDEX to APK_ADD_INSTALLED_DB while we can

This commit is contained in:
Michael Schroeder
2025-01-15 11:53:17 +01:00
parent 1ebff91704
commit fab399d839
4 changed files with 8 additions and 8 deletions

View File

@@ -325,7 +325,7 @@ add_apkv3_idx(Repo *repo, Repodata *data, FILE *fp, int flags, int adbchar)
{
FILE *cfp;
int r;
if (!(cfp = open_apkv3(repo->pool, -1, fp, (flags & APK_ADD_INDEX ? "installed db" : "package index"), adbchar)))
if (!(cfp = open_apkv3(repo->pool, -1, fp, (flags & APK_ADD_INSTALLED_DB ? "installed database" : "package index"), adbchar)))
return -1;
r = apkv3_add_idx(repo, data, cfp, flags);
fclose(cfp);
@@ -699,7 +699,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 (flags & APK_ADD_INDEX) != 0 ? 0 : -1; /* an empty file is allowed for the v2 index */
return (flags & APK_ADD_INSTALLED_DB) != 0 ? 0 : -1; /* an empty file is allowed for the v2 db */
ungetc(c, fp);
if (c == 'A')
@@ -708,7 +708,7 @@ repo_add_apk_repo(Repo *repo, FILE *fp, int flags)
return -1;
if (first[0] == 'A' && first[1] == 'D' && first[2] == 'B')
return add_apkv3_idx(repo, data, fp, flags, first[3]);
if ((flags & APK_ADD_INDEX) == 0)
if ((flags & APK_ADD_INSTALLED_DB) == 0)
return -1; /* not a tar file */
}
@@ -737,7 +737,7 @@ repo_add_apk_repo(Repo *repo, FILE *fp, int flags)
th.end = 4;
}
if ((flags & APK_ADD_INDEX) != 0)
if ((flags & APK_ADD_INSTALLED_DB) != 0)
apk_process_index(repo, data, &th, flags);
else
{

View File

@@ -5,7 +5,7 @@
* for further information
*/
#define APK_ADD_INDEX (1 << 8)
#define APK_ADD_INSTALLED_DB (1 << 8)
#define APK_ADD_WITH_PKGID (1 << 9)
#define APK_ADD_WITH_HDRID (1 << 10)

View File

@@ -389,11 +389,11 @@ apkv3_add_idx(Repo *repo, Repodata *data, FILE *fp, int flags)
const unsigned char *adb;
size_t adblen;
unsigned int v, cnt, idx;
int idb = flags & APK_ADD_INDEX ? 1 : 0;
int idb = flags & APK_ADD_INSTALLED_DB ? 1 : 0;
if (fread(buf, 4, 1, fp) != 1 || memcmp(buf, (idb ? "idb" : "indx") , 4))
{
pool_error(pool, -1, (idb ? "not an apkv3 installed database" : "not an apkv3 index"));
pool_error(pool, -1, (idb ? "not an apkv3 installed database" : "not an apkv3 package index"));
return -1;
}

View File

@@ -129,7 +129,7 @@ main(int argc, char **argv)
if (isrepo)
{
if (islocaldb)
flags |= APK_ADD_INDEX;
flags |= APK_ADD_INSTALLED_DB;
if (!npkgs)
{
if (repo_add_apk_repo(repo, stdin, REPO_REUSE_REPODATA|REPO_NO_INTERNALIZE|flags) != 0)