summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Attempt to stop installation when we encounter problemsDan McGee2010-12-12
| | | | | | | | | | | | | | | | | | | | | This should hopefully address some of the concerns raised in FS#11639 with regards to continuing after filling the disk up. Add some more checks and passing of error conditions between our functions. When a libarchive warning is encountered, check if it is due to lack of disk space and if so upgrade it to an error condition. A review of other libarchive warnings suggests that these are less critical and can remain as informative warning messages at this stage. Note the presence of errors after extraction of an entire package is complete. If so, we abort the transaction to be on the safe side and keep damage to a minimum. Signed-off-by: Dan McGee <dan@archlinux.org> [Allan: make ENOSPC warning into an error] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Turn libarchive warnings into libalpm warningsDan McGee2010-12-12
| | | | | | | | | | | | Rather than hiding these warnings, show them to the user as they happen. This will prevent things such as hiding full filesystem errors (ENOSPC) from the user as seen in FS#11639. Signed-off-by: Dan McGee <dan@archlinux.org> [Allan: adjust warning wording and add gettext calls] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Make reading from any file possible in sync DBDan McGee2010-12-12
| | | | | | | | Whether it be "desc", "depends", or "deltas", it really doesn't matter- treat them all the same and have the ability to read any data from any file in that list. This continues the work in a44c7b8956. Signed-off-by: Dan McGee <dan@archlinux.org>
* Explicitly test time difference is greater than zeroAllan McRae2010-12-12
| | | | | | | | | | We are comparing a floating point number so should use an inequality rather than implicitly testing != 0. Prevents warning given by -Wfloat-equal. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: perform sanity checks on variables in package functionsAllan McRae2010-12-12
| | | | | | | Check the over-ridden entries for provides, backup, optdepends and options for illegal entries. Partially fixes FS#16004. Signed-off-by: Allan McRae <allan@archlinux.org>
* diskspace style cleanups and small fixesDan McGee2010-12-12
| | | | | | | | | | | | | | | | * Use our normal return() function syntax * Rework a few things to reduce number of casts * Fix void function argument declaration * Add missing gettext _() call * Remove need for seperate malloc() of statvfs/statfs structure * Unify argument order of static functions- mountpoints now always passed first * Count all files that start with '.' in a package against the DB * Rename db to db_local in check_diskspace to clarify some code * Fix some line wrapping to respect 80 characters Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* Refactor statfs/statvfs type checkDan McGee2010-12-12
| | | | | | | | | | | Turn it into a configure-type typedef, which allows us to reduce the amount of duplicated code and clean up some #ifdef magic in the code itself. Adjust some of the other defined checks to look at the headers available rather than trying to pull in the right ones based on configure checks. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* Display progress bar for disk space checkingAllan McRae2010-12-12
| | | | | | | | Checking disk space needed for a transaction can take a while so add an informative progress bar. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add configuration option to control disk space checkingAllan McRae2010-12-12
| | | | | | | | | Disk space checking is likely to be an unnecessary bottleneck to people with reasonable partition sizes so add a configuration option to allow it to be disabled/enabled as wanted. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Implement disk space checkingAllan McRae2010-12-12
| | | | | | | | | Pull together the work of the previous commits to implement a check for enough free space before performing an install transaction. Abort if there is not enough free space with an appropriate pm_errno.. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add functions to calculate approximate disk usage by packagesAllan McRae2010-12-12
| | | | | | | | | | | | | | | | | | | | | | | | Two helper function are added to calculate the disk usage from packages that are either currently installed on the system or from a package archive. Some minor approximations have been made: 1. Size for directories is not considered when removing a package from the filesystem to avoid multiple counting across packages. Also, these are reported to take zero size while installing. 2. Symlinks are reported to contribute zero size towards removal as libarchive reports them to have zero size for install. 3. Package data files (.PKGINFO, .INSTALL, .CHANGELOG) are counted towards usage on dbpath on install, but their size is not counted on package removal. 4. No handling of extra size needed for .pacsave/.pacnew files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add function to match file to mount pointAllan McRae2010-12-12
| | | | | | | | | | | | For a given file, determine which mount point it is on or will be installed to. Take into account that we might be using an alternative installation root. Add additional helper function added to sort mount point list for easier matching. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add function for listing system mount pointsAllan McRae2010-12-12
| | | | | | | | | | | Add a mount_point_list() function that attempts to portably obtain a list of system mount points and a struct to hold needed mount point information. Abort the transaction if we are unable to determine the mount points. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Prototype disk space checking functionalityAllan McRae2010-12-12
| | | | | | | | Very basic prototyping for adding functionality to check free disk space before performing package installs. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove AC_TYPE_SIGNAL usageDan McGee2010-12-12
| | | | | | | | | This macro is deemed unnecessary by even the autoconf guys, so we really don't need to use it. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* dirent usage cleanupDan McGee2010-12-12
| | | | | | | | | | We were including the header in a lot of places it is no longer used. Additionally, use the correct autoconf macro for determining whether d_type is available as a member: HAVE_STRUCT_DIRENT_D_TYPE. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Move MAX_DELTA_RATIO definitionAllan McRae2010-12-12
| | | | | | | | This is a delta specific definition so it makes more sense to put it in the delta specific header file. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Combine reading from depends and desc in sync dbAllan McRae2010-12-12
| | | | | | | | This will allow us to eventually combine the depends and desc entries within the sync database. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: remove dead code from handle_depsAndres P2010-12-12
| | | | | | | | | | The error message that has been removed never gets to print because, given the same condition, handle_deps throws the same error and then immediately exits makepkg. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: do not ignore errors from pacman when checking depsAndres P2010-12-12
| | | | | | | | | | | | As check_deps is run in a subshell, exit had the same meaning as return. Since the intention is to halt makepkg when pacman throws an error other than 127, the enclosing function has to handle error control instead. Fixes FS#19840 Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: use portable escape sequence for terminal escapesCarlos Diaz2010-12-12
| | | | | | | | | | | | The escape string isn't necesarily \033; it's determined by what the particular termcap/info entry for that terminal contains. Bash uses ncurses functions to expand \e to the _correct_ terminal escape. Signed-off-by: Carlos Diaz <839273@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add epoch to PKGBUILD prototypesAllan McRae2010-12-12
| | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* src/util: update .gitignoreDan McGee2010-12-12
| | | | | | Add pactree and sort entries. Signed-off-by: Dan McGee <dan@archlinux.org>
* contrib: remove bash pactreeXavier Chantry2010-12-12
| | | | | | This has been rewitten in C which is much much faster. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* pactree: use variables for color and tree outputXavier Chantry2010-12-12
| | | | | | | | This allows to very easily support non-color and linear mode, by just setting the variables to an empty string, very much like it was done in the bash script. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* pactree: separate dependency and print logicXavier Chantry2010-12-12
| | | | | | | | | | The deps walking code simply calls print_start, print, print_end, and all the printing logic is handled there. The unresolvable printing is disabled for now because it does not handle linear mode, and the linear and color output will be re-written. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* pactree: rewrite in CDave Reisner2010-12-12
| | | | | | | | | | | | | | | | Use the bash script in contrib as the basis for a C rewrite using libalpm. The speedup can go from dozens of seconds to less than one second. Colorized output is preserved. The --graph option generates output that graphviz's `dot' utility will understand to draw us a graph. Output is written to stdout and it is left up to the user to pipe the data and determine the output characteristics. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* alpm/remove.c : respect --dbonly during remove-upgradeXavier Chantry2010-12-12
| | | | | | | | | | | | | | | | | When a -Sk or -Uk operation induced a removal of an existing local package, --dbonly was not in effect and the files were all removed. Fixing this behavior was already marked as TODO in database012 pactest ------------ TODO: I honestly think the above should NOT delete the original les, it hould upgrade the DB entry without touching anything on the file stem. E.g. this test should be the same as: pacman -R --dbonly dummy && pacman -U --dbonly dummy.pkg.tar.gz ------------ Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> [Dan: small coding style touchup] Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman: sort --help outputXavier Chantry2010-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example with pacman -Uh : $ pacman -Uh options: -b, --dbpath <path> set an alternate database location -d, --nodeps skip dependency checks -f, --force force install, overwrite conflicting files -k, --dbonly only modify database entries, not package files -r, --root <path> set an alternate installation root -v, --verbose be verbose --arch <arch> set an alternate architecture --asdeps install packages as non-explicitly installed --asexplicit install packages as explicitly installed --cachedir <dir> set an alternate package cache location --config <path> set an alternate configuration file --debug display debug messages --ignore <pkg> ignore a package upgrade (can be used more than once) --ignoregroup <grp> ignore a group upgrade (can be used more than once) --logfile <path> set an alternate log file --noconfirm do not ask for any confirmation --noprogressbar do not show a progress bar when downloading files --noscriptlet do not execute the install scriptlet if one exists --print only print the targets instead of performing the operation --print-format <string> specify how the targets should be printed Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> [Dan: small coding style touchups] Signed-off-by: Dan McGee <dan@archlinux.org>
* CLI args: update --help and manpageXavier Chantry2010-12-12
| | | | | | | | | | | | | | | The three parts (help, manpage and code) are now organized in the same way and much easier to compare : - specific options - install/upgrade options for -S and -U - transaction options for -S -R and -U - global options After this re-organization, it was easy to update and sync the three components together. Duplication is also avoided. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm: don't expose alpm_depcmpXavier Chantry2010-12-12
| | | | | | | | | | | | | Either we expose all low levels function dealing with pmdepend_t (splitdep and depfree come to mind), or we don't. Since none of the tools use depcmp, I chose to remove it. In the future, we might want to expose higher level functions such as alpm_find_satisfier, or just lower level functions like splitdep and depfree together with depcmp. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm: kill alpm_deptestXavier Chantry2010-12-12
| | | | | | | | This has been replaced by the more flexible alpm_find_satisfier function, and alpm_deptest was completely unsused now. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman/deptest: reimplement with alpm_find_satisfierXavier Chantry2010-12-12
| | | | | | | | | It's very easy to re-implement the -T feature with the more generic alpm_find_satisfier rather then the more specific and less useful alpm_deptest. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm: add new alpm_find_satisfier functionXavier Chantry2010-12-12
| | | | | | | | | | | | whatprovides and splitdep were removed, so depcmp alone is quite useless now without splitdep, and deptest is not flexible enough. Introduce a new alpm_find_satisfier which is hopefully more flexible, this should make implementation of deptest very easy, and also help alpm tools such as pactree. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix a few problems reported by clang-analyzerXavier Chantry2010-12-12
| | | | | | | One missing NULL-check and 3 dead assignments. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Ensure stdin args are correctly terminatedDan McGee2010-12-12
| | | | | | And don't require pm_targets to be empty to read from stdin either. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2010-12-12
|\ | | | | | | | | | | Conflicts: lib/libalpm/be_local.c lib/libalpm/trans.c
| * be_files: write EPOCH instead of FORCEXavier Chantry2010-12-12
| | | | | | | | | | | | | | | | | | | | | | | | This patch is only meant for 3.4.x. It prepares the place for the future epoch-aware release. All force packages that get reinstalled or upgraded will get an EPOCH entry in the local database, and thus the new pacman with epoch won't reinstall them by mistake on the first -Su. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Fix possible null pointer deref in check_archDan McGee2010-12-10
| | | | | | | | | | | | | | | | | | | | | | If we have a corrupted database, a package can come through without an arch, causing the code to blow up when making strcmp() calls. It might even be possible with perfectly valid database entries lacking an 'arch =' line. This behavior was seen as at least one of the problems in FS#21668. Ensure pkgarch is not null before doing anything further. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Small update to Russian translationSergey Tereschenko2010-11-08
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Add initial 3.4.2 NEWS draftDan McGee2010-10-28
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update Swedish translationTobias Eriksson2010-10-28
| | | | | | | | | | | | | | | | 442 translated strings, no fuzzies, no untranslated. modified: po/sv.po Signed-off-by: Dan McGee <dan@archlinux.org>
| * PKGBUILD.vim: add special licenses BSD MIT ZLIB PythonXavier Chantry2010-10-28
| | | | | | | | | | Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Small updates to Spanish translationRicardo PĂ©rez2010-10-28
| | | | | | | | | | | | Also addresses FS#21373. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Support reading package args from stdinDave Reisner2010-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Only occurs if no arguments were provided directly. Arguments can be separated by any amount of valid whitespace. This allows for piping into pacman from other programs or from itself, e.g.: pacman -Qdtq | pacman -Rs This is better than using xargs, as xargs will not reconnect stdin to the terminal. The above operation performed using xargs would require the --noconfirm flag to be passed to pacman. Signed-off-by: Dave Reisner <d@falconindy.com>
* | Merge branch 'maint'Dan McGee2010-10-18
|\|
| * alpm/sync: very small memleak fixXavier Chantry2010-10-18
| | | | | | | | | | Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * libalpm/remove: fix funny progress bar problem with empty packagesXavier Chantry2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ pacman -Rd kde-meta Remove (15): kde-meta-kdewebdev-4.5-1 [0.00 MB] kde-meta-kdeutils-4.5-1 [0.00 MB] kde-meta-kdetoys-4.5-1 [0.00 MB] kde-meta-kdesdk-4.5-1 [0.00 MB] kde-meta-kdeplasma-addons-4.5-1 [0.00 MB] kde-meta-kdepim-4.5-1 [0.00 MB] kde-meta-kdenetwork-4.5-1 [0.00 MB] kde-meta-kdemultimedia-4.5-1 [0.00 MB] kde-meta-kdegraphics-4.5-1 [0.00 MB] kde-meta-kdegames-4.5-1 [0.00 MB] kde-meta-kdeedu-4.5-1 [0.00 MB] kde-meta-kdebase-4.5-1 [0.00 MB] kde-meta-kdeartwork-4.5-1 [0.00 MB] kde-meta-kdeadmin-4.5-1 [0.00 MB] kde-meta-kdeaccessibility-4.5-1 [0.00 MB] Total Removed Size: 0.06 MB Do you want to remove these packages? [Y/n] ( 1/15) removing kde-meta-kdewebdev [------------------------] 100% $ it stopped here.. On one side, libalpm did not initialize the progress bar at 0 percent. So with meta-packages that have 0 files, there was only one progress bar call with percent == 100. On the other side, pacman callback kept track of the last percent that it received. When there are only meta-packages, we always received only 100, so pacman believed the progress bar needed not update. Thus only the first package was actually displayed. A proper fix for the callback would be to keep track of last package name to make sure the recorded prev percent applies. But since we now specify that both Add and Remove should at least send percent=0 at beginning and percent=100 at the end, there is no need for that. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: use valgrind.supp fileXavier Chantry2010-10-18
| | | | | | | | | | Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Tests: '-S repo/group' syntaxJakob Gruber2010-10-18
| | | | | | | | | | | | | | when calling '-S repo/group', only group members in <repo> should should be installed (group members in other repos are ignored) Signed-off-by: Dan McGee <dan@archlinux.org>