summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2012-03-16Reduce calls to getcolsDan McGee
This dramatically improves upon a much older attempt in 2008 in commit ce3d70aa99ab86. We don't need to call it once per line we print unless there is a reasonable expectation of being able to resize the terminal mid-operation; this is really only the case during our callback progress bars. Some before and after numbers of ioctl() calls, gleaned from strace of the following operations (no targets to any of them to maximize the amount of output): pacman -Qii : 37768 -> 2616 (93.1% decrease) pacman -Qs : 2616 -> 4 (99.8%) pacman -Sii : 133036 -> 10926 (91.8%) pacman -Ss : 10926 -> 14 (99.9%) Obviously the search results are astounding; we only call getcols() once in the case of -Qs, and once per repo in the case of -Ss. For -Qii and -Sii we are still calling it once per package, but this is much better than once per line of info output. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-16Pass a file descriptor to getcols and flush_term_inputDan McGee
This makes these methods a bit more flexible. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-16Merge branch 'maint'Dan McGee
Conflicts: lib/libalpm/sync.c
2012-03-16Always display download size if it appliesDan McGee
Currently, we try to do a bunch of funkyness constraining download size to print only when doing a -S/--sync operation. However, it is possible we try to download packages on a -U/--upgrade operation, and we currently won't show any itemized download sizes. Fix this ommission by always including the download size stuff in the built table rows; this column will be completely omitted anyway if there are no values due to prior work in commit 33bb7dbd35. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-16Handle printing NULL correctly in table displayDan McGee
Treat this value as the empty string. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-13Skip special files when cleaning package cacheAllan McRae
Ignore *.sig, *.db*, and *.src.tar* when cleaning the package cache. Fixes FS#25166. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-03-12Minor format-string related cleanupsDan McGee
We had one stubbed out so we didn't require a translation update, and the other is more a code style issue. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-08Merge branch 'maint'Dan McGee
Conflicts: lib/libalpm/be_package.c
2012-03-08Simplify package validation info output for sync packagesAllan McRae
Unify the output for local and sync packages by only printing a list of possible validation types for sync packages. This also has the advantage of not printing the very long sha256 checksum which line wrapped on a standard width terminal. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-03-08Add information on how an installed package was validatedAllan McRae
When installing a package, store information on which validation method was used and output this on "pacman -Qi" operations. e.g. Validated By : SHA256 Sum Possible values are Unknown, None, MD5 Sum, SHA256 Sum, Signature. Dan: just a few very minor tweaks. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-08Hook new optdepend structures upBenedikt Morbach
No new behaviour introduced, everything should work exactly as before. Dan: refactored to use the single alpm_depend_t structure. Signed-off-by: Benedikt Morbach <benedikt.morbach@googlemail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-05Translation updates from TransifexDan McGee
* it updates to all translations * minor fr, pt_BR, de, lt, sk and uk updates * add new strings in pacman translation catalog Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-05Database cleanup enhancementsDan McGee
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>
2012-02-20Merge branch 'maint'Dan McGee
Conflicts: contrib/pacsysclean.in src/pacman/conf.h
2012-02-20Update copyright yearsAllan McRae
Add 2012 to the copyright range for all libalpm and pacman source files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-19Give better error messages on database locking failuresDan McGee
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>
2012-02-15Revert "Add -S --recursive operation"Dan McGee
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>
2012-02-15Revert "Enable recursive/needed sync on SyncFirst"Dan McGee
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>
2012-02-13Merge branch 'maint'Dan McGee
Conflicts: lib/libalpm/sync.c src/util/pactree.c
2012-02-13Do not check for ALPM_ERR_PKG_INVALID_ARCH on remove operationAllan McRae
alpm_trans_prepare can not return ALPM_ERR_PKG_INVALID_ARCH on a remove operation so there is no point in checking for it. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-13testpkg: set gpgdirAllan McRae
Without setting gpgdir, testpkg outputs: warning: Public keyring not found; have you run 'pacman-key --init'? Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-13Move ROOTDIR definition into config.hAllan McRae
This was the only variable of its kind when a define was done on the compiler command line. Move it into config.h instead. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-11Final pre-release Transifex updatesDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-11pactree: allow comments after repo section headerAllan McRae
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>
2012-02-06Fix a handful of comment typos or misspellingsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-06Translation updates from Transifex, mostly scriptsDan McGee
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>
2012-02-06Merge branch 'maint'Dan McGee
Conflicts: lib/libalpm/alpm_list.c
2012-02-06ALPM API adjustments for sanity and consistencyDan McGee
This makes several small adjustments to our exposed method names, and in one case, parameters. The justification here is to make methods less odd in their naming convention. If a method takes an alpm_db_t argument, the method should be named 'alpm_db_*', but perhaps more importantly, if it doesn't take a database as the first parameter, it should not. Summary of changes: alpm_db_register_sync -> alpm_register_syncdb alpm_db_unregister_all -> alpm_unregister_all_syncdbs alpm_option_get_localdb -> aplpm_get_localdb alpm_option_get_syncdbs -> aplpm_get_syncdbs alpm_db_readgroup -> alpm_db_get_group alpm_db_set_pkgreason -> alpm_pkg_set_reason All methods keep the same argument list except for alpm_pkg_set_reason; there we drop the 'handle' argument as it can be retrieved from the passed in package object. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-06Update translations from TransifexDan McGee
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>
2012-02-06remove.c: make "target not found" error consistent with sync.cAndrew Gregory
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-03Add simple integer-only pow() implementationDan McGee
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>
2012-02-03Fix FS#27924: don't display negative zeroesThomas Dziedzic
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>
2012-01-30Merge branch 'maint'Dan McGee
Conflicts: scripts/makepkg.sh.in
2012-01-30Update translationsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-30Update pot translation catalogsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-23Merge branch 'maint'Dan McGee
Conflicts: lib/libalpm/diskspace.c src/pacman/util.h
2012-01-18Update copyright on changed files since beginning of yearDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-18Allow UseDelta option to specify a delta ratioDan McGee
Rework the frontend and backend to allow passing a ratio value in for UseDelta rather than having a hardcoded #define-d 0.7 value always used. This is useful for those with fast connections, who would likely benefit from tuning this ratio to lower values; it is also useful for general testing purposes. The libalpm API changes for this, but we do support the old config file format with a no-value 'UseDelta' option; in this case we simply use the old default of 0.7. We clamp the ratio values to a sane range between 0.0 and 2.0, allowing ratios above 1.0 for testing purposes. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-18util.c, rmrf(): only create string when neededOlivier Brunel
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>
2012-01-18Fix missing [removal] outputAllan McRae
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>
2012-01-18Fix broken output when asking question and stdin is pipedOlivier Brunel
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>
2012-01-18Remove unused strtoupper() functionDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-18Don't remove unknown files in cache cleaning codeDan McGee
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>
2012-01-12Use fileno() in isatty() callDan McGee
This was our only use of the function that had a hardcoded file descriptor. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-08Merge branch 'maint'Dan McGee
Conflicts: lib/libalpm/signing.c Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-07testdb: check local database for duplicate filesDan McGee
This adds an additional check step to find files in the local database that claim to be owned by more than one package at once, which is definitely not a supported setup. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-05Update translations from TransifexDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-02Convert get_update_timediff to integer return valueDan McGee
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 McGee
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 McGee