summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/util.h
AgeCommit message (Collapse)AuthorFilesLines
2007-10-08Update usage of gcc __attribute__ flagsDan McGee1-1/+1
Change the default visibility of libalpm functions to internal instead of hidden- this allows for slightly better optimization because it tells GCC that the function can never be called outside of the current module (see http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html). Also added some attributes to the pacman print functions so that they check the format strings being passed to them. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-23alpm: removed unused strtoupper wrapper, remove installeddate on parse_descfileDan McGee1-1/+0
installdate should never be present in a package descfile, so get rid of it. With the last commit, we also don't need the util strtoupper function. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-06Add a few missing includes, caught while compiling on cygwinDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-20Fix for FS 6404 and functionalize some cachedir handling stuffDan McGee1-0/+2
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>
2007-07-12Remove versioncmp.{c,h}, clean up selective #ifdefsDan McGee1-3/+5
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-06-27Remove scriptlet START and DONE commands that we don't useDan McGee1-4/+0
The scriptlet calling had some unneeded complexity for the time being which we aren't using here. Let's get rid of it until we find a good way to implement it correctly. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09Remove logmask stuff from backend; switch logging callback to new pm_printfDan McGee1-1/+1
Remove the logmask functionality from the backend as it has been moved to the frontend, and change the logging callback function to use pm_printf. In addition, make much better use of va_list- use the args list instead of a arbitrarily chosen string to print to in the logging functions. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-31Move DB and cache dirs away from there dependence on ROOTDIRDan McGee1-2/+2
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-0/+1
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-29libalpm util.c and util.h cleanupDan McGee1-13/+1
* 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-5/+1
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-26Clean up gettext on the libalpm sideDan McGee1-5/+2
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-03Big commit this time:Aaron Griffin1-7/+9
* 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 McGee1-0/+1
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 Griffin1-0/+2
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-30K. Piche <kpiche@rogers.com>Aaron Griffin1-0/+4
* gcc visiblity changes Also modified _alpm_versioncmp -> alpm_versioncmp (public function) as per K. Piche's suggestions
2007-01-24This mainly deals with code clarity- removing currently unneededAaron Griffin1-1/+1
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-1/+1
* 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-17* Misc logging changesAaron Griffin1-1/+1
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 Griffin1-1/+0
* 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 Griffin1-2/+2
* 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-15* Initial changes to gensync - makepkg changes were not checked in from anotherAaron Griffin1-1/+0
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 Griffin1-0/+1
* 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 Griffin1-0/+1
* 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 Griffin1-1/+1
from db to whatever format we need.
2006-10-20A handful of minor changes:Aaron Griffin1-1/+1
* 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 Griffin1-4/+29
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 Vinet1-1/+5
2006-05-15first stage of i18n stuff from VMiklosJudd Vinet1-0/+2
2006-02-20dropped the MALLOC macroAurelien Foret1-11/+0
2006-02-16- grep is now a static functionAurelien Foret1-1/+0
- code cleanup
2006-01-09- merged pkg_new and pkg_dummy functionsAurelien Foret1-1/+1
- renamed _alpm_log_action to _alpm_logaction
2006-01-02patch from VMiklos - use PACKAGE_VERSION instead of PACMAN_VERSIONJudd Vinet1-1/+1
2005-03-29Replaced snprintf calls by the SNPRINTF macro to avoid buffer overflows when ↵Aurelien Foret1-0/+5
copying strings
2005-03-15Initial revisionJudd Vinet1-0/+57