summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Require handle for alpm_checkconflicts()Dan McGee2011-06-13
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Require handle for alpm_pkg_load()Dan McGee2011-06-13
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Add handle argument to alpm_(add|remove)_pkg()Dan McGee2011-06-13
| | | | | | | | This makes these functions consistent with the rest of the transaction related API calls. We do an additional assert to ensure the handle attached to the package is the same as the handle passed in. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix all current return(x) usagesDan McGee2011-06-13
| | | | | | | | | A few of these snuck in as of late, some from the table display patches that were using the previous format before we changed it after the 3.5.X major release. Noticed-by: Kerrick Staley <mail@kerrickstaley.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Require handle for alpm_sync_sysupgrade()Dan McGee2011-06-09
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Require handle for alpm_db_register_sync()Dan McGee2011-06-09
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Require handle argument to all alpm_trans_*() methodsDan McGee2011-06-09
| | | | | | | Begin enforcing the need to pass a handle. This allows us to remove one more extern handle declaration from the backend. Signed-off-by: Dan McGee <dan@archlinux.org>
* Require handle argument to all alpm_option_(get|set)_*() methodsDan McGee2011-06-09
| | | | | | | | This requires a lot of line changes, but not many functional changes as more often than not our handle variable is already available in some fashion. Signed-off-by: Dan McGee <dan@archlinux.org>
* Require handle argument to alpm_logaction()Dan McGee2011-06-09
| | | | | | | This is the first in a series of patches to update the API to remove the implicit global handle variable. Signed-off-by: Dan McGee <dan@archlinux.org>
* Kill all remaining 'PATH_MAX + 1' usagesDan McGee2011-06-09
| | | | | | | | | The few remaining instances were utilized for buffers in calls to snprintf() and realpath(). Both of these functions will always ensure the returned value is padded with '\0', so there is no need for the extra byte. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove incorrect output with download only and IgnorePkgAllan McRae2011-06-08
| | | | | | | | | | | | | | When only downloading a package that is in IgnorePkg, pacman incorrectly asks about installing. e.g. with <pkg> in IgnorePkg in pacman.conf: > pacman -Sddw <pkg> :: <pkg> is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] This output is now silenced when downloading only. Signed-off-by: Allan McRae <allan@archlinux.org>
* Revamp pacman setup code to handle new alpm initialize routineDan McGee2011-06-07
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update utilities for new initialize/release methodsDan McGee2011-06-07
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-06-02
|\ | | | | | | | | Conflicts: src/pacman/callback.c
| * Ensure list_display works on outputs of unknown widthDan McGee2011-06-01
| | | | | | | | | | | | | | | | | | | | | | | | If getcols() returns 0, we were getting stuck before in a loop of no return. Teach getcols() to take a default value to return if the width is unknown, and use this everywhere as appropriate. Also make a few other cleanups while diagnosing this issue, such as const-ifying some variables. Noticed-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Show net upgrade size on -U/-S operationsDan McGee2011-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If it is different than the raw installed size metric we already show, compute the net upgrade size. For some sync operations, this can even be negative if newer packages are smaller than the ones they replace locally. Implements FS#12566. Example: Targets (1): telepathy-glib-0.14.7-1 Total Download Size: 1.07 MiB Total Installed Size: 15.72 MiB Net Upgrade Size: -0.29 MiB Signed-off-by: Dan McGee <dan@archlinux.org>
* | Let pacman -v print GPG DirPang Yan Han2011-06-01
| | | | | | | | | | | | Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-05-19
|\| | | | | | | | | | | Conflicts: lib/libalpm/trans.c src/pacman/query.c
| * Coding style cleanups; add a null checkDan McGee2011-05-19
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Ensure --print doesn't enable --noconfirm when not expectedDan McGee2011-05-16
| | | | | | | | | | | | | | | | This is at best a hack around the way we currently do our --print magic, but at least prevents someone from shooting themselves in the foot as indicated in FS#24287. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Don't balk on .sig files being invalid in package cacheDan McGee2011-05-10
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Rework config parsing to reduce variable duplicationDan McGee2011-05-05
| | | | | | | | | | | | | | | | This removes the need to strdup() the section name at every decent into an Include statement, as well as having duplicate DB pointers around that are never used independently. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Refactor VerifySig option value parsing into standalone methodDan McGee2011-05-05
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Improve database server APIDan McGee2011-05-05
| | | | | | | | | | | | | | | | | | Currently we have one call that has all sorts of crazy behavior and doesn't make a whole lot of sense. Go from one method to the normal four methods we have for all of our other lists we use in the library to make it a lot easier for a frontend to manipulate server lists. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make config parsing a two-part affairDan McGee2011-05-05
| | | | | | | | | | | | | | | | | | | | | | | | This ensures we call any alpm_option type functions before registering databases, making sure all paths and other defaults (e.g. sig verification levels) have been set first. This will ensure we can continue to allow crazy config files where [options] doesn't come first. The diffstat on this commit is misleading; view with -w/--ignore-all-space to get a better idea of what needed to be touched. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Move parseconfig to conf.cDan McGee2011-05-05
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactree: make -Wwrite-strings friendlyDan McGee2011-05-04
| | | | | | | | | | | | | | | | Use a few structs to hold configuration values we change given certain options so we can be const-correct with string assignment across the board. Behavior should be completely unchanged. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix warnings reported by -Wwrite-stringsDan McGee2011-05-04
| | | | | | | | | | | | | | These are places where we stuck a string constant in a variable not marked as const. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Perform package verification at package load timeDan McGee2011-04-24
| | | | | | | | | | | | | | | | | | | | | | Both md5sum verification and PGP verification can and should be done at package load time. This allows verification to happen as early as possible for packages provided by filename and loaded in the frontend, and moves more stuff out of sync_commit that doesn't really belong there. This should also set the stage for simplified parallel loading of packages later down the road. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make dump_pkg_full a little less insaneDan McGee2011-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The various "level" values were a bit crazy to decipher, and we were doing some very interesting comparisons in certain places. Break it out into two parameters instead so we can seperate the type from the extra information display, and do things accordingly. Nothing changes with the display of any of the five types we currently show: -Si, -Sii, -Qi, -Qii, -Qip. Something to note- we should expose the PKG_FROM enum type somehow, this patch leaves the door open to do that quite easily. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Header inclusion cleanupDan McGee2011-04-20
| | | | | | | | | | | | | | | | This does touch a lot of things, and hopefully doesn't break things on other platforms, but allows us to also clean up a bunch of crud that no longer needs to be there. Signed-off-by: Dan McGee <dan@archlinux.org>
* | syntax: if/while statements should have no trailing spaceDan McGee2011-04-20
| | | | | | | | | | | | | | | | | | | | | | This is the standard, and we have had a few of these introduced lately that should not be here. Done with: find -name '*.c' | xargs sed -i -e 's#if (#if(#g' find -name '*.c' | xargs sed -i -e 's#while (#while(#g' Signed-off-by: Dan McGee <dan@archlinux.org>
* | Allow VerifySig to act as a default verification in [options]Dave Reisner2011-04-20
| | | | | | | | | | | | | | | | | | | | * add _alpm_db_get_sigverify_level * add alpm_option_{get,set}_default_sigverify And set the default verification level to OPTIONAL if not set otherwise. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | style cleanup: cast as (type *) not (type*)Dave Reisner2011-04-20
| | | | | | | | | | Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | New VerbosePkgLists optionJakob Gruber2011-04-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If enabled, displays package lists for upgrade, sync and remove operations formatted as a table. Falls back to default list display if insufficient terminal columns are available. Example output: :: Starting full system upgrade... :: Replace libjpeg with testing/libjpeg-turbo? [Y/n] resolving dependencies... looking for inter-conflicts... Remove (1): Name Old Version Size libjpeg 8.3.0-1 0.83 MB Total Removed Size: 0.83 MB Targets (5): Name Old Version New Version Size libjpeg-turbo 1.1.0-1 0.20 MB linux-firmware 20110201-1 20110227-1 8.23 MB ncurses 5.7-4 5.8-1 0.92 MB ppl 0.11.1-1 0.11.2-1 2.74 MB v4l-utils 0.8.1-1 0.8.3-1 0.23 MB Total Download Size: 12.32 MB Total Installed Size: 58.82 MB Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Table formatted output functionsJakob Gruber2011-04-20
| | | | | | | | | | | | | | | | | | table_display takes a list of lists of strings (representing the table cells) and displays them formatted as a table. The exact format depends on the longest string in each column. Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Refactor display_targets for readabilityJakob Gruber2011-04-20
| | | | | | | | | | | | | | | | Row handling is moved to its own function in preparation for verbose package lists. Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Use IEC unit prefixesJakob Gruber2011-04-20
| | | | | | | | | | | | | | | | Display {KiB, MiB, ...} instead of {KB, MB, ...} since that's what's actually being displayed. Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add a utility function to humanize sizesJakob Gruber2011-04-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converts the given size in bytes in two possible ways: 1) target_unit is specified (!= 0): size is converted to target unit. 2) target_unit is not specified (== '\0'): size is converted to the first unit which will bring size to below 2048. If specified, label will point to the long label ('MB') if long_labels is set or the short label ('M') if it is not. Dan: use '\0' rather than 0 for the special value as a matter of coding style for char variables. Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove ShowSize optionJakob Gruber2011-04-20
| | | | | | | | | | | | | | | | | | | | Dan: The commit message originally referenced "VerbosePkgLists", but I'm going to change the name of the option. In addition, this patch serves a purpose being standalone- we should really do things like this with -S --print and hopefully -Q --print in the future. Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-04-15
|\| | | | | | | | | | | | | | | Conflicts: lib/libalpm/alpm.h lib/libalpm/trans.c Signed-off-by: Dan McGee <dan@archlinux.org>
| * pacman/query: correctly handle root files with -QoXavier Chantry2011-04-15
| | | | | | | | | | | | | | | | spotted by clang-analyzer (strcmp with NULL rpath is bad) Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | libalpm: consistently use int as return type for option settersRémy Oudompheng2011-04-15
| | | | | | | | | | | | | | | | Currently the only error case then when handle == NULL. However several handle functions return -1 on this error, and a uniform API makes things simpler. Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-04-05
|\| | | | | | | | | | | | | Conflicts: lib/libalpm/be_sync.c lib/libalpm/db.c src/pacman/util.c
| * Coding style cleanupsDan McGee2011-04-04
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Ensure stdout/stderr are flushed when asking questionsDan McGee2011-04-01
| | | | | | | | | | | | | | | | | | Addresses FS#23492, where the question was shown without knowing what one was answering to. Ensure we flush our output streams before printing the question, and flush the stream on which we ask the question before waiting for an answer. Signed-off-by: Dan McGee <dan@archlinux.org>
* | pacman.c : useless extra parenthesisXavier Chantry2011-04-04
| | | | | | | | | | | | | | clang 3.0 git complained about these Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-03-29
|\|
| * call alpm_option_get_localdb once in syncfirst()Andrea Scarpino2011-03-29
| | | | | | | | | | Signed-off-by: Andrea Scarpino <andrea@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | pacman/util: flush terminal input before reading responseDave Reisner2011-03-28
| | | | | | | | | | | | | | Addresses FS#20538 Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>