Don't treat an add-on as published if it has no version attribute. (#7986)

Fixes #7846
This commit is contained in:
Pentarctagon 2023-10-26 15:39:39 -05:00 committed by GitHub
parent 2fd85fc556
commit 81bbcabe13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,15 +29,15 @@ addon_tracking_info get_addon_tracking_info(const addon_info& addon)
t.can_publish = have_addon_pbl_info(id);
t.in_version_control = have_addon_in_vcs_tree(id);
//t.installed_version = version_info();
if(is_addon_installed(id)) {
if(t.can_publish) {
if(addon.local_only) {
t.installed_version = addon.current_version;
//t.remote_version = version_info();
} else {
t.remote_version = *addon.versions.begin();
if(addon.versions.size() > 0) {
t.remote_version = *addon.versions.begin();
}
// Try to obtain the version number from the .pbl first.
// Just grabbing the version, no need to validate.
@ -54,19 +54,16 @@ addon_tracking_info get_addon_tracking_info(const addon_info& addon)
t.installed_version = get_addon_version_info(id);
if(addon.versions.size() > 0) {
t.remote_version = *addon.versions.begin();
} else {
t.remote_version = version_info(0,0,0);
}
}
if(t.remote_version == t.installed_version) {
if(addon.local_only) {
t.state = ADDON_INSTALLED_LOCAL_ONLY;
} else if(t.remote_version == t.installed_version) {
t.state = ADDON_INSTALLED;
} else if(t.remote_version > t.installed_version) {
t.state = ADDON_INSTALLED_UPGRADABLE;
} else if(t.remote_version == version_info()) {
// Remote version not set.
t.state = ADDON_INSTALLED_LOCAL_ONLY;
} else /* if(remote_version < t.installed_version) */ {
} else {
t.state = ADDON_INSTALLED_OUTDATED;
}
} else {