1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

pacman/package: show presence of signature in in -Si

adds a new API method: alpm_pkg_get_base64_sig

[Dan: don't use a new header string in frontend]

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dave Reisner 2011-08-13 14:40:41 -04:00 committed by Dan McGee
parent ea79de21d8
commit 20b5cc96be
4 changed files with 16 additions and 1 deletions

3
README
View File

@ -428,7 +428,8 @@ API CHANGES BETWEEN 3.5 AND 4.0
- package signing functions: - package signing functions:
alpm_option_get_default_siglevel(), alpm_option_set_default_siglevel(), alpm_option_get_default_siglevel(), alpm_option_set_default_siglevel(),
alpm_option_get_gpgdir(), alpm_option_set_gpgdir(), alpm_db_get_siglevel(), alpm_option_get_gpgdir(), alpm_option_set_gpgdir(), alpm_db_get_siglevel(),
alpm_sigresult_cleanup(), alpm_db_check_pgp_signature(), alpm_pkg_check_pgp_signature() alpm_sigresult_cleanup(), alpm_db_check_pgp_signature(), alpm_pkg_check_pgp_signature(),
alpm_pkg_get_base64_sig()
- list functions: - list functions:
alpm_list_to_array(), alpm_list_previous() alpm_list_to_array(), alpm_list_previous()
- structs: - structs:

View File

@ -713,6 +713,12 @@ alpm_list_t *alpm_pkg_get_backup(alpm_pkg_t *pkg);
*/ */
alpm_db_t *alpm_pkg_get_db(alpm_pkg_t *pkg); alpm_db_t *alpm_pkg_get_db(alpm_pkg_t *pkg);
/** Retuns the base64 encoded package signature.
* @param pkg a pointer to package
* @return a reference to an internal string
*/
const char *alpm_pkg_get_base64_sig(alpm_pkg_t *pkg);
/* End of alpm_pkg_t accessors */ /* End of alpm_pkg_t accessors */
/* @} */ /* @} */

View File

@ -229,6 +229,13 @@ const char SYMEXPORT *alpm_pkg_get_md5sum(alpm_pkg_t *pkg)
return pkg->ops->get_md5sum(pkg); return pkg->ops->get_md5sum(pkg);
} }
const char SYMEXPORT *alpm_pkg_get_base64_sig(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = 0;
return pkg->base64_sig;
}
const char SYMEXPORT *alpm_pkg_get_arch(alpm_pkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_arch(alpm_pkg_t *pkg)
{ {
ASSERT(pkg != NULL, return NULL); ASSERT(pkg != NULL, return NULL);

View File

@ -135,6 +135,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra)
if(from == PKG_FROM_SYNCDB) { if(from == PKG_FROM_SYNCDB) {
string_display(_("MD5 Sum :"), alpm_pkg_get_md5sum(pkg)); string_display(_("MD5 Sum :"), alpm_pkg_get_md5sum(pkg));
string_display(_("Signatures :"), alpm_pkg_get_base64_sig(pkg) ? _("Yes") : _("No"));
} }
if(from == PKG_FROM_FILE) { if(from == PKG_FROM_FILE) {
alpm_sigresult_t result; alpm_sigresult_t result;