diff options
author | Xavier Chantry <shiningxc@gmail.com> | 2008-12-17 11:55:07 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-03-23 09:35:50 +0100 |
commit | f9505063f804b9e1c736299b2387e1ddfbdc4f97 (patch) | |
tree | e5659dcc137e3e1e2ea6811475f12b9d108b7b6e /lib/libalpm/db.c | |
parent | 18c69469618fef612a74ee550e157a45fc099efc (diff) | |
download | pacman-f9505063f804b9e1c736299b2387e1ddfbdc4f97.tar.gz pacman-f9505063f804b9e1c736299b2387e1ddfbdc4f97.tar.xz |
Added gpg verification options per repo to the config file.
Once we do this, add support for VerifySig to pactest. We just check if
the repo name contains Always, Never or Optional to determine the value
of VerifySig. The default is Never. pacman uses Always by default but
this is not suitable for pactest.
Original-work-by: shankar <jatheendra@gmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r-- | lib/libalpm/db.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index cb575c8a..f61ea918 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -181,6 +181,24 @@ int SYMEXPORT alpm_db_setserver(pmdb_t *db, const char *url) return 0; } +/** Set the verify gpg signature option for a database. + * @param db database pointer + * @param verify enum pgp_verify_t + * @return 0 on success, -1 on error (pm_errno is set accordingly) + */ +int SYMEXPORT alpm_db_set_pgp_verify(pmdb_t *db, pgp_verify_t verify) +{ + ALPM_LOG_FUNC; + + /* Sanity checks */ + ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); + + db->pgp_verify = verify; + _alpm_log(PM_LOG_DEBUG, "adding VerifySig option to database '%s': %d\n", + db->treename, verify); + + return(0); +} /** Get the name of a package database * @param db pointer to the package database |