summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/alpm.c
AgeCommit message (Collapse)AuthorFilesLines
2007-11-04Clean up usage of extern variablesDan McGee1-1/+0
Instead of declaring the extern variable in every *.c file, include it in the header file that makes sense. This means handle.h for the handle, and conf.h for the pacman side config object. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-23Ensure all localization stuff is correctly guardedDan McGee1-0/+3
Anything dealing with libintl and localization should be correctly guarded inside an ENABLE_NLS block on both the pacman and libalpm sides. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16libalpm/db.c : add alpm_db_unregister_all.Chantry Xavier1-14/+2
This basically moves the code from alpm_release, which was mostly about unregistering all databases, to a safer alpm_db_unregister_all. This allows to avoid modifying the dbs_sync list while iterating over it, and and also prevent alpm_release from looping infinitely when a database can't be unregistered. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-10Remove gettext calls from all PM_LOG_DEBUG messagesDan McGee1-1/+2
There is no real reason to burden our translators with these messages, as anyone helping to debug these will probably want them in English. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-06First step of moving translations from src/pacman/po to po/Dan McGee1-0/+1
Move the translations from src/pacman/po to just po/ so we can include the scripts gettext translations in the same message catalog as that of the pacman frontend. The libalpm message catalog, for now, will remain a separate existence. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-06Various small fixes as suggested by some static code checkersDan McGee1-2/+2
I ran flawfinder and sparse over the pacman source code and found a few things that were worth fixing (and were quick fixes). Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05Clean up unnecessary headers and macros from alpm.cDan McGee1-10/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05Merge branch 'alpm.c_cleanup' into frontend_configDan McGee1-908/+2
Conflicts: lib/libalpm/alpm.c
2007-06-05Fix up outstanding parseconfig issuesDan McGee1-1/+1
The db variable was left unset when calling alpm_db_register, leading to a failure to ever register a sync db. Also added a check to ensure DBPath was set when trying to register a database. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05Rip alpm_parse_config out of libalpmDan McGee1-206/+1
Switch over to the new frontend parseconfig. * Fix a few issues in parseconfig * Remove unused callback upon database registration * Remove conf file related errors from error.c/alpm.h Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05Add a parseconfig to the pacman frontend that compilesDan McGee1-1/+1
Warning: this compiles but may not work as intended quite yet. :) Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05Move functions out of alpm.c to where they belongDan McGee1-908/+3
alpm.h is the only "publically viewable" file, so there is no reason to have functions in alpm.c that belong in package.c, db.c, etc. Move the functions where they belong and leave only the library init functions in alpm.c. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04Start moving hardcoded paths out of libalpmDan McGee1-12/+3
Move the defaults for RootDir, CacheDir, DBPath, and LockFile into pacman.conf, just as LogFile was done before. Add a section to alpm_parse_config to look for a LockFile directive. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-01Change -z|--showsize flag to ShowSize pacman.conf optionNathan Jones1-0/+3
Also cleaned up some duplicate printf lines related to the ShowSize option. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-31alpm_parse_config(): ignore #.*$, not just ^#.*$VMiklos1-0/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-31Move DB and cache dirs away from there dependence on ROOTDIRDan McGee1-17/+13
This change allows us to use all autoconf specified paths, most notably $(localstatedir). It is quite a change and touches a lot of files, as all references to the DB and cache were done with the ROOTDIR as a prefix. * add --lock command-line option to pacman to specify the location of the lockfile (this can now be specified at configure time by setting the $localstatedir path). * Rip quite a few settings out of configure.ac as they are now picked by setting the paths during configure or make. * Fix bug with /tmp fallback for sync downloads not working correctly (related to root location, now the system tmp dir is used). * Simplified the parameters to some libalpm functions, and added get/set for the new lockfile option. * Renamed several of the DEFS to names without the PM_ prefix. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-18Allow $repo expansion in 'Server' config linesAaron Griffin1-11/+15
Small change (addition of a 'strreplace' function) which replaces any $repo tokens found in a server line with the name of the repo or section being processed. While this is more simplistic than suggestions on flyspray, it works and I think it is cleaner. Merits can be discussed further. Ref: FS#6389 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-04-28Remove FREEPKG macro and correctly type _alpm_pkg_freeDan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-28Remove FREEHANDLE macro and correctly type _alpm_handle_freeDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-27Remove FREESYNC macro and correctly type _alpm_sync_freeDan McGee1-1/+6
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-27Remove FREETRANS macro and correctly type _alpm_trans_freeDan McGee1-7/+3
Remove an unnecessary macro, and get rid of the void pointer. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-27Clean up gettext on the libalpm sideDan McGee1-1/+0
Remove inclusion of libintl.h from all files, because we can do it once in util.c where the _() macro is defined. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-25add.c and remove.c cleanupDan McGee1-2/+2
Unification and cleanup of the add.c and remove.c code. It looks remarkably similar, so this may be a candidate for functionalization at a later time. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-04Backport changes from 3.0.1Aaron Griffin1-16/+25
* Align makepkg -g checksums (Tom Killian <tom@archlinux.org>) * Use additional case-sensitive string compare to defeat locale issues (tr_TR) * Added Russian mirror * Fix a -R failure when trying to remove the same target twice * Bump configure.ac version to 3.0.1 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-03-29Doxygen fixups for libalpmDan McGee1-0/+7
We haven't done a whole lot with Doxygen so far, so this updates some of the things that have changed a lot- namely, the now public exposure of alpm_list. All functions in this file have now been Doxygen commented, and a few other things in alpm.c were fixed as well. In addition, the Doxygen config file was updated. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-11* Fix group comparison issue and associated compilation warnings by usingDan McGee1-1/+1
the alpm strcmp operation which takes void* references. * We had this great visibility patch, but never actually took advantage of it. Added the right compile flag to make it work and added some more SYMEXPORTs where necessary to have a successful compile.
2007-03-06* Added missing header include guards in md5.h and sha1.h.Dan McGee1-1/+1
* Some header cleanup on the pacman side of things - we had alpm.h instead alpm_list.h in a few headers. * removed an extra slash in path-building snprintf in server.c.
2007-03-05This commit looks much more monumental than it is. Almost all just #includeDan McGee1-4/+6
reordering and adding ones that were forgotten (noticed when trying to compile after reordering). * Updated the HACKING file to include information on #include usage. * print -> vprint in "making dir" function in pactest.
2007-03-05* Failure to #include config.h cost us here, we lost all NLS in alpm.c.Dan McGee1-0/+1
2007-03-04* Fixed a whole mess of extra '/' pathing issues when a different root isAaron Griffin1-2/+2
specified * Use db->path when appropriate * Commented out the FAKEROOT checks in libalpm. This should never ever be done. TODO test this quite a bit, as this will never cause the transactions to fail if RW operations are requested... right now it is totally up to the front end to decide when to fail * Use realpath() to canonicalize the root path when specified, so _alpm_makepath() doesn't freak out * Fixed some output/indent of MDFile and SHAFile algorithms * More efficient sprintf() usage in MDFile/SHAFile * Added real error output to _alpm_makepath
2007-03-03Big commit this time:Aaron Griffin1-56/+50
* Moved entirely to alpm_pkg_get_* accessors, to read data on demand * Mostly removed the INFRQ_ parameters from outside the be_files backend (making the backend more extensible in the long run) * packages created from _alpm_db_scan now have the db and origin set (making accessors actually work for these packages) * removed _alpm_db_ensure_pkgcache * totally revamped the _alpm_checkconflicts function, making it cleaner and easier to read (and thus fix in the long run) - maintainable code ftw NOTE: feel free to rename the functions... I couldn't think of anything better * removed an extra loop in sync.c:find_replacements - no sense in looping over an entire DB while strcmp'ing the name, when we have get_pkgfromcache Other: * package struct "license" -> "licenses" * Created _alpm_sync_find (duplicate code in some places, find_pkginsync * Minor const correctness changes along the way * fixed a couple extra '/' pathing issues (non-issues really) * removed a duplicate pkg_cmp function
2007-03-01* Modified values of INFRQ_* options so we start at 0x01 and not 0x00. ThisDan McGee1-4/+4
allows for the same bit operators to be used across the board on pkg_get operations. * Changed name of INFRQ_NONE -> INFRQ_BASE to more clearly reflect what it does (loads pkg name and version). * Added a few missing things on package functions, such as SYMEXPORT and ALPM_LOG_FUNC. * Slight updates to pmenv to print 'pass' and 'fail' instead of 'passed' and 'failed'. Keeps output a bit more concise. * Fixed a doxygen comment spelling error. :P
2007-02-26* Enforce const char* params when using stringsAaron Griffin1-4/+4
* Unified some functions names "package" -> "pkg" for consistency * Removed the goofy 'faketarget' stuff used for dep testing * Renamed alpm_pkg_isin -> alpm_pkg_find * Renamed alpm_db_readpkg -> alpm_db_get_pkg
2007-02-14* Removed needless checking of package infolevel- leave it to theDan McGee1-16/+6
alpm_pkg_get functions to do this.
2007-02-13Removed desc_localized for the time being. We don't have localizedAaron Griffin1-0/+1
descriptions, nor do we actually build them with the newest makepkg. The actual implementation in here seems like it could be done better, and it soaks a large amount of CPU time according to profilers.
2007-02-12* Updated the README fileAaron Griffin1-4/+2
* Removed the handle->needles param. It's not needed not that alpm_list_t is public
2007-02-10* 'add' percentages now cap at 100% (see the comment)Aaron Griffin1-4/+5
* downloaded packages now pass ONLY the package name to the callback
2007-02-09* Fix compile errors/warnings.Dan McGee1-1/+0
* Update .cvsignore files a bit.
2007-02-09* I made "alpm_versioncmp" public a while back, without noticing this was ↵Aaron Griffin1-20/+2
already done (alpm_pkg_vercmp). I dropped this change, making versioncmp "private" again. (alpm_versioncmp -> _alpm_versioncmp, hidden symbol) * Make alpm_get_upgrades use the same version check that -Su and -S use.
2007-02-07Spruced up the TODOs a bit, got rid of some of them since a lot of it wasDan McGee1-13/+11
duplicate anyway. Also removed the last of the ORE tags and replaced them with TODOs.
2007-02-07Copy/pasta error in alpm_get_upgrades that caused a segfaultAaron Griffin1-1/+1
2007-02-04Implemented a crappy version of -Qu (query upgrades). This simply outputs theAaron Griffin1-0/+154
packages to be upgraded in a -Su operation. Much of the code is duplicated from sync.c. TODO: move the implementation to upgrades.c, and reimplement the sync_sysupgrade function in terms of this: trans->packages = alpm_get_upgrades();
2007-01-31Debug logging changes:Aaron Griffin1-17/+7
* The --debug params were goofy. New setup allows --debug without params, --debug=<level> where level 1=debug output, 2=debug and download output, 3=debug, download, and function tracing output. This seems more sane to me. * Removed PM_LOG_FLOW1 and PM_LOG_FLOW2. They were just confusing. When adding new functions, it is near impossible to determin if your output should be "flow1" or "flow2" without tracking all the way up the call chain. Rarely would one ever say "ok, lets just show "flow2" output. These have both been replaced with PM_LOG_DEBUG * Removed the need for the root parameter on alpm_initialize. it is now defaulted to PM_ROOT just like dbpath and cachedir. This allows alpm to be initialized BEFORE option parsing in the front end, saving us some duplicate variables in the frontend. * Cleaned up front end variables due to early alpm_initialize call.
2007-01-30K. Piche <kevin.piche@cgi.com>Aaron Griffin1-0/+52
* ALPM_LOG_FUNCTION macro and all the great work to add this macro everywhere
2007-01-30K. Piche <kpiche@rogers.com>Aaron Griffin1-27/+27
* gcc visiblity changes Also modified _alpm_versioncmp -> alpm_versioncmp (public function) as per K. Piche's suggestions
2007-01-30Discussed on IRC for a bit, this makes the following changes for clarity:Dan McGee1-1/+1
* alpm_list_is_in --> alpm_list_find * alpm_list_is_strin --> alpm_list_find_str * Flip parameters of both functions to be inline with rest of alpm_list. First commit, woohoo.
2007-01-26Dan McGee <dpmcgee@gmail.com>Aaron Griffin1-2/+2
* Lots of code cleanup, and type fixes * Make 'makeworld' a bit more in-line with the other stuff * Make -Si and -Qi operations appear the same
2007-01-24This mainly deals with code clarity- removing currently unneededAaron Griffin1-2/+4
optimizations in order to make the code much more readable and type-checkable. Every enum in the library now has it's own type that should be used instead of the generic 'unsigned char'. In addition, several #define statements dealing with constants were converted to enums. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2007-01-19Preliminary checkin for alpm_list conversionAaron Griffin1-89/+14
* renamed pmlist_t -> alpm_list_t * made alpm_list_t a public type (alpm_list.h header) * removed additional storage for registered DBs in pacman source * some code cleanup * removed duplicate (pm)list_display functions from pacman source * misc code cleanup
2007-01-18Dan McGee <dpmcgee@gmail.com>Aaron Griffin1-1/+1
* Removed some unnecessary headers and library links * Made things static if possible * Cleaned up makefiles a bit * Fixed some old comments in the code * Fixed some errors the static code checker splint pointed out * Backwards arguments in a memset call in _alpm_db_read (could have been worse) * Other various small fixes Other: * Default to 80 columns when getcols cannot determine display width * Removal of ._install as a valid install file in packages