mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Ensure packages have a valid version
Currently you can manually create and then install a package with a version not containing a pkgrel. The created local database entry is invalid as the directory name can not be split by _alpm_splitname due to the assumtion of hyphens separating name-pkgver-pkgrel. Ensure the package has a valid version when it is loaded. Fixes FS#35514. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
e7ad883ebe
commit
e049bb8bd6
@ -413,6 +413,10 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
|
|||||||
_alpm_log(handle, ALPM_LOG_ERROR, _("missing package version in %s\n"), pkgfile);
|
_alpm_log(handle, ALPM_LOG_ERROR, _("missing package version in %s\n"), pkgfile);
|
||||||
goto pkg_invalid;
|
goto pkg_invalid;
|
||||||
}
|
}
|
||||||
|
if(strchr(newpkg->version, '-') == NULL) {
|
||||||
|
_alpm_log(handle, ALPM_LOG_ERROR, _("invalid package version in %s\n"), pkgfile);
|
||||||
|
goto pkg_invalid;
|
||||||
|
}
|
||||||
config = 1;
|
config = 1;
|
||||||
continue;
|
continue;
|
||||||
} else if(strcmp(entry_name, ".INSTALL") == 0) {
|
} else if(strcmp(entry_name, ".INSTALL") == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user