Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
AgeCommit message (Collapse)Author
2007-07-12Remove versioncmp.{c,h}, clean up selective #ifdefsDan McGee
Remove versioncmp.c by moving all functions to locations that make sense. Move replacement functions (for building without glibc) into util.c where they belong, and do proper checks for them instead of using __sun__, etc. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-10Remove gettext calls from all PM_LOG_DEBUG messagesDan McGee
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-09Remove gettext from any alpm_logaction callsDan McGee
We shouldn't translate log messages to pacman.log so it is consistant and can be parsed by other tools. Remove all gettext _() around these strings. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-01Remove unnecessary and extra includesDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-26Remove unnecessary trans parameter from _alpm_checkdepsNagy Gabor
The trans parameter was never used, so remove it. Signed-off-by: Nagy Gabor <ngaba@petra.hos.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10Attempt to clean up _alpm_sync_prepareDan McGee
This function is an absolute disaster, so we'll take it one step at a time here. This was a quick once-over of the whole thing, trying to straighten out some of the spaghetti code and fix some mistakes that others found. We are now down to two failing pactests again: sync300 and upgrade051. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10Ensure correct and consistent usage of depmissChantry Xavier
See comment from Nagy here : http://www.archlinux.org/pipermail/pacman-dev/2007-April/008134.html This also makes easier correct usage of checkdeps in sync.c, which fixes sync901 pactest (and so bug 6057). Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09Allow multiple CacheDirs to be specifiedDan McGee
This should hopefully allow multiple cache dirs to be specified in pacman.conf and/or on the command line, and allow pacman to test each one for the package file. The first one found to be writeable is used as the download cache. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05Const correctness!Dan McGee
Add some 'const' keywords all over the code to make it a bit more strict on what you can and can't do with data. This is especially important when we return pointers to the pacman frontend- ideally this would always be untouchable data. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-02Remove freespace checking codeDan McGee
This code depends on /etc/mtab existance, which is not very reliable in all cases, especially in a chroot or non-Linux environment. Dump it for now until we can find a better way. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-31Move DB and cache dirs away from there dependence on ROOTDIRDan McGee
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-14Remove unnecessary casts on malloc and elsewhereDan McGee
We had many unnecessary casts, most of them dealing with malloc and other memory allocations. The variable type should take care of it; no need to do it explicitly. In addition, I caught a const error while removing the casts. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-09Fix IgnorePkg handling with replacement packagesAaron Griffin
Allow IgnorePkg (or --ignore) to work for _either_ side of a replacement. For example, if 'foo' is set to replace 'bar', ignoring either package will skip this replacement. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-04-29libalpm util.c and util.h cleanupDan McGee
* Remove some unnecessary conditional compiling in util.h- move the functions tha required it to trans.c (along with a bunch of new header includes). * Clean up util.h a bit- remove some header includes, remove universal libarchive include and only put it in the files that need it. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-29Remove STRNCPY macro from libalpmDan McGee
Replaced calls to the STRNCPY macro with the actual strncpy function, and pacman passes all pactests. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-28Remove FREELISTPTR macroDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-28Remove FREEPKG macro and correctly type _alpm_pkg_freeDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-27Remove FREEGRP macro and correctly type _alpm_grp_freeDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-27Remove FREESYNC macro and correctly type _alpm_sync_freeDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-27Remove FREETRANS macro and correctly type _alpm_trans_freeDan McGee
Remove an unnecessary macro, and get rid of the void pointer. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26Clean up gettext on the libalpm sideDan McGee
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-03-28Fix --ignore behavior on sysupgradeDan McGee
* --ignore was being ignored (haha) on sysupgrade when a package was listed as being a force upgrade. This adds a prompt to the user in this case asking what to do. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-21* Fix asking the user to upgrade when using -SpAaron Griffin
* More significant error messages when -Qo fails * Potential fix for reported error that pacman indicates corrupt packages when space is full on the cache dir
2007-03-20* Fix pacman -Se which installs depends only, as it was brokenAaron Griffin
(Is this useful to anyone?)
2007-03-05This commit looks much more monumental than it is. Almost all just #includeDan McGee
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-04* Fixed a whole mess of extra '/' pathing issues when a different root isAaron Griffin
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-04* Maybe that call to _alpm_trans_update_depends was necessary. Added it backDan McGee
in but did it right by duplicating the package first.
2007-03-03Big commit this time:Aaron Griffin
* 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 McGee
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 Griffin
* 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-23* Too much debugging output in the alpm_pkg_compare_versions functionAaron Griffin
* Using the wrong info level for replacements
2007-02-23* Modified the handling and output w.r.t. IgnorePkg entries. -Sy always ignoresAaron Griffin
these packages, but -S explicitly asks for confirmation.
2007-02-21* Re-added a compare function for syncpkg's - it was removed without thinkingAaron Griffin
properly * Error when re-reading the DB for replacements, wrong info level * Removed an duplicate debug message "checking for package replacements" * Check ignorepkg for REAL upgrades... * Properly check the NOSAVE flag * some unlink_file (remove.c) cleanup * fix indent level on handle.c * Force libalpm paths to end with a '/' char * Fixed 'target' looping in conflict.c (pmsyncpkg_t, not pmpkg_t) * Added some debug output to cache and db scanning ** All pactest tests succeed again, yay **
2007-02-13* Refactored conflict checking within packages. Profiling from Dan showed anAaron Griffin
unbelievable amount of strcmp() calls (25 million) due to the list searching. This has been reimplemented with a set-intersection scheme, due to the fact that file lists are always ordered. - NEEDS TESTING * Minor clean up, "globalized" the str_cmp helper to match the alpm comparison signature, so we can use it elsewhere.
2007-02-07Cleanup and more debug info for alpm_pkg_compare_versionsAaron Griffin
2007-02-06Attempt to unify the -S and -Su version comparissons for when a package is newerAaron Griffin
See FS#5388
2007-02-04Implemented a crappy version of -Qu (query upgrades). This simply outputs theAaron Griffin
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-02-01* Minor output fix (move colon so it's not part of the URL)Aaron Griffin
* Added ldconfig on --sync operations too
2007-01-31Debug logging changes:Aaron Griffin
* 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 Griffin
* ALPM_LOG_FUNCTION macro and all the great work to add this macro everywhere
2007-01-30K. Piche <kpiche@rogers.com>Aaron Griffin
* 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 McGee
* 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-24This mainly deals with code clarity- removing currently unneededAaron Griffin
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 Griffin
* 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 Griffin
* 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
2007-01-03* bug fix FS#6100 - fix --print-uris outputAaron Griffin
2007-01-02* Missing error label in sync.cAaron Griffin
* Additional debug output for db_write
2006-12-29* Removed latest fix from TODO.autoconfAaron Griffin
* Attempted fix for FS#6100 - "-Spd foo" failure * Beginning of refactoring from Dan McGee <dpmcgee@gmail.com>
2006-12-22Cleanup from Dan McGee <dpmcgee@gmail.com> and Jürgen Hötzel ↵Aaron Griffin
<juergen@hoetzel.info> * configure swig check * misc libalpm cleanup
2006-12-01* Cosmetic changes and typo fixesAaron Griffin
* IgnorePkg and --ignore work again * Partial changes to support removal of conflicts for -U and -A (INCOMPLETE)