Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • pabloyoyoista/apk-tools
  • dosisod/apk-tools
  • alxu/apk-tools
  • adamsmyrakle/apk-tools
  • leso-kn/apk-tools
  • Dfe3.jadd/apk-tools
  • Satoshi821/apk-tools
  • zerica/apk-tools
  • kasperk81/apk-tools
  • mbsmith/apk-tools
  • jonasjelonek1/apk-tools
  • jahway603/apk-tools
  • evertheylen/apk-tools
  • dandev486/apk-tools
  • goshhhy/apk-tools
  • Cogitri/apk-tools
  • NachtEule01/apk-tools
  • aither64/apk-tools
  • adamthiede/apk-tools
  • dangowrt/apk-tools
  • Terre31312/apk-tools
  • Lolxc/apk-tools
  • kdaudt/apk-tools
  • Conan_Kudo/apk-tools
  • fossdd/apk-tools
  • qaqland/apk-tools
  • minitech/apk-tools
  • TmsSl/apk-tools
  • ynezz/apk-tools
  • WhyNotHugo/apk-tools
  • jirutka/apk-tools
  • Rboccardi661/apk-tools
  • nbuwe/apk-tools
  • albertmccumber/apk-tools
  • nekopsykose/apk-tools
  • Newbyte/apk-tools
  • Dashshaded/apk-tools
  • felixonmars/apk-tools
  • Habbie/apk-tools
  • socksinspace/apk-tools
  • ncopa/apk-tools
  • jaiden/apk-tools
  • hnyman/apk-tools
  • alpine/apk-tools
  • huajingyun01/apk-tools
  • calebccff/apk-tools
  • jvreeland/apk-tools
  • Ansuel/apk-tools
  • sertonix/apk-tools
