summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-01-02Convert get_update_timediff to integer return valueDan McGee2-26/+28
We don't need absolute floating point precision at all here; we can stick to integer land and use milliseconds which are precise enough for our purposes. This also removes most floating point math out of the non-update code path. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-23Convert strtrim/strlen paired calls to only strtrimDan McGee2-10/+11
This utilizes the new return value so we don't have to find the length of the string again. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-23Merge branch 'maint'Dan McGee1-5/+7
2011-12-23pactree: cleanup register_syncsDave Reisner1-6/+9
- take advantage of the new strtrim return value - tighten scope on line pointer Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-23pactree: update with new strtrim functionDave Reisner1-9/+9
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-23pacman/util: return size_t from strtrimDave Reisner2-10/+10
Instead of returning the same value as the parameter to this function, return the length of the string, which can be useful to the caller when its non-zero (e.g. to find the end of the string). Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-23Allow comments after repo section header in pacman.confAllan McRae1-5/+7
Pacman assumes that the final character of a line specifing a repo in pacman.conf is a "]". But it did not clean whitespace from the line after removing any comments. So lines like: [allanbrokeit] # could break system caused pacman not to recognize the repo. Adjust config parsing to strip comments before trimming whitespace from the end of the string. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-22include config.h via MakefilesDave Reisner17-32/+8
Ensures that config.h is always ordered correctly (first) in the includes. Also means that new source files get this for free without having to remember to add it. We opt for -imacros over -include as its more portable, and the added constraint by -imacros doesn't bother us for config.h. This also touches the HACKING file to remove the explicit mention of config.h as part of the includes. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12code syntax cleanupDave Reisner4-10/+10
As per HACKING file, we use 'CTRL(' rather than 'CTRL (' Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12pacman: process all sync targets before exiting on errorDan McGee1-13/+27
If someone specifies a bogus line such as pacman -S baz adsf/boo base-devel we are better off trying to process all targets and showing all relevant errors before exiting. This is easier in -U and -R operations where we aren't dealing with groups, but here we attempt to skip group selection once we know a target has errored to avoid cluttering the output and hiding the real problem. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12pacman: process all targets on upgrade operationDan McGee1-5/+15
If an early target fails, we stopped processing the rest of the list. We should continue all the way through and show relevant errors for each target if possible, and error out only at the end. We do process all targets to check for URLs first and will error out if some could not be processed; we then do a second loop and try to load each target specified on the command line. This mirrors a patch by Allan to do the same for removal operations. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12pacman: list all unknown targets on removal operationAllan McRae1-1/+4
On a removal operation, pacman currently reports an error for the package that is not found in the database and then exists. Adjust so that all unknown packages are reported. Before: > pacman -R foo bar error: 'foo': target not found After: > pacman -R foo bar error: 'foo': target not found error: 'bar': target not found Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-01Merge branch 'maint'Dan McGee1-4/+4
2011-12-01Miscellaneous post-4.0.1 updatesDan McGee1-4/+4
Some late-arriving translation updates and add the correct dates to the index.txt releases table. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-21Merge branch 'maint'Dan McGee1-1/+2
2011-11-21add key algo to import msgFlorian Pritz1-2/+4
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-21change gpg import message to resemble gpg --list-keysFlorian Pritz1-2/+6
Dan: const pointers, don't worry about bitfields. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-21Final changes before 4.0.1 releasev4.0.1Dan McGee1-1/+2
* Add last-minute changes to NEWS * Don't treat '_' or '_n' special in scripts when finding translatable strings; this breaks with one use of `read` and a dummy _ variable Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-16Merge branch 'maint'Dan McGee28-507/+513
2011-11-16Update translations from TransifexDan McGee14-150/+163
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-15Remove unnecessary casts in callback codeDan McGee1-5/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-14create a typedef for enum _alpm_errno_tJonathan Conder9-11/+11
This is consistent with the other enums and structs, and should be slightly more readable. Signed-off-by: Jonathan Conder <jonno.conder@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-14Update translations from TransifexDan McGee27-410/+403
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-14Updates in preparation for 4.0.1 releaseDan McGee1-4/+4
Bump the version, update the translation template files, and fill in NEWS with relevant commits and changes since 4.0.0. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-13add fnmatch support for HoldPkgDave Reisner1-1/+7
Adds test remove031. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-11-07Merge branch 'maint'Dan McGee1-2/+5
2011-11-03Fix download progress rounding edge caseDan McGee1-2/+5
Allan's original message: Occasionally when the download rate showed 100.0 the output got messed up. This was caused by the rounding of a number between 99.95 and 100. Adjust the threshold to avoid this rounding issue. Dan: make this fix, but also show values between 0 and 9.995 with two decimal places since we have the room. Original-fix-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-01Add OPEN() and CLOSE() util macrosDan McGee1-1/+4
These wrap the normal open() and close() low-level I/O calls and ensure EINTR is handled correctly. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-01Merge branch 'maint'Dan McGee1-1/+1
2011-11-01src/util: link vercmp against .lo, not the .oDave Reisner1-1/+1
This seems to fix FS#26652. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-22Merge branch 'maint'Dan McGee8-63/+52
Conflicts: src/pacman/package.c Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-22Hide empty columns in table package list displayDan McGee1-24/+71
On -R operations, the "New Version" column is always empty, taking up space and not really showing the user anything valuable. The same is true on -S or -U operations for the "Old Version" column when packages are only being installed and not upgraded. Remove this column so we get a few screen columns back, especially now that we show repo/packagename style output. This also makes some adjustment to the padding logic. We no longer include padding in column widths but it is included in the total table width. We also ensure the last displayed column is always right aligned, even if this is not the actual rightmost column. Example output, before: $ sudo pacman -R eclipse checking dependencies... Targets (1): Name Old Version New Version Net Change eclipse 3.7-1 -194.02 MiB Total Removed Size: 194.02 MiB And after: $ sudo pacman -R eclipse checking dependencies... Targets (1): Name Old Version Net Change eclipse 3.7-1 -194.02 MiB Total Removed Size: 194.02 MiB Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-22pacman: show repo name in download promptDave Reisner1-1/+6
This only applies to the VerbosePkgLists option. Lessens the deficiencies created by earlier work to separate download records by repository. Satisfies FS#26334. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21sync: dont group sync records by repositoryDave Reisner1-1/+1
Break out the logic of finding payloads into a separate static function to avoid nesting mayhem. After gathering all the records, download them all at once. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21Remove remaining usages of fprintf() from frontendDan McGee2-4/+5
These can either be replaced with pm_printf() if they are error related, or in the fprintf(stdout, ...) case a bare printf() will do. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21Remove pm_fprintf() in favor of pm_printf()Dan McGee8-60/+47
Now that pm_printf() always prints to stderr, we don't need this second function that was always used with stderr as the first argument. Thus, this patch removes the function and makes the following sed replacement: sed -i -e 's#pm_fprintf(stderr, #pm_printf(#g' src/pacman/*.c Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21Use stderr as output stream for pm_printf()Dan McGee1-1/+1
This matches what we now do in our backend callback function- all debug/info/warning/error/etc. messages should be on stderr. These are all the messages with a "warning:" or other type prefix, so does not affect general pacman output. This should fix the output confusion noted in FS#26555. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-17Table display: print message with warning: prefixDan McGee1-1/+2
Use the normal error functions here rather than a bare fprintf(). Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-14Merge branch 'maint'Dan McGee1-5/+5
2011-10-14Use fputs and putchar in callback progress displayDan McGee1-15/+15
When we have fixed strings or output, printf overhead is unnecessary. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-14Remove -f short option for --forceDan McGee2-4/+5
This is not something that should be used on a frequent basis, and giving it a short option encourages use without making the drawbacks obvious. For the 1% of situations that require it, the 5 extra keystrokes are a fair price to pay. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-14Use puts() instead of no-op printf() where applicableDan McGee6-22/+27
This replaces several printf calls of the following styles: printf("%s", ...); printf("some fixed string"); printf("x"); We can use either fputs() or putchar() here to do the same thing without incurring the overhead of the printf format parser. The biggest gain here comes when we are calling the print function in a loop repeatedly; notably when printing local package files. $ /usr/bin/time ./pacman-before -Ql | md5sum 0.25user 0.04system 0:00.30elapsed 98%CPU $ /usr/bin/time ./pacman-after -Ql | md5sum 0.17user 0.06system 0:00.25elapsed 94%CPU $ /usr/bin/time ./pacman-before -Qlq | md5sum 0.20user 0.05system 0:00.26elapsed 98%CPU $ /usr/bin/time ./pacman-after -Qlq | md5sum 0.15user 0.05system 0:00.23elapsed 93%CPU So '-Ql' shows a 17% improvement while '-Qlq' shows a 13% improvement on 382456 total files. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-14Remove mcheck.h supportDan McGee1-8/+0
When was the last time anyone used this? That's what I thought. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13Fix some strict 32-bit gcc warningsDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13Coding style cleanupsDan McGee1-5/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13Merge branch 'maint'Dan McGee1-43/+48
Conflicts: src/pacman/util.c
2011-10-12Remove alpm_list_getdata wrapper functionDan McGee12-85/+85
This one is pretty darn useless. Just derefence the ->data attribute since the type is public anyway and save yourself the function call. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-12VerbosePkgLists: format table lines in i18n-compatible wayDan McGee1-43/+48
This had the unfortunate implementation detail that depended on the strings having 1 byte == 1 column hold true. As we know, this is not at all the case once you move past the base ASCII character set. Reimplement this whole thing so it doesn't depend on format strings at all. Instead, simply calculate the max column widths, and then when displaying each row add the correct amount of padding using UTF-8 safe string length functions. Before: 名字 旧版本新版本 净变化 下载大小 libgee 0.6.2.1-1 0.60 MiB 0.10 MiB libsocialweb 0.25.19-2 1.92 MiB 0.23 MiB folks 0.6.3.2-1 1.38 MiB 0.25 MiB After: 名字 旧版本 新版本 净变化 下载大小 libgee 0.6.2.1-1 0.60 MiB 0.10 MiB libsocialweb 0.25.19-2 1.92 MiB 0.23 MiB folks 0.6.3.2-1 1.38 MiB 0.25 MiB Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-12Introduce alpm_time_t typeDan McGee3-3/+5
This will always be a 64-bit signed integer rather than the variable length time_t type. Dates beyond 2038 should be fully supported in the library; the frontend still lags behind because 32-bit platforms provide no localtime64() or equivalent function to convert from an epoch value to a broken down time structure. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-12Final Transifex update before 4.0Dan McGee4-323/+358
We have a few incomplete translations, but these should be addressable before the 4.0.1 maint release that is surely not that far in the future. Signed-off-by: Dan McGee <dan@archlinux.org>