summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-01-03pacdiff: update copyright noticeFlorian Pritz1-0/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03pacdiff: Add option to overwrite, clarify remove optionFlorian Pritz1-2/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03pacdiff: check cmp's exit code rather than outputFlorian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03pacdiff: be more verbose if we rename or removeFlorian Pritz1-4/+4
Doesn't hurt and reassures the user that we did the right thing. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03pacdiff: color filename and mention what we foundFlorian Pritz1-1/+25
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Use a defined constant in delta.c for num_matchesDan McGee1-3/+6
This allows compiling in both clang and gcc without running into oddities regarding const vs. defined constant values. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-03util/pactree: correctly free the deps list in walk_deps()Dan McGee1-1/+3
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-03parseopts: remove superfluous continue/shift statementsDave Reisner1-5/+1
Fun fact about bash: the below is valid and will only ever print 'a'! fn() { continue 2 } for x in {1..5}; do for y in {a..e}; do echo "$y" fn done done Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Update copyright year for 2013Allan McRae74-80/+80
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Remove leading "./" from filenames in mtree fileAllan McRae1-0/+7
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 McRae1-1/+26
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 McRae1-2/+13
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 McRae1-1/+135
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 McRae4-4/+76
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 McRae1-13/+22
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Move check function into its own fileAllan McRae4-55/+113
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-14Add public functions for accessing mtree dataAllan McRae3-2/+46
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add internal functions for reading mtree file from local dbAllan McRae3-0/+106
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Extract .MTREE file into local package databaseAllan McRae1-0/+5
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14makepkg: add mtree file into packageAllan McRae1-2/+8
Add an mtree file to the package with all file information. This can be added to the local pacman database on install allowing full package verification. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Do not warn about missing database if being downloadedAllan McRae3-3/+10
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-14Fix future signature timestamp warningAllan McRae1-5/+6
The warning given for a signature timstamp being in the future compared to the system time stated the opposite. Also, move this warning to debug output. It is useless in its current form as the package or database that is giving the error is not mentioned and so other debug output is needed to find the offending signature. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Replace space-based indents in prototypes with tabsJason St. John3-42/+42
The previous commit removed the Vim modelines which replaced tabs with spaces. This commit replaces the space-based indents with tabs. Tabs are generally more compatible with various user preferences regarding indentation of code. Using space-based indents is not flexible regarding user preferences at all. Signed-off-by: Jason St. John <jstjohn@purdue.edu>
2012-12-14Remove Vim modelines in prototype filesJason St. John2-4/+0
It makes little sense to "force" users to replace tabs with spaces, with a width of 2. These settings should be configured by the user in their own ~/.vimrc. This is a resubmission based on Allan's feedback on the ML. Signed-off-by: Jason St. John <jstjohn@purdue.edu>
2012-12-14Print package name before changelog entry with -QcSimon Gomizelj1-0/+1
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 Gregory1-10/+3
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Added LOGDEST variableWilliam Giokas3-1/+17
Places logs in a pre-defined location. The logs are always neatly labeled with package names and numbers, and this way can be more easily sent to network shares as they are written or compressed/cleaned en masse. Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Plug various minor memory leaksAndrew Gregory5-3/+8
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14makepkg: normalize whitespace in $pkgdesc when writing .PKGINFODave Reisner1-1/+1
Specifically, we shouldn't allow newlines in the pkgdesc field, as pacman will ignore the continuation and end the description prematurely as written to the local DB. Normalize ALL whitespace, replacing it with single whitespace characters. Fixes strange errors as seen by FS#32852. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14pkgdelta: avoid use of eval and IFS manipulationDave Reisner1-16/+12
Instead of blindly consuming data from the .PKGINFO file, parse it more closely and only declare variables as needed. Should help to avoid nonsensical errors and possibly dangerous command execution as seen in FS#32852. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Display install status of optdependenciesAllan McRae1-2/+18
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-14Make alpm_pkg_find publicAllan McRae7-24/+30
This function is particularly useful, so make it public. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add pactest for "Optional for" outputBenedikt Morbach1-0/+13
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add "Optional for" to package information outputAllan McRae3-8/+38
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-14Add pactests for displaying optdep installation statusBenedikt Morbach2-0/+27
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Display optdep install status in package query outputAllan McRae1-6/+14
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 McRae3-1/+37
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-12-14It turns out we do care about directories...Allan McRae3-23/+9
This is a bug that has been around since at least 2007. On a package upgrade (either by -S or -U) a new directory could overwrite any file. This is caused by the filelist difference calculation ignoring all directories and thus no new directories were checked for conflicting files on the filesystem. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add pactests for not detecting directory conflicts with upgradesFlorian Pritz2-0/+38
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Fix overzealous package removal with unmet dependenciesAndrew Gregory4-47/+41
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> [Allan: Remove expected failure from fixed pactests] Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14pactest: variant of package removal due to unmet dependenciesAllan McRae1-0/+28
Duplicate of sync140.py but with the alphabetical ordering of the packages changed. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14pactest: removal of packages with unmet dependenciesAllan McRae1-0/+28
Provide a package for removing packages with unmet dependencies. Currently pacman removes too many packages from the transaction (FS#30649). Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14_alpm_filelist_resolve: add useful return codeAndrew Gregory2-38/+47
Return -1 if a path is too long to resolve or we run out of memory. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Avoid upgrade conflict with unchanged effective pathAllan McRae3-5/+3
This applies to a case such as when /lib is a symlink to /usr/lib. If a package is installed which contains /lib/libfoo.so, pacman will complain if this package is then "fixed" to contain /usr/lib/libfoo.so. Since these have the same effective path and it exists within the same package, ignore the conflict. Fixes FS#30681. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Resolve file paths during inter-package conflict checkAllan McRae5-12/+36
File paths are resolved if necessary during inter-package conflict checks so that packages carrying the same effective file due to directory symlinks on the filesystem are flagged as conflicting. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14_alpm_filelist_resolve: use original filenames where possibleAndrew Gregory2-22/+34
If a filename isn't resolved, the original can be used instead of strdup()ing it. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add _alpm_filelist_resolveAndrew Gregory2-0/+181
The _alpm_filelist_resolve function takes a filelist and creates a list with any symlinks in directory paths resolved. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add resolved_path to alpm_filelist_tAllan McRae2-1/+11
Add an array to hold the resolved paths of the files in alpm_filelist_t. When the file name and its resolved file name are identical, the pointer to the original file name is used to avoid duplicate memory allocation. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Detect inter-package conflicts between files and directoriesAllan McRae3-17/+38
Detect a conflict between a file/symlink in one package and a directory in another when both are being installed at once. A side effect is the creation of conflicts between a directory symlink and a real directory (e.g lib -> usr/lib in pkg1 and /lib in pkg2). Given we can not guarantee pkg1 is installed before pkg2, this is a genuine conflict. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14pactest: Provide a full filelist to the pactests that need itAllan McRae2-4/+11
It turns out when you set the filelist for a package to include "usr/lib/foo" in the pactest suite, it thinks there is only the file "usr/lib/foo" in there... No "usr/" or "usr/lib/" directory. This makes life difficult when testing code that scrolls through a filelist looking for directory entries. Signed-off-by: Allan McRae <allan@archlinux.org>