49 results
Show changes
Commits on Source (10)
......@@ -95,7 +95,7 @@ static int adbsign_main(void *pctx, struct apk_ctx *ac, struct apk_string_array
ctx->ac = ac;
apk_array_foreach_item(arg, args) {
struct apk_istream *is = adb_decompress(apk_istream_from_file_mmap(AT_FDCWD, arg), &spec);
if (ac->compspec.alg && ac->compspec.level) spec = ac->compspec;
if (ac->compspec.alg || ac->compspec.level) spec = ac->compspec;
struct apk_ostream *os = adb_compress(apk_ostream_to_file(AT_FDCWD, arg, 0644), &spec);
r = adbsign_resign(ctx, is, os);
if (r) apk_err(out, "%s: %s", arg, apk_error_str(r));
......
......@@ -212,7 +212,7 @@ static int fetch_match_package(void *pctx, struct apk_query_match *qm)
struct apk_package *pkg = qm->pkg;
if (pkg == NULL) {
if (!apk_blob_contains(qm->query, APK_BLOB_STRLIT('*'))) {
if (!apk_blob_contains(qm->query, APK_BLOB_STRLIT("*"))) {
apk_msg(out, BLOB_FMT ": unable to select package (or its dependencies)",
BLOB_PRINTF(qm->query));
ctx->errors++;
......
......@@ -152,11 +152,8 @@ static int mkndx_parse_v2meta(struct apk_extract_ctx *ectx, struct apk_istream *
f = bsearch(&key, fields, ARRAY_SIZE(fields), sizeof(fields[0]), cmpfield);
if (!f || f->ndx == 0) continue;
if (adb_ro_val(&ctx->pkginfo, f->ndx) != ADB_NULL) {
/* Workaround abuild bug that emitted multiple license lines */
if (f->ndx == ADBI_PI_LICENSE) continue;
return ADB_ERROR(APKE_ADB_PACKAGE_FORMAT);
}
if (adb_ro_val(&ctx->pkginfo, f->ndx) != ADB_NULL)
return -APKE_ADB_PACKAGE_FORMAT;
switch (f->ndx) {
case ADBI_PI_DEPENDS:
......@@ -170,18 +167,22 @@ static int mkndx_parse_v2meta(struct apk_extract_ctx *ectx, struct apk_istream *
parse_deps:
while (apk_dep_split(&v, &bdep)) {
e = adb_wa_append_fromstring(&deps[i], bdep);
if (ADB_IS_ERROR(e)) return e;
if (ADB_IS_ERROR(e)) return -ADB_VAL_VALUE(e);
}
continue;
}
adb_wo_pkginfo(&ctx->pkginfo, f->ndx, v);
}
if (r != -APKE_EOF) return ADB_ERROR(-r);
if (r != -APKE_EOF) return r;
adb_wo_arr(&ctx->pkginfo, ADBI_PI_DEPENDS, &deps[0]);
adb_wo_arr(&ctx->pkginfo, ADBI_PI_PROVIDES, &deps[1]);
adb_wo_arr(&ctx->pkginfo, ADBI_PI_REPLACES, &deps[2]);
adb_wo_free(&deps[0]);
adb_wo_free(&deps[1]);
adb_wo_free(&deps[2]);
return 0;
}
......@@ -319,7 +320,10 @@ static int mkndx_main(void *pctx, struct apk_ctx *ac, struct apk_string_array *a
apk_extract_reset(&ctx->ectx);
apk_extract_generate_identity(&ctx->ectx, ctx->hash_alg, &digest);
r = apk_extract(&ctx->ectx, apk_istream_from_file(AT_FDCWD, arg));
if (r < 0 && r != -ECANCELED) goto err_pkg;
if (r < 0 && r != -ECANCELED) {
adb_wo_reset(&ctx->pkginfo);
goto err_pkg;
}
adb_wo_int(&ctx->pkginfo, ADBI_PI_FILE_SIZE, file_size);
adb_wo_blob(&ctx->pkginfo, ADBI_PI_HASHES, APK_DIGEST_BLOB(digest));
......
......@@ -88,8 +88,10 @@ static int parse_info(struct mkpkg_ctx *ictx, struct apk_out *out, const char *o
apk_blob_t l, r;
int i;
if (!apk_blob_split(APK_BLOB_STR(optarg), APK_BLOB_STRLIT(":"), &l, &r))
goto inval;
if (!apk_blob_split(APK_BLOB_STR(optarg), APK_BLOB_STRLIT(":"), &l, &r)) {
apk_err(out, "missing key or value: %s", optarg);
return -EINVAL;
}
i = adb_s_field_by_name_blob(&schema_pkginfo, l);
switch (i) {
......@@ -97,7 +99,7 @@ static int parse_info(struct mkpkg_ctx *ictx, struct apk_out *out, const char *o
break;
case ADBI_PI_FILE_SIZE:
case ADBI_PI_INSTALLED_SIZE:
return -EINVAL;
goto inval;
default:
ictx->info[i] = r;
return 0;
......@@ -146,7 +148,10 @@ static int mkpkg_parse_option(void *ctx, struct apk_ctx *ac, int optch, const ch
ictx->rootnode = 0;
break;
case OPT_MKPKG_script:
apk_blob_split(APK_BLOB_STR(optarg), APK_BLOB_STRLIT(":"), &l, &r);
if (!apk_blob_split(APK_BLOB_STR(optarg), APK_BLOB_STRLIT(":"), &l, &r)) {
apk_err(out, "missing script type: %s", optarg);
return -EINVAL;
}
i = adb_s_field_by_name_blob(&schema_scripts, l);
if (!i) {
apk_err(out, "invalid script type: " BLOB_FMT, BLOB_PRINTF(l));
......
......@@ -22,7 +22,7 @@ struct apk_extract_v3_ctx {
struct apk_pathbuilder pb;
};
static void apk_extract_v3_acl(struct apk_file_info *fi, struct adb_obj *o, struct apk_id_cache *idc)
static int apk_extract_v3_acl(struct apk_file_info *fi, struct adb_obj *o, struct apk_id_cache *idc)
{
struct adb_obj xa;
apk_blob_t x, key, value;
......@@ -37,13 +37,15 @@ static void apk_extract_v3_acl(struct apk_file_info *fi, struct adb_obj *o, stru
apk_xattr_array_resize(&fi->xattrs, 0, adb_ra_num(&xa));
for (i = ADBI_FIRST; i <= adb_ra_num(&xa); i++) {
x = adb_ro_blob(&xa, i);
apk_blob_split(x, APK_BLOB_BUF(""), &key, &value);
if (!apk_blob_split(x, APK_BLOB_BUF(""), &key, &value))
return -1;
apk_xattr_array_add(&fi->xattrs, (struct apk_xattr) {
.name = key.ptr,
.value = value,
});
}
apk_fileinfo_hash_xattr(fi, APK_DIGEST_SHA1);
return 0;
}
static int apk_extract_v3_file(struct apk_extract_ctx *ectx, uint64_t sz, struct apk_istream *is)
......@@ -61,7 +63,8 @@ static int apk_extract_v3_file(struct apk_extract_ctx *ectx, uint64_t sz, struct
int r;
apk_xattr_array_init(&fi.xattrs);
apk_extract_v3_acl(&fi, adb_ro_obj(&ctx->file, ADBI_FI_ACL, &acl), apk_ctx_get_id_cache(ectx->ac));
if (apk_extract_v3_acl(&fi, adb_ro_obj(&ctx->file, ADBI_FI_ACL, &acl), apk_ctx_get_id_cache(ectx->ac)))
goto err_schema;
apk_digest_from_blob(&fi.digest, adb_ro_blob(&ctx->file, ADBI_FI_HASHES));
target = adb_ro_blob(&ctx->file, ADBI_FI_TARGET);
......@@ -124,9 +127,13 @@ static int apk_extract_v3_directory(struct apk_extract_ctx *ectx)
int r;
apk_xattr_array_init(&fi.xattrs);
apk_extract_v3_acl(&fi, adb_ro_obj(&ctx->path, ADBI_DI_ACL, &acl), apk_ctx_get_id_cache(ectx->ac));
if (apk_extract_v3_acl(&fi, adb_ro_obj(&ctx->path, ADBI_DI_ACL, &acl), apk_ctx_get_id_cache(ectx->ac))) {
r = -APKE_ADB_SCHEMA;
goto done;
}
fi.mode |= S_IFDIR;
r = ectx->ops->file(ectx, &fi, 0);
done:
apk_xattr_array_free(&fi.xattrs);
return r;
......
......@@ -958,9 +958,6 @@ int apk_pkg_replaces_file(const struct apk_package *a, const struct apk_package
/* Upgrading package? */
if (a->name == b->name) return APK_PKG_REPLACES_YES;
/* Or same source package? */
if (a->origin && a->origin == b->origin) return APK_PKG_REPLACES_YES;
/* Does the original package replace the new one? */
apk_array_foreach(dep, a->ipkg->replaces) {
if (apk_dep_is_materialized(dep, b)) {
......@@ -984,6 +981,9 @@ int apk_pkg_replaces_file(const struct apk_package *a, const struct apk_package
* the file without warnings. */
if (b_prio >= 0) return APK_PKG_REPLACES_YES;
/* Or same source package? */
if (a->origin && a->origin == b->origin) return APK_PKG_REPLACES_YES;
/* Both ship same file, but metadata is inconclusive. */
return APK_PKG_REPLACES_CONFLICT;
}
......