summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-01-04Split common utility functions for libalpm and pacmanAllan McRae15-95/+157
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-03Add a -n option to repo-add to only add new packagesDanny George2-0/+10
Packages are already in the pkg db were given a warning, and then readded anyway. With -n specified, the warning is printed, but skips readding it. Signed-off-by: Danny George <dangets@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03makepkg: Print out full version on pkgver updateWilliam Giokas1-0/+2
When building sources with a pkgver function, makepkg will print out the original version before pkgver() is run, claiming that that is the package that will be built. This patch simply re-prints the output later, after pkgver() has been run so people can see which package they are actually building. Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Update DoxyfileAllan McRae1-5/+10
A few parameters were outdated and this produced warnings from Doxygen Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03doc: Fix section link in pacman-key man pageAllan McRae1-2/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Fixed missing asciidoc idDanny George1-1/+1
Generated webpage contained dead links to section 'Package and Database Signature Checking'
2013-01-03makepkg: use --apparent-size when du supports itAllan McRae3-6/+6
Amazingly, using "sleep 1" to convince btrfs to report correct file sizes is only a 90% fix. Sometimes more sleep is needed. Instead we use the --apparent-size argument to du to get actual file sizes. This is used only on Linux as the various BSDs do not support this argument. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Remove checks for geteuidAllan McRae2-5/+1
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 McRae2-8/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
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>