summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
Commit message (Collapse)AuthorAge
* Add gcc format attribute to _alpm_log, catch a few bugs in the processDan McGee2007-10-08
| | | | | | | This fixed a few of our formatted output strings that were broken before but never being checked. Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm: add newlines to all strings passed to log callbackDan McGee2007-08-23
| | | | | | | | | This allows us to remove the hack in the frontend where we added a newline to everything coming out of the pm_printf functions, and instead let the developer put newlines where they want them. This should be the last hangover of that auto-newline stuff. Signed-off-by: Dan McGee <dan@archlinux.org>
* Post trial install changes, round oneDan McGee2007-08-21
| | | | | | | | | | | | | | A bunch of changes related to my first "real" install of pacman-git into /usr/local and trying to use it. * Shift some uses of free -> FREE in libalpm. * Move stat and sanity checks of config paths into libalpm from the config and argument parsing in pacman.c. * Fix issue where dbpath still was not defined early enough due to its requirement for being used in alpm_db_register. This should be rewritten so it doesn't have this dependency, but this will work for now. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix for FS 6404 and functionalize some cachedir handling stuffDan McGee2007-08-20
| | | | | | | | | In order to best resolve bug 6404, move some cachedir handling stuff out of sync.c and into util.c and create two new functions: filecache_find and filecache_setup. sync.c was rewritten to use these, and alpm_fetch_pkgurl now also uses these routines. Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm/sync.c : don't go back on STATE_PREPARED when committing fails.Chantry Xavier2007-08-17
| | | | | | | | In my opinion, a commiting transaction that failed isn't equivalent to a prepared transaction. Some things could have been done in the meantime. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Clean up MD5 code.Andrew Fyfe2007-08-16
| | | | | | | | | | | | | | * Move alpm md5 functions to lib/libalpm/util.c * Remove unneeded includes for md5.h * Replace md5 implementation with one from http://www.xyssl.org Dan: clean up XySSL code by removing parts we don't use, and add a note saying what changed. Dan: fix alpm_get_md5sum, off by one error on the malloc call and other small things. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove support for SHA1 from pacman.Andrew Fyfe2007-08-16
| | | | | | | | There's no need for a second hashing algorithm. MD5 serves the purpose of verifying that a package file hasn't been corrupted during download. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> Signed-off-by: Dan McGee <dan@archlinux.org>
* package.h: implement origin_data union in pmpkg_t structDan McGee2007-08-14
| | | | | | | | | | We were using a void *data element in pmpkg_t before, which is unsafe by its nature of being untyped. Reimplement data as origin_data being a union that can hold either a path to a package file or a pointer to a cache database, and make the other necesary updates in the code to reflect this. See package.h for details. Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm/sync.c : two memleak fixes in _alpm_sync_prepare.Nagy Gabor2007-07-20
| | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* libalpm/sync.c : fix DEPENDSONLY flag handling.Chantry Xavier2007-07-20
| | | | | | | | | | | | I didn't like the patch proposed by Nagy for the sync1002 pactest here: http://www.archlinux.org/pipermail/pacman-dev/2007-July/008971.html So here is another attempt of fixing it. In case of the DEPENDSONLY flag : 1) pass an empty list to resolvedeps instead of the list of targets 2) empty the trans->packages targets list before adding the resolved deps. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Add --asdeps option to pacmanDan McGee2007-07-15
| | | | | | | | | | This replaces the former -D operation that was undocumented and rather hacky. It can be used with add, upgrade, or sync transactions and will affect all packages installed. Should close FS #7193. Also tell makepkg to use this new flag. Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm/deps.c : cleanup + little fix for resolvedeps.Nagy Gabor2007-07-15
| | | | | | | | The resolvedeps function was a bit negligent, as showed by the sync011 pactest. Reference : http://www.archlinux.org/pipermail/pacman-dev/2007-July/008782.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* libalpm/sync.c : ldconfig is run twice.Nagy Gabor2007-07-14
| | | | | | | | | | | | remove _alpm_ldconfig call from _alpm_sync_commit, since sync operation causes an upgrade transaction, where ldconfig is already run. Reference: http://www.archlinux.org/pipermail/pacman-dev/2007-April/008132.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove versioncmp.{c,h}, clean up selective #ifdefsDan McGee2007-07-12
| | | | | | | | | 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>
* Remove gettext calls from all PM_LOG_DEBUG messagesDan McGee2007-07-10
| | | | | | | 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>
* Remove gettext from any alpm_logaction callsDan McGee2007-07-09
| | | | | | | 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>
* Remove unnecessary and extra includesDan McGee2007-07-01
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unnecessary trans parameter from _alpm_checkdepsNagy Gabor2007-06-26
| | | | | | | 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>
* Attempt to clean up _alpm_sync_prepareDan McGee2007-06-10
| | | | | | | | | | 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>
* Ensure correct and consistent usage of depmissChantry Xavier2007-06-10
| | | | | | | | | 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>
* Allow multiple CacheDirs to be specifiedDan McGee2007-06-09
| | | | | | | | | 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>
* Const correctness!Dan McGee2007-06-05
| | | | | | | | | 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>
* Remove freespace checking codeDan McGee2007-06-02
| | | | | | | | 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>
* Move DB and cache dirs away from there dependence on ROOTDIRDan McGee2007-05-31
| | | | | | | | | | | | | | | | | | | 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>
* Remove unnecessary casts on malloc and elsewhereDan McGee2007-05-14
| | | | | | | | | 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>
* Fix IgnorePkg handling with replacement packagesAaron Griffin2007-05-09
| | | | | | | | 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>
* libalpm util.c and util.h cleanupDan McGee2007-04-29
| | | | | | | | | | * 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>
* Remove STRNCPY macro from libalpmDan McGee2007-04-29
| | | | | | | Replaced calls to the STRNCPY macro with the actual strncpy function, and pacman passes all pactests. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove FREELISTPTR macroDan McGee2007-04-28
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove FREEPKG macro and correctly type _alpm_pkg_freeDan McGee2007-04-28
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove FREEGRP macro and correctly type _alpm_grp_freeDan McGee2007-04-27
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove FREESYNC macro and correctly type _alpm_sync_freeDan McGee2007-04-27
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove FREETRANS macro and correctly type _alpm_trans_freeDan McGee2007-04-27
| | | | | | Remove an unnecessary macro, and get rid of the void pointer. Signed-off-by: Dan McGee <dan@archlinux.org>
* Clean up gettext on the libalpm sideDan McGee2007-04-26
| | | | | | | 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>
* Fix --ignore behavior on sysupgradeDan McGee2007-03-28
| | | | | | | | * --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>
* * Fix asking the user to upgrade when using -SpAaron Griffin2007-03-21
| | | | | | * 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
* * Fix pacman -Se which installs depends only, as it was brokenAaron Griffin2007-03-20
| | | | (Is this useful to anyone?)
* This commit looks much more monumental than it is. Almost all just #includeDan McGee2007-03-05
| | | | | | | | 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.
* * Fixed a whole mess of extra '/' pathing issues when a different root isAaron Griffin2007-03-04
| | | | | | | | | | | | | | 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
* * Maybe that call to _alpm_trans_update_depends was necessary. Added it backDan McGee2007-03-04
| | | | in but did it right by duplicating the package first.
* Big commit this time:Aaron Griffin2007-03-03
| | | | | | | | | | | | | | | | | | | | | | | * 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
* * Modified values of INFRQ_* options so we start at 0x01 and not 0x00. ThisDan McGee2007-03-01
| | | | | | | | | | | | 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
* * Enforce const char* params when using stringsAaron Griffin2007-02-26
| | | | | | | * 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
* * Too much debugging output in the alpm_pkg_compare_versions functionAaron Griffin2007-02-23
| | | | * Using the wrong info level for replacements
* * Modified the handling and output w.r.t. IgnorePkg entries. -Sy always ignoresAaron Griffin2007-02-23
| | | | these packages, but -S explicitly asks for confirmation.
* * Re-added a compare function for syncpkg's - it was removed without thinkingAaron Griffin2007-02-21
| | | | | | | | | | | | | | | 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 **
* * Refactored conflict checking within packages. Profiling from Dan showed anAaron Griffin2007-02-13
| | | | | | | | 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.
* Cleanup and more debug info for alpm_pkg_compare_versionsAaron Griffin2007-02-07
|
* Attempt to unify the -S and -Su version comparissons for when a package is newerAaron Griffin2007-02-06
| | | | See FS#5388
* Implemented a crappy version of -Qu (query upgrades). This simply outputs theAaron Griffin2007-02-04
| | | | | | | | 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();