diff options
author | Timo Teräs <timo.teras@iki.fi> | 2011-01-03 21:06:41 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2011-01-03 21:06:41 +0200 |
commit | d8ba07e484b0c838ce475202f03e041953b183e1 (patch) | |
tree | effae9887b80d12591e2f05f29ac95f094671dc7 /src/package.c | |
parent | 1f42cc1aed32ebf160db5e812d2f57e654042522 (diff) | |
download | apk-tools-d8ba07e484b0c838ce475202f03e041953b183e1.tar.gz apk-tools-d8ba07e484b0c838ce475202f03e041953b183e1.tar.bz2 apk-tools-d8ba07e484b0c838ce475202f03e041953b183e1.tar.xz apk-tools-d8ba07e484b0c838ce475202f03e041953b183e1.zip |
pkg, db: allow index with unsupported features to be loaded
Just disable installation of packages using the new stuff. Also
flag lower case package info fields as non-critical and allow
installation even if that features is not supported.
Diffstat (limited to 'src/package.c')
-rw-r--r-- | src/package.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/package.c b/src/package.c index 37e4357..ae34f79 100644 --- a/src/package.c +++ b/src/package.c @@ -654,8 +654,17 @@ int apk_pkg_add_info(struct apk_database *db, struct apk_package *pkg, case 'I': pkg->installed_size = apk_blob_pull_uint(&value, 10); break; + case 'F': case 'M': case 'R': case 'Z': + /* installed db entries which are handled in database.c */ + return 1; default: - return -1; + /* lower case index entries are safe to be ignored */ + if (!islower(field)) { + pkg->filename = APK_PKG_UNINSTALLABLE; + db->compat_notinstallable = 1; + } + db->compat_newfeatures = 1; + return 1; } if (APK_BLOB_IS_NULL(value)) return -1; @@ -755,8 +764,9 @@ int apk_pkg_read(struct apk_database *db, const char *file, tar->close(tar); if (r < 0 && r != -ECANCELED) goto err; - if (ctx.pkg->name == NULL) { - r = -ENOMSG; + if (ctx.pkg->name == NULL || + ctx.pkg->filename == APK_PKG_UNINSTALLABLE) { + r = -ENOTSUP; goto err; } if (sctx->action != APK_SIGN_VERIFY) |