summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2013-01-28pacsort: add -f, --files option for sorting filenamesDave Reisner
Teach pacsort to understand package filenames and optionally strip away some of the context. alpm_pkg_vercmp() intentionally only understands pure versions, so strings such as '18.0-2-x86_64' and '18.0.1-1-x86_64' will be compared wrongly. Partially addresses FS#33455. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Allow querying directory ownershipAndrew Gregory
The restriction of not checking the ownership of a directory is unnecessary given that all the package filelists contain this information. Remove this restriction, with the expectation that you might get multiple packages returned for a given directory. Additionally attempt to minimise the number of files getting through to the slow realpath call. Original-work-by: Dan McGee <dan@archlinux.org> Original-work-by: Allan McRae <allan@archlinux.org> Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04query_fileowner: don't append '/' if path is "/"Andrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Fix space between control structure and open parensGerardo Exequiel Pozzi
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Fix open braces styleGerardo Exequiel Pozzi
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Fix missing spaces in operatorsGerardo Exequiel Pozzi
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04fix comment style // -> /* */Gerardo Exequiel Pozzi
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Split common utility functions for libalpm and pacmanAllan McRae
There is duplicated code in the util.c files in the libalpm and pacman source code. Split this into a separate file so that it can be shared via a symlink. This prevents code divergence between the two code bases. Also, move mbasename and mdirname from pacman/util.c into util-common.c in preparation for the following patch that uses them to add an extension to pacsave files. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Remove checks for geteuidAllan McRae
The geteuid function is defined in POSIX and we will not support any operating systems without it. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Remove Cygwin supportAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03util/pactree: correctly free the deps list in walk_deps()Dan McGee
If we are reversed, then we were correctly freeing both the list and the contained data. However, we were leaking a list in the case of a non-reversed traversal. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Update copyright year for 2013Allan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Remove leading "./" from filenames in mtree fileAllan McRae
A properly formatted mtree file may stick a leading "./" in front of file names in the root directory. Strip this if present. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Check file types match before comparing propertiesAllan McRae
Bail early in file validation checks if the file type given in the mtree file does not match that in the filesystem. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Check "install" and "changelog" files for changesAllan McRae
The "install" and "changelog" entries for a package in the local database are now checked for changes with -Qkk. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Perform full checking of files with -QkkAllan McRae
The follow fields are checked: Directory: uid, gid, mode File: uid, gid, mode, size, time Symbolic Link: uid, gid, mode, link, time A skeleton is added for checking a files md5sum and sha256sum when reading this information is supported by libarchive. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Basic running of pacman -Qkk to check mtree filesAllan McRae
If a package has an mtree file, using pacman -Qkk will read that file and use it to perform more in depth package checking. Currently this only checks for file presence. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Separate checking a files existence into a functionAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Move check function into its own fileAllan McRae
There is going to be a lot of overlap in the code for the quick and full checks that can be abstracted into their own functions. Also many other file checking functions will be needed for the full check. Put all these in a separate source file. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Do not warn about missing database if being downloadedAllan McRae
When a configured repo database is not already downloaded, a warning message such as "warning: database file for 'testing' does not exist" is printed. Disable this warning when the database is scheduled to be downloaded in the transaction. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Print package name before changelog entry with -QcSimon Gomizelj
Fixes FS#32362 Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14query.c: simplify is_foreignAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Plug various minor memory leaksAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Display install status of optdependenciesAllan McRae
When a packages (new) optdepends are printed in install (update), add a note of their current installation status. Packages currently installed are labelled with [installed] and packages to be installed in this transaction are labelled [pending]. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add "Optional for" to package information outputAllan McRae
Much like packages that require a give package are displayed in the "Required by" field of its information output, alos display packages that optionally require the package. Inspired-by: Benedikt Morbach <benedikt.morbach@googlemail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Display optdep install status in package query outputAllan McRae
Indicate which optional dependencies are installed when viewing local package information (-Qi). Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Notify of removed package required as optdependAllan McRae
When a package is being removed, provide a notification (via a callback) if any local package requires it as an optdepend. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: unindent first limbAndrew Gregory
Removing the leader for the toplevel package shifted the name left but not it's limb. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: unify output between utf8 and asciiDave Reisner
Ensure that both output formats have equal spacing, and therefore an equivalent layout. This change also removes the styling from the toplevel package being searched for. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: fix style violationsDave Reisner
Stick to c89 and avoid mixed code and declarations, and always brace block statements, even if they're only 1 line. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: autodetect and use unicode line drawing charactersDave Reisner
Add a compile time check for langinfo.h so that we can possibly use unicode line drawing characters if the current locale is supportive of them. This can be explicitly disabled at runtime with the use of a new switch: -a, --ascii. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: style last branch node differentlyAndrew Gregory
Also removes the less helpful provides-specific branch tip. Old: New: |--pkg |--pkg +--dep1 provides dep5 |--dep1 provides dep5 | |--dep2 | `--dep2 |--dep3 `--dep3 |--dep4 `--dep4 [dreisner@archlinux.org: switch original suggestion of \-- to `--] Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: fix --sync getopt valueAndrew Gregory
The long --sync options has apparently never worked. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pacman: add -n/--native filter to -QSimon Gomizelj
Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27buildsys: eschew use of DEFS, prefer AM_CPPFLAGSDave Reisner
This is redundant, and any usage of -D should belong to CPPFLAGS. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27Fix thinko in configure.ac CFLAGS empty checkingDan McGee
Since commit d2669b47, CFLAGS specified on the command line haven't been respected at all, resulting in no optimization being applied to builds. This exposed one warning flag issue in some new code, which is also fixed here. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18Avoid interger overflow when calculating remaining line lengthAllan McRae
When the len and cidx were changed to size_t in a8a1b093, it was possible to have an integer overflow when a line ended right at the edge of the terminal width. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18Fix typo in documentationAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18query_fileowner, mdirname: add error checksAndrew Gregory
Also consolidates cleanup for query_fileowner. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-09-18query_fileowner: remove assumption that root is "/"Andrew Gregory
Returning "/" from mdirname removes it as a special case which allows us to test it like any other directory. This corrects a false positive when querying a file in / and root is not set to /. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-09-18query_fileowner: remove trailing '/' from targetsAndrew Gregory
Trailing '/' in paths causes lstat to dereference symlinks to directories which causes it to break even though the symlink is a valid target. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-09-18query_fileowner: resolve root earlyAndrew Gregory
Resolving root early prevents later calls to realpath from having to do the work of actually resolving any symlinks in root. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-18query_fileowner: remove resolve_path functionAndrew Gregory
resolve_path is a equivalent to calling realpath(path, NULL) except that the returned string is guaranteed to be PATH_MAX long. We never append to the returned string, so this is unnecessary. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-09-18query_fileowner: break/continue pkgfile loopAndrew Gregory
Break out of pkgfile loop on match or continue if the pkgfile path is too long. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-08-07Move important information up in -Si outputAllan McRae
Currently, the package description is printed at the end of the -Si output. This is probably one of the more important pieces of information so should be nearer the top. Also move the package architecture up. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-07coding style fixesFlorian Pritz
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02Allow cleaning only some cachedirsJan Alexander Steffens (heftig)
When cleaning the cache, ask for each cachedir separately. Allan: add some white space in output Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01Clean up exclusion list in sync cache cleanupDan McGee
Make an array out of our various glob skip patterns and loop through them looking for items to skip. Additionally, when doing a full clean, delete all objects rather than respect this skip list. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01Skip deltas and partial downloads in package cleanupDan McGee
This affects -Sc only, not -Scc. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01pactree: show tree vertical "limbs"Andrew Gregory
Showing vertical limbs makes the tree easier to follow. Old: New: |--pkg |--pkg |--dep1 |--dep1 |--dep2 | |--dep2 |--dep3 |--dep3 |--dep4 |--dep4 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> [Allan: fix shadow warning] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>