summaryrefslogtreecommitdiff
path: root/lib/libalpm/alpm.h
Commit message (Collapse)AuthorAge
* Improve database server APIDan McGee2011-05-05
| | | | | | | | | Currently we have one call that has all sorts of crazy behavior and doesn't make a whole lot of sense. Go from one method to the normal four methods we have for all of our other lists we use in the library to make it a lot easier for a frontend to manipulate server lists. Signed-off-by: Dan McGee <dan@archlinux.org>
* Perform package verification at package load timeDan McGee2011-04-24
| | | | | | | | | | | Both md5sum verification and PGP verification can and should be done at package load time. This allows verification to happen as early as possible for packages provided by filename and loaded in the frontend, and moves more stuff out of sync_commit that doesn't really belong there. This should also set the stage for simplified parallel loading of packages later down the road. Signed-off-by: Dan McGee <dan@archlinux.org>
* Rein in the complexity of the signature typeDan McGee2011-04-24
| | | | | | | | | | | | | | Given that we offer no transparency into the pmpgpsig_t type, we don't really need to expose it outside of the library, and at this point, we don't need it at all. Don't decode anything except when checking signatures. For packages/files not from a sync database, we now just read the signature file directly anyway. Also push the decoding logic down further into the check method so we don't need this hanging out in a less than ideal place. This will make it easier to conditionally compile things down the road. Signed-off-by: Dan McGee <dan@archlinux.org>
* Make dump_pkg_full a little less insaneDan McGee2011-04-22
| | | | | | | | | | | | | | | The various "level" values were a bit crazy to decipher, and we were doing some very interesting comparisons in certain places. Break it out into two parameters instead so we can seperate the type from the extra information display, and do things accordingly. Nothing changes with the display of any of the five types we currently show: -Si, -Sii, -Qi, -Qii, -Qip. Something to note- we should expose the PKG_FROM enum type somehow, this patch leaves the door open to do that quite easily. Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm.h: add several missing documentation stringsRémy Oudompheng2011-04-21
| | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
* alpm.h: rationalize option getters/setters documentationRémy Oudompheng2011-04-21
| | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
* alpm.h: add/improve function documentationRémy Oudompheng2011-04-21
| | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
* Allow VerifySig to act as a default verification in [options]Dave Reisner2011-04-20
| | | | | | | | | | * add _alpm_db_get_sigverify_level * add alpm_option_{get,set}_default_sigverify And set the default verification level to OPTIONAL if not set otherwise. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm.h: forward-declare shared enumerationsDan McGee2011-04-20
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-04-15
|\ | | | | | | | | | | | | | | Conflicts: lib/libalpm/alpm.h lib/libalpm/trans.c Signed-off-by: Dan McGee <dan@archlinux.org>
| * alpm.h: fix typos in documentationRémy Oudompheng2011-04-13
| | | | | | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
| * alpm.h: document transaction flagsRémy Oudompheng2011-04-09
| | | | | | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
| * More documentation for option getters/setters.Rémy Oudompheng2011-04-09
| |
| * alpm.h: more documentation for pkgreason, depend and errno.Rémy Oudompheng2011-04-09
| |
| * Move documentation for public package function to alpm.hRémy Oudompheng2011-04-09
| |
| * alpm.h: organize doxygen documentation in groupsRémy Oudompheng2011-04-09
| |
| * Move documentation of public database functions to alpm.hRémy Oudompheng2011-04-09
| |
| * alpm.h: add documentation for package property accessorsRémy Oudompheng2011-04-09
| |
| * Move documentation of public transaction functions to alpm.hRémy Oudompheng2011-04-09
| |
* | libalpm: consistently use int as return type for option settersRémy Oudompheng2011-04-15
| | | | | | | | | | | | | | | | Currently the only error case then when handle == NULL. However several handle functions return -1 on this error, and a uniform API makes things simpler. Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
* | Add functions for verifying database signatureAllan McRae2011-03-23
| | | | | | | | | | | | | | | | | | | | | | | | Add a pmpgpsig_t struct to the database entry struct and functions for the lazy loading of database signatures. Add a function for checking database signatures, reusing (and generalizing) the code currently used for checking package signatures. TODO: The code for reading in signature files from the filesystem is duplicated for local packages and database and needs refactoring. Signed-off-by: Allan McRae <allan@archlinux.org>
* | Added gpg verification options per repo to the config file.Xavier Chantry2011-03-23
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Integrate GPGME into libalpmDan McGee2011-03-23
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add some error codes for signature verificationDan McGee2011-03-23
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add signature directory as option on libalpm handleDan McGee2011-03-23
| | | | | | | | | | | | | | This will serve as the home directory we pass to GPGME when making calls so we can have a libalpm-utilized keyring. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'gpg-libalpm-basics'Dan McGee2011-03-23
|\ \
| * | Allow PGP signature to be read from sync databaseDan McGee2011-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new field to the package struct to hold PGP information and instruct db_read to pick it up from the database. It is currently unused internally but this is the first step. Due to the fact that we store the PGP sig as binary data, we need to store both the data and the length so we have a small utility struct to assist us. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* | | Remove libfetch error codeDan McGee2011-03-23
|/ / | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* / handle error case for PM_ERR_LIBCURLDave Reisner2011-03-09
|/ | | | | | | | Add PM_ERR_LIBCURL to error enum and handle case in error.c by returning curl_easy_strerror() based on the error number carried by the gloabl alpm handle. Signed-off-by: Dave Reisner <d@falconindy.com>
* Check local DB version before continuing transactionDan McGee2011-02-28
| | | | | | | | | Ensure we have a local DB version that is up to par with what we expect before we go down any road that might modify it. This should prevent stupid mistakes with the 3.5.X upgrade and people not running pacman-db-upgrade after the transaction as they will need to. Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm: alpm_db_get_pkgcache_list => alpm_db_get_pkgcacheDave Reisner2011-02-25
| | | | | | | This avoids needless breakage of the public API. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm: remove public visibility of pmpkghash_tDave Reisner2011-02-25
| | | | | | | | | There's no API functions exposed which allow manipulation of this type, so remove it from public view. Also, rename the public and private alpm_db_get_pkgcache symbol to alpm_db_get_pkgcache_has. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Mark log callback format string constDan McGee2011-02-24
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Read pkgcache into hashAllan McRae2011-02-04
| | | | | | | | | | | | Read the package information for sync/local databases into a pmpkghash_t structure. Provide a alpm_db_get_pkgcache_list() method that returns the list from the hash object. Most usages of alpm_db_get_pkgcache are converted to this at this stage for ease of implementation. Review whether these are better accessing the hash table directly at a later stage. Signed-off-by: Allan McRae <allan@archlinux.org>
* Add a hash table for holding packagesAllan McRae2011-02-04
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* alpm/depcmp: new NODEPVERSION flagXavier Chantry2011-01-31
| | | | | | | | | | | | | | | | This flag allows to disable version checking in dependency resolving code. depcmp_tolerant respects the NODEPVERSION flag but we still keep the original strict depcmp. The idea is to reduce the impact of the NODEPVERSION flag by using it in fewer places. I replaced almost all depcmp calls by depcmp_tolerant in deps.c (except in the public find_satisfier used by deptest / pacman -T), but I kept depcmp in sync.c and conflict.c Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm: drop old target interfacesXavier Chantry2011-01-29
| | | | | | | | | | It's likely that these interfaces will break sooner or later, now that pacman no longer uses them. So better force the two people who use them to migrate their code to the new add_pkg/remove_pkg interface, which is very easy anyway. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* alpm: deprecate old interfaceXavier Chantry2011-01-29
| | | | | | | | | | | | | | Old interface is marked as deprecated: int alpm_sync_target(char *target); int alpm_sync_dbtarget(char *db, char *target); int alpm_add_target(char *target); int alpm_remove_target(char *target); New recommended interface: int alpm_add_pkg(pmpkg_t *pkg); int alpm_remove_pkg(pmpkg_t *pkg); Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* alpm: new alpm_remove_pkg interfaceXavier Chantry2011-01-29
| | | | | | | | | For consistency with alpm_add_pkg. The new recommended interface is alpm_add_pkg / alpm_remove_pkg, all others interfaces are deprecated. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* alpm: add alpm_find_grp_pkgsXavier Chantry2011-01-29
| | | | | | | | This group function is meant to help group handling from frontend : it scans all dbs, handling ignored packages and duplicate members (the first repo where a member is found has the priority). Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* alpm: new alpm_add_pkg interfaceXavier Chantry2011-01-29
| | | | | | | | | | | | | This new function is meant to deprecate all existing sync/add target functions : int alpm_sync_target(char *target); int alpm_sync_dbtarget(char *db, char *target); int alpm_add_target(char *target); Rather than dropping these 3 interfaces, it might be better to rewrite them using alpm_add_pkg for now. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* alpm/dep: add alpm_find_dbs_satisfierXavier Chantry2011-01-29
| | | | | | | | | | | This is a public interface for resolvedep. It looks nicer to expose it this way rather than through sync_target. This function can also be helpful for external tools as it should give good results close to how pacman select a package for satisfying a given dep. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* Add interactive provider selectionXavier Chantry2011-01-29
| | | | | | | | | | | | | | | | | | | | | | | | If there are multiple providers in one db, pacman used to just stop at the first one (both during dependency resolution or for pacman -S 'provision' which uses the same code). This adds a new conversation callback so that the user can choose which provider to install. By default (user press enter or --noconfirm), the first provider is still chosen, so for example the behavior of sync402 and 403 is preserved. But at least the user now has the possibility to make the right choice in a manual run. If one of the provider is already installed, it is picked for reinstall/upgrade, so that provision 002/003 pactest now pass. $ pacman -S community/smtp-server :: There are 3 providers available for smtp-server: 1) courier-mta 2) esmtp 3) exim Which one do you want to install? Enter a number (default=1): Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* Remove need to explicitly register the local DBDan McGee2011-01-29
| | | | | | | | | Perform the cheap struct and string setup of the local DB at handle initialization time to match the teardown we do when releasing the handle. If the local DB is not needed, all real initialization is done lazily after DB paths and other things have been configured anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove epoch as an independent fieldDan McGee2011-01-21
| | | | | | | | | | | | | | Instead, go the same route we have always taken with version-release in libalpm and treat it all as one piece of information. Makepkg is the only script that knows about epoch as a distinct value; from there on out we will parse out the components as necessary. This makes the code a lot simpler as far as epoch handling goes. The downside here is that we are tossing some compatibility to the wind; packages using force will have to be rebuilt with an incremented epoch to keep their special status. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a progressbar for package integrity checkingDan McGee2011-01-11
| | | | | | | This can take a while too, and it is really easy to add the necessary callback stuff for adding a progressbar. Signed-off-by: Dan McGee <dan@archlinux.org>
* Use size_t for alpm_list sizesAllan McRae2011-01-07
| | | | | | | | | | | | | There is a lot of swtiching between size_t and int for alpm_list sizes in the codebase. Start converting these to all be size_t by adjusting the return type of alpm_list_count and fixing all additional warnings given by -Wconversion that are generated by this change. Dan: a few more small changes to ensure things compile, adjusting some printf format string characters to accommodate the larger size on x86_64. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Update copyright years for 2011Allan McRae2011-01-07
| | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add const to some ALPM function signaturesJakob Gruber2010-12-30
| | | | | | char * -> const char *. Signed-off-by: Dan McGee <dan@archlinux.org>
* Always specify arguement type in function delcarationsAllan McRae2010-12-20
| | | | | | | | Always declare a function with (void) rather than () when we expect no arguements. Fixes all warnings with -Wstrict-prototypes. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>