summaryrefslogtreecommitdiff
path: root/lib/libalpm/util.c
AgeCommit message (Collapse)Author
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-02-14* strlen -> mbstowcs (multibyte str to wide char str) conversion where weDan McGee
want the actual number of characters, not the number of bytes. * Added a TODO to take care of later in scriptlet processing.
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-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-30* Remove -fno-strict-aliasing as it is now unnecessary to compile.Dan McGee
* Fix up add.c a bit better than it was in regards to FS #3492. * Optimized the sqrt call in dependency cycle checking to a single call. * Removal of an outdated comment.
2007-01-26* Fix FS #3107- Use ISO date styleAaron Griffin
* Fix FS #5409- document that pacman.conf repo ordering is important Signed-off-by: Dan McGee <dpmcgee@gmail.com>
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-17* Misc logging changesAaron Griffin
Addition of a forced fflush in an attempt to diagnose mutli-logging Removal of varargs from the internal logaction function, they are handled in alpm_logaction just fine
2007-01-17Jürgen Hötzel <juergen@hoetzel.info>Aaron Griffin
* avoid repeated regex compilations (regex for search string do not change while scanning the package database) * remove needless string duplication (regex function do not change target string nor free them) * code cleanup This patch improves search performance: bash-3.2$ time ./src/pacman/pacman.static.old -Ss "(database|web).*server" >/dev/null real 0m1.026s user 0m0.544s sys 0m0.208s bash-3.2$ time ./src/pacman/pacman.static -Ss "(database|web).*server" >/dev/null real 0m0.777s user 0m0.456s sys 0m0.128s bash-3.2$
2006-11-22* Completed getinfo api changes (pmmissing_t, pmtrans_t, etc)Aaron Griffin
* Modified some dependancy checking * Changed "performing local database upgrade" message to be more clear * Change 'usize' to 'isize' in database files * Scriptlet output is now sent to pacman's log file * Limited some debugging output to be more clear
2006-11-20* repo-add script - to add entries to a db file directly from package data ↵Aaron Griffin
(no PKGBUILD) * libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a typesafe _get_what_we_want(p) scheme [not 100% complete yet] * some const correctness changes * removal of PM_* types in alpm.h in favor of the pm*_t types used throughout libalpm
2006-11-16* makepkg.conf.in variable changes (missed the checkin)Aaron Griffin
* Better error reporting when unpacking an archive fails * Fixed -Sc and -Scc cache dir opening/reading
2006-11-15* Initial changes to gensync - makepkg changes were not checked in from anotherAaron Griffin
machine - still pending * Addition of _alpm_pkg_makefilename to simplify the with/without -ARCH prefix scheme we're going with for the interim
2006-11-14* Numerous mini valgrind fixes.Aaron Griffin
* Addition of hacky architecture check in the _splitname function * Removal of libfetch from the archlinux proper - it has been renamed to libdownload and can be found at http://phraktured.net/libdownload * Merge of _some_ of the Frugalware makepkg change - this may still be incomplete * Removal of libftp from cvs proper * PKGBUILD manpage now says 'PKGBUILD' instead of FrugalBuild (he he)
2006-10-31Numerous changes:Aaron Griffin
* Furthered the "lazy caching" to force the pkgcache to read nothing (INFRQ_NONE) by default. Anything requiring package data should now check the infolevel of each package and attempt to update it. This could be ironed out a bit more later (by using the front-end get_info function * Switched to libfetch. Drastic changes to the download code and the callback progress bar functions. Also fixed the return value of _alpm_downloadfiles_forreal. Downloading now supports http, ftp, https, and files urls, along with 'mtime's and numerous other fancy features from libfetch.
2006-10-25Moved downloaded db unpacking to the backend files, to easier allow conversionAaron Griffin
from db to whatever format we need.
2006-10-20A handful of minor changes:Aaron Griffin
* Removed the PMList typedef, in favor of the same naming scheme other structs use 'pmlist_t' * Added a time stamp on debug output, to make it more informational * Moved alpm_db_register to _alpm_db_register, making the public function not take a callback parameter
2006-10-15Merged frugalware changes (too many to list). Also added some config fileAaron Griffin
handling changes (support [sections] to carry over to included files - this helps with backwards compatibility with existing pacman config files)
2006-09-28removed libtar support in favour of libarchiveJudd Vinet
2006-05-15first stage of i18n stuff from VMiklosJudd Vinet
2006-02-16fixed directory roots when running scripletsAurelien Foret
2006-02-16- grep is now a static functionAurelien Foret
- code cleanup
2006-01-26reworked lock handling (patch from VMiklos <vmiklos@frugalware.org>)Aurelien Foret
2006-01-09- merged pkg_new and pkg_dummy functionsAurelien Foret
- renamed _alpm_log_action to _alpm_logaction
2006-01-07code cleanup (mainly removed line spaces at the beginning of lines by ↵Aurelien Foret
tabulations)
2006-01-02patch from VMiklos - use PACKAGE_VERSION instead of PACMAN_VERSIONJudd Vinet
2006-01-01- fixed a regression with pacman 2.x (patch from VMiklos ↵Aurelien Foret
<vmiklos@frugalware.org>) - code reowrk to ensure the /tmp/alpm_foo directory is always removed
2005-11-05Used the chroot syscall instead of the chroot binaryAurelien Foret
(patch from Christian Hamaer <krics@linuxforum.hu>)
2005-10-09added conversation callback support for transactionsJudd Vinet
2005-10-07Merging in recent fixes/additions from 2.9.7Judd Vinet
2005-10-06Added a CYGWIN define to include header files required to build in a Cygwin ↵Aurelien Foret
environment
2005-10-05Applied reworked patch from VMiklos (vmiklos@frugalware.org)Aurelien Foret
Close the lock file descriptor upon handle release
2005-04-24fixed some potential resource leaksAurelien Foret
2005-03-29fixed a log maskAurelien Foret
2005-03-29backport from pacman 2.9.5 - chdirAurelien Foret
2005-03-29put back 5 _alpm_log() callsAurelien Foret
2005-03-29Replaced snprintf calls by the SNPRINTF macro to avoid buffer overflows when ↵Aurelien Foret
copying strings
2005-03-28improved logs (use _alpm_log instead of fprintf)Aurelien Foret
2005-03-26More backport from pacman 2.9.5 (mainly for resolvedeps)Aurelien Foret
2005-03-26updated commentsAurelien Foret
2005-03-25backported fixes for trim() from pacman 2.9.5Aurelien Foret
2005-03-19Rework for fixed length stringsAurelien Foret
2005-03-16Code reformattingAurelien Foret
2005-03-15Initial revisionJudd Vinet