summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.h
AgeCommit message (Collapse)AuthorFilesLines
2008-02-06pacman/util.c: add mdirname functionDan McGee1-0/+1
This function mirrors mbasename and will be used by the 'owns' machinery. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-11Update GNU GPL boilerplate and copyright datesDan McGee1-3/+1
Update the GPL boilerplate to direct people to the GNU website for a copy of the license, as well as bump all of Judd's copyrights to 2007. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-04Delay output during progress barChantry Xavier1-0/+1
This fixes the output issue related to the progress bar by delaying the output. We can decide later (post-release) if we like this method or we want to switch to something else. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> [Dan: just some minor cleanups] Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-01Unify dump_pkg_full in pacman [-Si, -Qip, -Qi and -Qii]Nagy Gabor1-0/+1
dump_pkg_sync is now a trivial wrapper for dump_pkg_full Some smaller changes: * string_display function added to util.c [prints None in case of empty string] * Filename field added to -Qip * rename License to Licenses * 'Compressed Size' used instead of 'Download Size' for -Qip Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Dan: fix whitespace errors, spacing issues, const modifiers] Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25Move mbasename from pacman.c to util.cChantry Xavier1-0/+1
This function can be useful in other places. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-14Make it easier to ignore multiple packages.Nathan Jones1-0/+1
This makes --ignore and --ignoregroup able to accept multiple packages/groups by separating each with a comma. For instance: pacman -Su --ignore kernel26,udev,glibc This was requested in the comments of FS#8054. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-24Add strndup implemention for environments that are missing itDan McGee1-0/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-23Ensure all localization stuff is correctly guardedDan McGee1-5/+5
Anything dealing with libintl and localization should be correctly guarded inside an ENABLE_NLS block on both the pacman and libalpm sides. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-20Add download size to target list.Nathan Jones1-1/+1
This displays the download size, taking into account delta files and cached files. This closes FS#4182. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-09Update usage of gcc __attribute__ flagsDan McGee1-3/+3
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-28Break out transaction test to a separate functionAaron Griffin1-0/+1
Added needs_transaction, putting out "hey do we need root?" tests in one place. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-06-12pacman util.h: Add missing stdarg.h includeDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09Add a series of pm_printf functions to pacman frontendDan McGee1-0/+3
Add pm_printf, pm_fprintf, and pm_vfprintf to the pacman frontend for use by debug printing and other output messages from pacman. These will be incorporated into the log callback functions in the next iteration of changes. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05Const correctness!Dan McGee1-2/+2
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-05Add a parseconfig to the pacman frontend that compilesDan McGee1-1/+1
Warning: this compiles but may not work as intended quite yet. :) 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-04-27Clean up gettext on the libalpm sideDan McGee1-0/+4
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-27Remove output.c and output.hDan McGee1-4/+5
One function was left in this set of files after the earlier cleansing, so I moved yesno to util.c. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-27Start of the newline fixes after switching over the outputDan McGee1-1/+0
* A few quick newline fixes, mostly related to sync operations. * Moved get_update_timediff to callback.c as it is not used outside of that file. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26Pacman side code consolidation- unify callback functions to one fileDan McGee1-1/+0
Some more major code reorginization here. The download progress callback function has been renamed and moved to callback.c, which is the former trans.c with the download and log callbacks added. In addition, this allows util.c to be cleaned up as fill_progress can now be static in callback.c. We've also cut two more source files out. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26More pacman side cleanupDan McGee1-19/+0
* Cleaned up more of the header #includes, and got rid of a lot of stuff that was due to trying to make it compile on BSD/Darwin/CYGWIN. We can add it later but lets keep it simple for now and do it in seperate files if possible later. * Removed a lot of #define MACROS. Some were not even used, and others were only used a few times. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-25Remove more unnecessary stuffDan McGee1-1/+3
* Remove libintl.h from most files, as we only need to include it once in util.h where _() is defined. * Remove other unnecessary header inclusions. * Remove a macro that was only used once and replaced it with actual code. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-13* Resizing terminal while progress bars were displayed caused some weirdDan McGee1-2/+2
issues, this should fix it. Progress bars now go from displaying, to showing percent only, to not displaying at all. Changed unsigned -> signed to prevent wraparound errors in integer comparison.
2007-03-06* Added missing header include guards in md5.h and sha1.h.Dan McGee1-1/+0
* Some header cleanup on the pacman side of things - we had alpm.h instead alpm_list.h in a few headers. * removed an extra slash in path-building snprintf in server.c.
2007-02-04Implemented a crappy version of -Qu (query upgrades). This simply outputs theAaron Griffin1-1/+1
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* unified the progress bars (fill_progress function)Aaron Griffin1-0/+6
* fixed progress output (needs an fflush to move cursor properly) * broke display_targets function out, to display a list of syncpkgs in preparation for a -Qu option * added get_update_time function to deal with progress functions that shouldn't update too fast due to output redraw speeds
2007-02-01* Tried to clean up newline display a bit in the frontend.Dan McGee1-1/+0
* Removed useless buildstring function from util.h; replaced all calls of it with list_display. * Made list_display output 2 spaces instead of 1 between each item.
2007-01-19Preliminary checkin for alpm_list conversionAaron Griffin1-2/+8
* 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 Griffin1-3/+3
* 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
2006-11-20* repo-add script - to add entries to a db file directly from package data ↵Aaron Griffin1-2/+2
(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-10-15Merged frugalware changes. Added a few other minor things too, but there's alotAaron Griffin1-1/+1
to list. The diff should show you 8)
2006-05-15first stage of i18n stuff from VMiklosJudd Vinet1-0/+2
2006-03-13- removed pacman.hAurelien Foret1-1/+4
- removed unuseful extern declarations - set pacman.c internal functions as static
2006-02-04- moved yesno() from util.c to log.cAurelien Foret1-1/+0
- fixed a missing line feed in yesno when printing the message
2006-01-07code cleanup (mainly removed line spaces at the beginning of lines by ↵Aurelien Foret1-4/+11
tabulations)
2006-01-02patch from VMiklos - use PACKAGE_VERSION instead of PACMAN_VERSIONJudd Vinet1-1/+1
2005-12-21VMiklos: add STRNCPY macro from alpm to pacmanJudd Vinet1-0/+5
2005-10-08Merging in recent fixes/additions from 2.9.7Judd Vinet1-0/+1
2005-03-16- reworked sync_synctree() to make use of alpm_db_update()Aurelien Foret1-3/+1
- dropped unpack()
2005-03-15Initial revisionJudd Vinet1-0/+42