summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* makepkg: improve check and error message for buildfile locationDave Reisner2014-08-03
| | | | | | | | | | 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>
* sync_prepare: remove useless check for replacersAndrew Gregory2014-08-03
| | | | | | | | 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>
* check_pkg_fast: check file typeAndrew Gregory2014-08-03
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* check_file_exists: replace lstat with llstatAndrew Gregory2014-08-03
| | | | | | | 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>
* llstat: modify path in placeAndrew Gregory2014-08-03
| | | | | | | | | | 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>
* move _alpm_lstat into util-commonAndrew Gregory2014-08-03
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* add test for file type check with -QkAndrew Gregory2014-08-03
| | | | | | | | | | 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>
* pacdiff: allow DIFFPROG to contain commandline optionsAllan McRae2014-08-03
| | | | | | Also use 'vim -d' as default diff viewer. Signed-off-by: Allan McRae <allan@archlinux.org>
* pactest: check for tests before environment setupAndrew Gregory2014-08-03
| | | | | | | 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>
* pactest: check for pacman binary before runningAndrew Gregory2014-08-03
| | | | | | | | | | 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>
* pactest: parse options before environment setupAndrew Gregory2014-08-03
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* makepkg: Respect XDG_CONFIG_HOMEJohannes Löthberg2014-08-03
| | | | | | | | | | | | | | 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>
* filelist_intersection: manually compare pathsAndrew Gregory2014-08-03
| | | | | | | | | | | 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>
* Add validpgpkeys to PKGBUILD prototypes.Allan McRae2014-07-01
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: handle "epoch=" in PKGBUILD with pkgver functionAllan McRae2014-06-29
| | | | | | | | | | 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>
* use monotonic clock for progress updatesAndrew Gregory2014-06-29
| | | | | | | | | | | | 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>
* libalpm: check for valid public key algorithmChristian Hesse2014-06-29
|
* cache terminal size, add SIGWINCH handler to resetDave Reisner2014-06-29
| | | | | | | | | | | | | 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.
* Revert refactoring in fa0c1e14Allan McRae2014-06-29
| | | | | | | 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>
* pacman: Correct signal handler comment and refactorSilvan Jegen2014-06-24
| | | | | | | | | | | | | 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>
* events: Make alpm_event_t an union of all event-specific structOlivier Brunel2014-06-24
| | | | | Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update the question callbackOlivier Brunel2014-06-24
| | | | | | | | | | | | 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>
* alpm.h: Move alpm_errno_t definition upOlivier Brunel2014-06-24
| | | | | | | | | | | 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>
* Move break to a new line for consistencyHong Shick Pak2014-06-23
| | | | | | | | 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>
* Use C locale for bsdtar calls during package creationAllan McRae2014-06-12
| | | | | | | 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>
* makepkg: Remove redundant sig generation commentJohannes Löthberg2014-06-10
| | | | | | | 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>
* Add test case for the perl 5.20 dependency breakageFlorian Pritz2014-06-10
| | | | | | | This test currently fails. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* Add compatibility with gpgme-1.5.0Allan McRae2014-06-02
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Clarify that -Ql prints a file listAllan McRae2014-05-25
| | | | | | FS#40234 Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: pass "--nocolor" to pacmanAndrew DeMaria2014-05-25
| | | | | | FS#39982. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: Force buildscripts to be in startdirAllan McRae2014-05-25
| | | | | | | | | | | | 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>
* Do not check makepkg-wrapper for standard optionsAllan McRae2014-05-23
| | | | | | Fixes "make distcheck". Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: Introduce validpgpkeys arrayThomas Bächler2014-05-23
| | | | | | | | | | 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>
* makepkg: Treat a signature from an untrusted key as an errorThomas Bächler2014-05-23
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: Use read to parse status file during signature verification.Thomas Bächler2014-05-23
| | | | | | | | | | 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>
* dload: avoid using CURLOPT_FAILONERRORDave Reisner2014-05-22
| | | | | | | | | 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>
* util: Use off_t instead of int for size valuesFlorian Pritz2014-05-22
| | | | | | | | | | | | | 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>
* remove.c: downgrade TRANS_DUP_TARGET to warningAndrew Gregory2014-05-07
| | | | | | | Matches the behavior for sync packages. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pactest: treat arguments as files instead of globsAndrew Gregory2014-05-04
| | | | | | | | | | 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>
* pmdb.py: change siglevel name to RequiredAndrew Gregory2014-05-04
| | | | | | | | | "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>
* register_syncdb: reject db names that contain /Andrew Gregory2014-05-04
| | | | | | | | | | 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>
* strtrim: reset pointer after trimming leading whitespaceDave Reisner2014-04-21
| | | | | | | | | 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>
* makepkg: use dash instead of underscore in /usr/lib/debug/.build-idSteven Noonan2014-04-21
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* repo-add: declare pkgbase as localAllan McRae2014-03-27
|
* Always supply base name and version info in .PKGFILE if neededAllan McRae2014-03-27
| | | | | | | | 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>
* makepkg: sign source packages with --signAllan McRae2014-03-27
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* conf.c: remove extra indentationAndrew Gregory2014-03-27
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* check config_new return valueAndrew Gregory2014-03-27
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman/upgrade: Fix memory leaksSören Brinkmann2014-03-27
| | | | | | | Make sure allocated memory is freed before returning. Signed-off-by: Sören Brinkmann <soeren.brinkmann@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman/upgrade: Refactor memory managementSören Brinkmann2014-03-27
| | | | | | | | Refactor the upgrade routine to use an array that can be allocated in one step instead of an alpm_list that is gradually extended in loops. Signed-off-by: Sören Brinkmann <soeren.brinkmann@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>