summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-01-28pactest: handle non-default scriptlet shellsAllan McRae9-3/+21
pacman can be configured to use a different shell than /bin/sh for scriplets. Pass the cnfigured value to the pactest suite and make the necessary "copy" of the shell in the test root. Also update all copyright years in the pactest suite. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28Revert execvp and related commitsAllan McRae6-36/+16
This reverts commit 4a8c2852a887d2b1aaa43be3071ab586eb24b9e3. This reverts commit 993700bc6b12cd291544d2a22845f480e8a7925e. This reverts commit bb4d2b72c1d35ab9d65d632be0dcaf00cfa7d600. This reverts commit 60b192e3836a150eb6950ce52241efebbee00f11. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17makepkg: Formatting consistency in write_pkginfoWilliam Giokas1-7/+5
The difference between the echo and the printf's in write_pkginfo seemed to be somewhat sporadic. Also, the INFAKEROOT check was doing the same exact thing as the SPLITPKG check, but formatted much differently and consuming two extra lines. I think this makes it more readable than it was previously, if nothing else. Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17dload: avoid showing progress bars on some redirectsDave Reisner2-5/+17
RFC 2616 doesn't forbid a 301 or 302 repsonse from having a body, and servers exist in the wild that show this behavior. In order to prevent pacman from showing a progress bar when we aren't actually downloading a package (and merely following one of these pain in the butt redirects), capture the server response code in the response header, rather than waiting to peel it off the handle after the download has finished. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Reported-by: Alexandre Filgueira <alexfilgueira@cinnarch.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17Fix release datesAllan McRae1-2/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17pmtest: resolve path to scriptlet shellAllan McRae4-3/+26
In order to support a variety of values for the --with-scriptlet-shell configure flag, pmtest has to be aware of what kind of path was passed, be it an absolute path or a fragment for a path lookup. For absolute paths, leave the path alone. For fragments, search the PATH environment var for the resolved path to the binary. In both cases, join the resultant path to the root directory defined for the test, not a pre-determined bin directory. Fixes FS#31552. With-contribution-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17Do not require full path for scriptlet shellAllan McRae1-3/+3
This increases robustness to the shell location changing paths. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17Do not use full path for ldconfigAllan McRae1-7/+4
The ldconfig binary is not guaranteed to be in /sbin. Change to calling just "ldconfig" rather than using the full path. This removed the check that the ldconfig binary exists. However, it is a reasonable assumption that it will exist if its configuration file does. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17Use execvp for running programs in chrootAllan McRae1-3/+3
This makes us more robust to utilities changing paths. There is no functional change when a full path is specified. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Allow querying directory ownershipAndrew Gregory1-19/+41
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 Gregory1-2/+4
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04pacman-key: reduce verbosity of --populatePierre Schmitz1-1/+1
Do not bother the user with gpg's verbose output. Signed-off-by: Pierre Schmitz <pierre@archlinux.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04pacman-key: handle local signing of multiple keysAllan McRae1-8/+14
gpg --lsign-key does not like being given multiple keys to sign. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Fix space between control structure and open parensGerardo Exequiel Pozzi8-28/+28
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 Pozzi8-16/+29
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 Pozzi7-17/+17
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 Pozzi2-2/+2
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Fix spacing in HACKING spacing exampleAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Save backup files with extension .pacsave.nPang Yan Han2-0/+96
Teach pacman to save backup files with extension .pacsave.n, where n is a positive integer. The current backup file shall be saved as <name>.pacsave, while existing .pacsave.n files will be renamed to <name>.pacsave.n+1 Example: 1. You have subversion installed in your local repo. /etc/conf.d/svnserve is a file to be backed up. It contains local modifications 2. You remove subversion from your repo. /etc/conf.d/svnserve is backed up as /etc/conf.d/svnserve.pacsave 2. You install subversion again 3. You edit /etc/conf.d/svnserve 4. You remove subversion. The existing /etc/conf.d/svnserve.pacsave is renamed to /etc/conf.d/svnserve.pacsave.1 and /etc/conf.d/svnserve is backed up as /etc/conf.d/svnserve.pacsave Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Rebased from original email and adjusted for util-common usage. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
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>