summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/package.c
AgeCommit message (Collapse)AuthorFilesLines
2007-05-31Move DB and cache dirs away from there dependence on ROOTDIRDan McGee1-3/+3
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-18Fix extraneous "ignoring upgrade" output on Ignore'd packagesChantry Xavier1-6/+8
Reorder package version checking so there is no output when a package is listed in IgnorePkg. Closes FS#7111 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-05-14Use alpm_depcmp in _alpm_pkg_update_requiredbyNagy Gabor1-28/+13
The old function did too much on its own; let alpm_depcmp do the hard work. This will allow for future versioned provisions if necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-14Remove unnecessary casts on malloc and elsewhereDan McGee1-2/+2
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-04-29libalpm util.c and util.h cleanupDan McGee1-0/+4
* 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 McGee1-16/+16
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 'removes' array from libalpmDan McGee1-18/+0
We don't use this functionality for now, so get rid of it and the functions associated with it. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-28Remove FREEPKG macro and correctly type _alpm_pkg_freeDan McGee1-6/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26Clean 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-22Let IgnorePkg superceed the FORCE package flagChantry Xavier1-7/+9
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-03-29Fix a 0 and '/0' switchDan McGee1-1/+1
It looks like someone accidentally put a 0 instead of '/0', this fixes it. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-12* Fix an issue where the same dependency was recorded multiple times in theDan McGee1-9/+18
'required by' field.
2007-03-07* Bug fix for makepkg dependency testing. This requires that weAaron Griffin1-1/+1
expose alpm_splitdep and alpm_depcmp as public symbols * Removed a duplicate strtrim for question responses
2007-03-05This commit looks much more monumental than it is. Almost all just #includeDan McGee1-2/+4
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-03* A little more hacking with wchar_t output, but nothing really changed inDan McGee1-6/+8
it. Eventually we'll make progress. * Rewrote the _alpm_splitdep function to behave more like all our other function calls. Use heap instead of stack allocation for the depend struct, so now it needs to be freed by the caller.
2007-03-03Big commit this time:Aaron Griffin1-28/+39
* 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-3/+21
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-03-01*** empty log message ***Aaron Griffin1-4/+19
2007-02-28* Unifying placement of REPLACES in desc file, as pacman2 does. We'll worryDan McGee1-1/+2
about bigger DB changes later, but lets not screw anything up for release. * Removed some weird uses of "not ... ==" usage in pactest- correct me if I'm wrong, but isn't "!=" a lot more clean and concise? * Print description of failed tests in the pactest summary. This could get dirty with a lot of failed tests though, so watch out.
2007-02-26* Enforce const char* params when using stringsAaron Griffin1-10/+11
* 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* The info level for this was wrong, causing replacements to not really workAaron Griffin1-2/+2
2007-02-23* Too much debugging output in the alpm_pkg_compare_versions functionAaron Griffin1-3/+0
* Using the wrong info level for replacements
2007-02-23* Modified the handling and output w.r.t. IgnorePkg entries. -Sy always ignoresAaron Griffin1-3/+5
these packages, but -S explicitly asks for confirmation.
2007-02-22* Cleaned up some debug outputAaron Griffin1-2/+2
* Fixed a segfault in the conflict checking code * Added an automatic failure in the case of -A/-U for a replacement of an existing package. This requires a large amount of work and is postponed for now. Example: If ncmpc is installed, pacman -U /path/to/ncmpc-svn.pkg.tar.gz will fail with and appropriate error message
2007-02-21* Fixed inconsistency of args- _alpm_db_read, _alpm_db_write.Dan McGee1-24/+24
2007-02-18Moved the update_depends function to trans.c, as it depends on a transactionAaron Griffin1-87/+0
object
2007-02-17* A whole mess of backup changesAaron Griffin1-0/+114
- the code should be clearer, more organized, commented, and have worthwhile variable names now - proactive backup=()s now work. That is, adding a file to a backup array does what it should on the upgrade to that package, no longer forcing you to wait a full upgrade cycle for it to take effect * ldconfig was being run twice on an upgrade operation - fixed * fixed another pm_fprintf/printf output corruption with the progress bars * refactored some duplicate code for adjusting 'requiredby' lists * Added config.rpath to .cvsignore
2007-02-16Added a 'contrib' directory for other stuff that might be a good idea to ↵Aaron Griffin1-2/+0
maintain here. * moved bash_completion from the "archlinux" script in the official bash_completion package * moved zsh_completion from the AUR zsh-pacman package
2007-02-14* Fixed _alpm_pkg_compare_versions so that it does not output warnings if ↵Aaron Griffin1-10/+13
versions match. (reported by Travis Willard)
2007-02-13* Refactored conflict checking within packages. Profiling from Dan showed anAaron Griffin1-0/+4
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-13Removed desc_localized for the time being. We don't have localizedAaron Griffin1-3/+7
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-10* Package file parsing - fixed size and isize - isize is the "size" variableAaron Griffin1-13/+13
from the PKGINFO, and size is the stat() size of the archive * Removed the useless 'output' param from package.c:parse_descfile * Installation progress - Call progress callback once at 0% for initialization - 'needdisp' was useless - alpm_list_count is called an excessive amount in these nested loops. Now we only call it once per iteration - Use the compressed sizes for PROGRESS calcs as uncompressed (isize) is not exact (it is missing metadata sizes), and thus produces > 100% numbers
2007-02-09* Fix compile errors/warnings.Dan McGee1-1/+2
* Update .cvsignore files a bit.
2007-02-09* I made "alpm_versioncmp" public a while back, without noticing this was ↵Aaron Griffin1-1/+1
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-07Only honor 'force' if versions are NOT identicalAaron Griffin1-6/+4
2007-02-07Cleanup and more debug info for alpm_pkg_compare_versionsAaron Griffin1-11/+18
2007-02-06Cleaning up mistakes. :PDan McGee1-1/+1
2007-02-06Attempt #2 at -S/-Su unification: verify that the 'force' option has been ↵Aaron Griffin1-0/+5
read before comparing versions
2007-02-06Copy-pasta errors. 8)Aaron Griffin1-8/+8
2007-02-06Attempt to unify the -S and -Su version comparissons for when a package is newerAaron Griffin1-0/+32
See FS#5388
2007-02-04Implemented a crappy version of -Qu (query upgrades). This simply outputs theAaron Griffin1-0/+11
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-04* Added archive verification when loading package metadata for -u and -AAaron Griffin1-16/+27
operations (now aborts on a corrupt archive) * Fixed the pm_fprintf newline error that was plaguing us. It seems a line resetting 'neednl' was removed a while back (by me). This causes all the output errors we've been seeing
2007-02-01Loading package data from a file was ALWAYS generating the filelist, instead ofAaron Griffin1-17/+22
using the in-package one. This is now fixed, and an autogenerated one is used as a last resort. This fixes the bug where /.CHANGELOG showed up in -Ql.
2007-02-01* !strcmp reads funny (as "not string compare" - switch those to == 0, which hasAaron Griffin1-3/+6
a positive connotation. * Added a nice TODO
2007-01-30K. Piche <kevin.piche@cgi.com>Aaron Griffin1-0/+60
* ALPM_LOG_FUNCTION macro and all the great work to add this macro everywhere
2007-01-30K. Piche <kpiche@rogers.com>Aaron Griffin1-25/+25
* gcc visiblity changes Also modified _alpm_versioncmp -> alpm_versioncmp (public function) as per K. Piche's suggestions
2007-01-24* Shuffled some of the alpm_list free funtions - still not perfect, but betterAaron Griffin1-1/+2
* Added alpm_list_remove_node for single list node removal * Proper error checking/output for failed db_read/db_write (missing files) * Invalid packages (missing files) are now removed from the package cache * -Qs and -Ss output now look the same * config.rpath causes errors on one machine I had, so I added it to CVS * Fixed a "clobbered memory" issue when installing groups - only the outer list should be free'd, not the contained data
2007-01-24This mainly deals with code clarity- removing currently unneededAaron Griffin1-2/+2
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-22* Added a check for .FILELIST for package validity in addition to .PKGINFOAaron Griffin1-0/+3
2007-01-19Moved some decls to make the "pkg_invalid" patch compile again.Aaron Griffin1-6/+9