summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-08-04pactest: only snapshot needed filesAndrew Gregory2-6/+17
Only a few of our tests need file snapshots at all and most of them only need a few files. Taking snapshots of the entire test environment for every single test is a massive waste. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04handle: factor out string list option handlingAndrew Gregory2-58/+39
Consolidates repeated code and replaces dangerous strdup calls with STRDUP. Also fix a couple variables named "pkg" that refer to file paths. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04makepkg: skip dependency checking with --verifysourceAllan McRae2-3/+5
Dependencies are now handled with --nobuild unless specificially skipped. Using --verifysource will skip dependency checks unless --syncdeps is specified. Fixes FS#35057 and FS#36999. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04makepkg: ensure vcs download tool are installed when requiredAllan McRae2-0/+75
Add an array VCSCLIENTS to makepkg.conf that matches vcs source protocols to the package containing the software needed for handling the source. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03makepkg: improve check and error message for buildfile locationDave Reisner1-2/+2
The documentation very clearly states that the buildfile has to be in $PWD, but the error thrown by makepkg reference some mysterious "build directory". Simplify this check so that we more directly check that the file being referred to is in fact in our $PWD. Revise the error message when the check fails to more plainly point out the problem. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03sync_prepare: remove useless check for replacersAndrew Gregory1-2/+0
Since 017184fa, alpm_sync_sysupgrade will not add both a replacement and a literal upgrade to the transaction. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03check_pkg_fast: check file typeAndrew Gregory2-4/+13
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03check_file_exists: replace lstat with llstatAndrew Gregory1-3/+3
Paths are constructed directly from package file lists and may contain trailing slashes, causing lstat to dereference symlinks. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03llstat: modify path in placeAndrew Gregory2-8/+12
This makes llstat's signature differ from lstat's, but we never actually use it on a const string and this saves a large number of strdup's. This also allows stripping multiple trailing slashes and corrects a bug where calling llstat on "/" would result in calling lstat on an empty string. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03move _alpm_lstat into util-commonAndrew Gregory8-32/+34
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03add test for file type check with -QkAndrew Gregory2-0/+15
If a directory has been replaced by a symlink, -Qk currently stats the symlink target rather than the symlink itself and doesn't check that the actual file type matches the package file list. This will make it difficult to discover errors once 4.2 is released and replacing directories with symlinks is no longer supported. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03pacdiff: allow DIFFPROG to contain commandline optionsAllan McRae1-3/+3
Also use 'vim -d' as default diff viewer. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03pactest: check for tests before environment setupAndrew Gregory1-5/+4
Setting up the temporary directory and environment is pointless if there are no tests to run. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03pactest: check for pacman binary before runningAndrew Gregory1-1/+5
Using fakeroot or fakechroot as the command with subprocess.call prevents the detection and reporting of a missing pacman binary. Some tests even pass when run with a non-existent binary. Checking manually allows us to provide a meaningful error message and prevent the false positives. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03pactest: parse options before environment setupAndrew Gregory1-3/+5
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03makepkg: Respect XDG_CONFIG_HOMEJohannes Löthberg2-4/+10
Add support for following the XDG Base Directory Specification when reading the user-specific configuration file. If no $XDG_CONFIG_HOME/pacman/makepkg.conf file exists we fall back to sourcing $HOME/.makepkg.conf Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> [Allan] Note XDG_CONFIG_HOME takes priority. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03filelist_intersection: manually compare pathsAndrew Gregory1-34/+22
Prevents the need to modify paths, removing strndup as an unchecked point of failure, and lengths only need to be calculated if the paths match. Also removed an old comment regarding directory/symlink compatibility. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-07-01Add validpgpkeys to PKGBUILD prototypes.Allan McRae2-0/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-29makepkg: handle "epoch=" in PKGBUILD with pkgver functionAllan McRae1-6/+7
After resourcing the PKGBUILD in update_pkgver(), set the epoch to 0 if it is empty. Also adjust the get_full_version function to be more robust if epoch somehow still is empty. Fixes FS#41022. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-29use monotonic clock for progress updatesAndrew Gregory1-27/+31
gettimeofday is susceptible to backwards system time adjustments, skewing or altogether breaking progress output. For the sake of platforms that lack clock_gettime support, gettimeofday is retained as a fallback. Fixes FS#36983 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-29libalpm: check for valid public key algorithmChristian Hesse1-0/+12
2014-06-29cache terminal size, add SIGWINCH handler to resetDave Reisner5-22/+56
Refactoring getcols, yet again. We do the following: 1) Introduce a static global in src/pacman/util.c 2) getcols always prefers this cached value, but will derive it from the COLUMNS environment var, the characteristics of stdout, or a sane default (in that order). 3) Introduce a SIGWINCH signal handler to reset the cached value, meaning we only call ioctl when we don't know the value. On my machine, pacman -Syy goes from ~4300 ioctl calls to 3.
2014-06-29Revert refactoring in fa0c1e14Allan McRae1-1/+1
This will cause the code to break as soon as we handle another signal such as SIGWINCH... Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-24pacman: Correct signal handler comment and refactorSilvan Jegen1-3/+3
One of the comments for this function is out of sync with the code. Since the code exhibits the more sane behavior of treating SIGINT and SIGHUB the same way (by not exiting pacman when there is a commit in flight) we adjust the comment. Given this code flow, the if/else statements can be simplified somewhat as well. Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-24events: Make alpm_event_t an union of all event-specific structOlivier Brunel2-20/+34
Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-24Update the question callbackOlivier Brunel7-97/+234
Much like with events, instead of using a bunch of void* arguments for all questions, we now send one pointer to an alpm_question_t union. This contains the type of question that was triggered. With this information, a question-specific struct can be accessed in order to get additional arguments. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-24alpm.h: Move alpm_errno_t definition upOlivier Brunel1-84/+87
Because for the new question types, we'll need to use alpm_errno_t let's move its definition up. Of course to do so, we also need to move that of alpm_handle_t as well, so move all opaque structures on top. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-23Move break to a new line for consistencyHong Shick Pak1-1/+2
This was the only break that didn't have its own line in the function parsearg_query. Signed-off-by: Hong Shick Pak <hong@hspak.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-12Use C locale for bsdtar calls during package creationAllan McRae1-3/+3
This ensures packages build on a UTF-8 locale system with non-ASCII character names can be installed on non-UTF-8 systems. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-10makepkg: Remove redundant sig generation commentJohannes Löthberg1-1/+1
Remove the comment above the signature generation command as the command is self explanatory and no longer does what the comment says. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-10Add test case for the perl 5.20 dependency breakageFlorian Pritz2-0/+24
This test currently fails. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-02Add compatibility with gpgme-1.5.0Allan McRae1-0/+4
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-25Clarify that -Ql prints a file listAllan McRae1-1/+1
FS#40234 Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-25makepkg: pass "--nocolor" to pacmanAndrew DeMaria1-1/+1
FS#39982. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-25makepkg: Force buildscripts to be in startdirAllan McRae2-1/+7
We expect all source file to lie in $startdir. However, using "makepkg -p <buildscript>" can currently allows people to specify buildscripts in other directories. This results in confusion about where other sources should lie (in startdir or in the directory that the buildscript is in). Explicitly disable using -p for files in other directories to avoid this issue. Fixes FS#40293. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-23Do not check makepkg-wrapper for standard optionsAllan McRae1-0/+1
Fixes "make distcheck". Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-23makepkg: Introduce validpgpkeys arrayThomas Bächler2-5/+26
If validpgpkeys is set in the PKGBUILD, signature checking fails if the fingerprint of the key used to create the signature is not listed in the array. The key's trust value is ignored. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-23makepkg: Treat a signature from an untrusted key as an errorThomas Bächler1-12/+24
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-23makepkg: Use read to parse status file during signature verification.Thomas Bächler1-19/+74
Instead of invoking grep multiple times, parse the status file once. This refactoring also changes the behvaiour when signature verification fails due to a missing public key: It is now an error instead of a warning. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-22dload: avoid using CURLOPT_FAILONERRORDave Reisner1-7/+8
Use of this flag causes connections to be closed on 404s -- a common occurrence when your config sets DatabaseOptional. Handle the error gracefully, so that the connection can be reused. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-22util: Use off_t instead of int for size valuesFlorian Pritz1-1/+1
Old output: > Total Installed Size: -1527.44 MiB Fixed: > Total Installed Size: 2568.56 MiB Bug introduced in 7b8f8753b15037bf4a88126ffde8195416432c72. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-07remove.c: downgrade TRANS_DUP_TARGET to warningAndrew Gregory2-5/+11
Matches the behavior for sync packages. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-04pactest: treat arguments as files instead of globsAndrew Gregory1-7/+8
glob() returns an empty list if input does not match any files, causing non-existent test files to be silently skipped. Treating arguments as files causes pactest to immediately bail out with an appropriate error message on non-existent files. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-04pmdb.py: change siglevel name to RequiredAndrew Gregory2-2/+2
"Always" is not a valid siglevel. sign002.py was succeeding because pacman failed to parse the resulting config file rather than a failed signature check. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-04register_syncdb: reject db names that contain /Andrew Gregory1-1/+2
alpm downloads databases based on basename causing [foo] and [bar/foo] to silently overwrite each other. Also remove an extra tab Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-04-21strtrim: reset pointer after trimming leading whitespaceDave Reisner2-0/+2
Breakage introduced in 92216c5864efccac when we changed the signature of strtrim to return something more useful. Fixes FS#39976. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-04-21makepkg: use dash instead of underscore in /usr/lib/debug/.build-idSteven Noonan1-4/+4
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-27repo-add: declare pkgbase as localAllan McRae1-1/+1
2014-03-27Always supply base name and version info in .PKGFILE if neededAllan McRae2-8/+18
Provide pkgbase information for non-split packages with pkgbase set. Also record the version of the "base" package. This is useful for matching package files to source packages. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-27makepkg: sign source packages with --signAllan McRae1-0/+6
Signed-off-by: Allan McRae <allan@archlinux.org>