summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Database cleanup enhancementsDan McGee2012-03-05
| | | | | | | | | | | | | | | | | | Ensure we give database signatures special treatment like we already did for package signatures. Attempt to parse the database name out of them before taking the proper steps to handle their existence. This fixes FS#28714. We also add an unlink_verbose() helper method that displays any errors that occur when unlinking, optionally opting to skip any ENOENT errors from being fatal. Finally, the one prompt per unknown database has been removed, this has no real sound purpose and we don't do this for packages. Simply kill databases we don't know about; other programs shouldn't have random data in this directory anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
* Give better error messages on database locking failuresDan McGee2012-02-19
| | | | | | | | | | | | | | | | | | | | This was noted when trying to perform an operation on a pacman database on a read-only file system. Print the actual underlying errno string, and only show the "you can remove" message if the lock file actually exists. Before: $ pacman -Su error: failed to init transaction (unable to lock database) if you're sure a package manager is not already running, you can remove /e/db.lck After: $ pacman -Su error: failed to init transaction (unable to lock database) error: could not lock database: Read-only file system Signed-off-by: Dan McGee <dan@archlinux.org>
* Revert "Add -S --recursive operation"Dan McGee2012-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f3fa77bcf1d792971c314f8c0de255866e89f3f3 along with making other necessary changes to fully back this (mis)feature out until we can do it correctly. The quick summary here is this was not implemented correctly; provides are not fully taken into account in this logic, and making that happen exposes a lot of other flaws in this code that are covered up later on in the dependency resolving process by several other pieces of convoluted and conditional logic. Tests have been adjusted accordingly. Some test EXISTS conditions have been removed as we already know the package is installed locally, and we also are checking the VERSION condition anyway. With these two related revert commits, we do have some changes in test pass/fail results: * upgrade078.py: does not pass, this is due to --recursive getting removed for -U/-S operations after this commit. * sync302.py: the version checks have been disabled, so this test continues to pass but has been scaled back in scope. * sync303.py: now passes, was failing before. * sync304.py: still failing, was failing before. * sync305.py: now passes, was failing before. * sync306.py: still passes, was passing before. Signed-off-by: Dan McGee <dan@archlinux.org>
* Revert "Enable recursive/needed sync on SyncFirst"Dan McGee2012-02-15
| | | | | | | | | | This reverts commit 09034520325efcc2e684f05fa7a99c02bad1f5be. Tests affected by this revert have been adjusted; additionally a few EXIST tests have been removed where there is already a VERSION test doing the job for us. Signed-off-by: Dan McGee <dan@archlinux.org>
* Final pre-release Transifex updatesDan McGee2012-02-11
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pactree: allow comments after repo section headerAllan McRae2012-02-11
| | | | | | | Duplicate the fix in config file parsing from d95c0494. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix a handful of comment typos or misspellingsDan McGee2012-02-06
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Translation updates from Transifex, mostly scriptsDan McGee2012-02-06
| | | | | | | This is after some manual massaging to fix issues with newlines in some translations of the script catalogs. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update translations from TransifexDan McGee2012-02-06
| | | | | | | The pacman-scripts catalog is omitted here due to various newline errors I don't have the time to fix right now. Signed-off-by: Dan McGee <dan@archlinux.org>
* remove.c: make "target not found" error consistent with sync.cAndrew Gregory2012-02-06
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Add simple integer-only pow() implementationDan McGee2012-02-03
| | | | | | | | We hardly need the complexity (or slowness) provided by the libm power function; add a super-cheap one that suits our needs and is specialized for the values we plan on passing in. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix FS#27924: don't display negative zeroesThomas Dziedzic2012-02-03
| | | | | | | Dan: don't compute lower bound unless needed, flip argument order so out values are last, add param Doxygen documentation. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update translationsDan McGee2012-01-30
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update pot translation catalogsDan McGee2012-01-30
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update copyright on changed files since beginning of yearDan McGee2012-01-18
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* util.c, rmrf(): only create string when neededOlivier Brunel2012-01-18
| | | | | | | | The entry's name is only used when not "." or ".." so only print the string then. Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix missing [removal] outputAllan McRae2012-01-18
| | | | | | | | | | | | Currently, a transaction is considered to be purely package removal until the first package install is found. This resulted in the removed packages at the start of a combined upgrade/removal transaction not getting the "[removal]" output. Fixes FS#27981. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix broken output when asking question and stdin is pipedOlivier Brunel2012-01-18
| | | | | | | | | When asking question and stdin is piped, the response does not get printed out, resulting in a missing \n and broken output (FS#27909); printing the response fixes it. Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unused strtoupper() functionDan McGee2012-01-18
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Don't remove unknown files in cache cleaning codeDan McGee2012-01-18
| | | | | | | | | | This removes the hack I added to skip '*.sig' files earlier since there are other files that also fall into the same bucket- source packages from `makepkg --source`, delta files, etc. Rather than prompting for each and every one, simply skip them. Doing '-Scc' rather than '-Sc' will delete these files if that is really what you want to do. Signed-off-by: Dan McGee <dan@archlinux.org>
* Use fileno() in isatty() callDan McGee2012-01-12
| | | | | | | This was our only use of the function that had a hardcoded file descriptor. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update translations from TransifexDan McGee2012-01-05
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Allow comments after repo section header in pacman.confAllan McRae2011-12-23
| | | | | | | | | | | | | | 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>
* Miscellaneous post-4.0.1 updatesDan McGee2011-11-30
| | | | | | | Some late-arriving translation updates and add the correct dates to the index.txt releases table. Signed-off-by: Dan McGee <dan@archlinux.org>
* Final changes before 4.0.1 releaseDan McGee2011-11-20
| | | | | | | | * 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>
* Update translations from TransifexDan McGee2011-11-16
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update translations from TransifexDan McGee2011-11-13
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Updates in preparation for 4.0.1 releaseDan McGee2011-11-13
| | | | | | | 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>
* Fix download progress rounding edge caseDan McGee2011-11-03
| | | | | | | | | | | | | 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>
* src/util: link vercmp against .lo, not the .oDave Reisner2011-11-01
| | | | | | | This seems to fix FS#26652. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove remaining usages of fprintf() from frontendDan McGee2011-10-21
| | | | | | | 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>
* Remove pm_fprintf() in favor of pm_printf()Dan McGee2011-10-21
| | | | | | | | | | 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>
* Use stderr as output stream for pm_printf()Dan McGee2011-10-21
| | | | | | | | | | | 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>
* Table display: print message with warning: prefixDan McGee2011-10-17
| | | | | | Use the normal error functions here rather than a bare fprintf(). Signed-off-by: Dan McGee <dan@archlinux.org>
* Coding style cleanupsDan McGee2011-10-13
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* VerbosePkgLists: format table lines in i18n-compatible wayDan McGee2011-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Final Transifex update before 4.0Dan McGee2011-10-12
| | | | | | | | 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>
* Update translations from TransifexDan McGee2011-10-11
| | | | | | In prep for the 4.0.0 release. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactree: Make error message smarter in register_syncs()Lukas Fleischer2011-10-10
| | | | | | | | | | | | | | | | | | | | Our error message used to be very unclear when the configuration file could not be found: $ ./pactree -lsr gtk error: failed to register sync DBs Instead, display an accurate message and include the file name: $ ./pactree -lsr gtk error: config file /usr/local/etc/pacman.conf could not be read Also, move the error message inside register_syncs() to allow for differentiating between different errors that might require a handler in the future. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
* pactree: Add "--config" optionLukas Fleischer2011-10-10
| | | | | | | | | | | | | | | | This allows for specifying an alternate configuration file path, similar to pacman's "--config" option. Given that there is currently no other way to tell pactree to read from another configuration file (except for patching or symlinking), this seems totally sensible - even if there are plans to refactor and/or replace the standalone configuration file parser. We do not define a short option for the sake of consistency with pacman's set of command line options. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
* Update translation message catalogs in prep for 4.0 releaseDan McGee2011-10-05
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update translations from TransifexDan McGee2011-10-05
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove redundant transaction size outputAllan McRae2011-09-30
| | | | | | | | | | | | | | | | | | | Printing all of "Installed", "Removed" and "Net Upgrade" sizes is redundant as the difference of the first two is the last. Instead, only print "Installed Size" and "Net Upgrade Size" when both the installed and removed are non-zero. This results in the following output in the following cases: - package installation only: Installed Size - package removal only: Removed Size - package installation involving replacement: Installed + Net Upgrade Size - package upgrade: Installed + Net Upgrade Size - combination upgrade and installation: Installed + Net Upgrade Size Download Size remains outputted whenever something is downloaded. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove redundant "removal" output in pure remove operationAllan McRae2011-09-29
| | | | | | | Printing "[removal]" beside all package names is redundant when all packages are being removed (i.e. when using -R). Signed-off-by: Allan McRae <allan@archlinux.org>
* Refactor display_targets to not be recursiveDan McGee2011-09-28
| | | | | | | | | | | This also fixes a memory leak and makes the dual-purpose "rows" variable go away in favor of storing the rows and non-verbose names separately. This also fixes some potential memory leaks and/or wrong behavior due to the config->verbosepkglists flag being flipped, which we should never be doing. Signed-off-by: Dan McGee <dan@archlinux.org>
* verbose package lists: remove errant debuggerDan McGee2011-09-28
| | | | | | Left this in as part of the last set of commits, whoops. Signed-off-by: Dan McGee <dan@archlinux.org>
* Always show download size if -w/--downloadonly was providedDan McGee2011-09-28
| | | | | | | The prompt can be rather confusing otherwise when all files have already been downloaded, but there is not a single total size listed. Signed-off-by: Dan McGee <dan@archlinux.org>
* Table format creation code cleanupDan McGee2011-09-28
| | | | | | | | | Better scoping of variables for the most part, and ensure we are using string_length() and not strlen() as appropriate. Also refactor the longest cell code to call string_length() a lot less; by simply using an array of max sizes we don't have to recompute values nearly as much. Signed-off-by: Dan McGee <dan@archlinux.org>
* Use unsigned types for indent width and column countDan McGee2011-09-28
| | | | | | | | | | | For getcols(), the functions we call return a value of type 'unsigned short', so it makes sense for us to do the same. string_length() is meant to behave like strlen(), so it should return type size_t. This exposes other functions such as indentprint() which should also be using signed return types. Signed-off-by: Dan McGee <dan@archlinux.org>
* Show download sizes when using -S/--syncDan McGee2011-09-28
| | | | | | | | We now label the old 'Size' column as 'Net Change' to reflect the reality of what we are looking at. Sync operations now get an additional 'Download Size' column. Signed-off-by: Dan McGee <dan@archlinux.org>