summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* alpm_run_chroot: always connect parent2child pipeAndrew Gregory2016-02-23
| | | | | | | | | | | | Commit e374e6829cea3512f0b4a4069c5a6168f0f8d8a0 closed stdin before running scripts/hooks. This left the exec'd process with no file descriptor 0. If the process subsequently opened a file it would be assigned fd 0, and could potentially be confused for stdin. Connecting and immediately closing the parent2child pipe ensures that the child has an fd 0 and that it is empty. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* ensure gpgdir has a trailing slashAndrew Gregory2016-02-23
| | | | | | | | | init_gpgme checks for various paths under gpgdir by concatenating them directly, giving warning messages incorrectly if gpgdir does not end with '/'. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* do not rely on localdb for hook matchingAndrew Gregory2016-02-23
| | | | | | | | | | | | Relying on localdb to determine which trigger operations should match is completely broken for PostTransaction hooks because the localdb has already been updated. Store a copy of the old version of any packages being updated to use instead. Fixes FS#47996 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* only include .SRCINFO comments in source tarballDominik Fischer2016-02-21
| | | | | | | | This avoids introducing unnecessary changes to the time stamp into package repositories that regularly use --printsrcinfo to update the .SRCINFO file. Signed-off-by: Allan McRae <allan@archlinux.org>
* alpm-hooks.5: document hook running orderAllan McRae2016-02-21
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* only remove pacnew file if it is newAndrew Gregory2016-02-21
| | | | | | | | | | | Check if we overwrote an exiting pacnew file before unlinking it. Otherwise, updating to a version with an unchanged file would delete existing pacnew files. FS#47993 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: remove pkg from OPT_LONG arrayAllan McRae2016-02-20
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Revert "makepkg: Empty/create only $pkgdir's relevant to current PKGBUILD"Allan McRae2016-02-20
| | | | | | | | | This reverts commit f9423cfa5d5b9f2041b70676438082faad1cd1ee. This created issue when building packages with debug info multiple times. It could be fixed, but it confirmed my initial opinion that keeping other directories in $pkgdirbase was wrong. Use different BUILDDIRs if you want to build different things from a single PKGBUILD.
* Log to file when running hooksOlivier Brunel2016-02-20
| | | | | | | | Useful if there's some output (to know where it comes from), or in case of failure. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* doc/alpm-hooks: mention that hooks must have a ".hooks" suffix.Allan McRae2016-02-20
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Make "makepkg -g" ignore the current architecture.Alastair Hughes2016-02-20
| | | | | | | | | | Commit 663c74150ab4ba6d3adc55b0e3f539557a16e352 (makepkg: merge arch dependent variables after PKGBUILD linting) broke "makepkg -g" on a PKGBUILD which did not include the current architecture, by moving the lint_pkgbuild call before GENINTEG was processed. Fix that by setting IGNOREARCH for the "-g" option. Signed-off-by: Allan McRae <allan@archlinux.org>
* libmakepkg: increase robustness of the detection of array variablesAllan McRae2016-02-20
| | | | | | | | Extract array detection into its own utility function that ensures extglob is enabled. Suggested-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* repo-remove: fix checking for non-existent .db databaseAllan McRae2016-02-20
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Add the missing limits.h include to hook.cAlastair Hughes2016-02-20
| | | | | | | | PATH_MAX is only defined in limits.h in musl libc, so ensure that it is included. Presumably this is also required on other platforms. Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* doc/index.txt: update for pacman 5.0Andrew Gregory2016-02-20
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* dump_pkg_info: fix wide character title alignmentAndrew Gregory2016-02-20
| | | | | | | | | | | | | The padding added to the end of the title was based on the return value of mbstowcs which is the number of characters. This caused alignment issues for languages with characters that span multiple columns. Instead, base the padding on the number of columns needed by the translated string as returned by wcswidth. Fixes #47980 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Bring makepkg zsh completions up to dateDoug Newgard2016-02-20
| | | | | Signed-off-by: Doug Newgard <scimmia@archlinux.info> Signed-off-by: Allan McRae <allan@archlinux.org>
* Release 5.0.0Allan McRae2016-01-30
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Update translationsAllan McRae2016-01-30
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Update zsh completion for pacman 5Daniel Wallace2016-01-29
| | | | | | | | | | also include updates from pacman 4.2 https://bugs.archlinux.org/task/47559 Original-patch-by: Boris Staletic <bstaletic@archlinux.net> Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Create makepkg-template and system hook directories upon installAllan McRae2016-01-29
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Add HookDir to example pacman.confAllan McRae2016-01-29
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* bash_completion: update pacman completionAllan McRae2016-01-29
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* bash_completion: update makepkg completionAllan McRae2016-01-27
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman.conf.5: document system hook directoryAllan McRae2016-01-27
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman.8: document --hookdirAllan McRae2016-01-27
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg.conf.5: document option arguments in DLAGENTS need spaces escapedAllan McRae2016-01-26
| | | | | | Fixes FS#43304. Signed-off-by: Allan McRae <allan@archlinux.org>
* PKGBUILD.5: document split package depends are not used during packagingAllan McRae2016-01-26
| | | | | | | makepkg only considers global {make,}depends when checking require packages are installed before building. Signed-off-by: Allan McRae <allan@archlinux.org>
* Remove spacing when outputting package sizesAllan McRae2016-01-25
| | | | | | | | | | | | | | | | | | This spacing appears to have been added to align sizes. It sometimes worked... $ pacman -Si glibc | grep Size Download Size : 8.03 MiB Installed Size : 35.08 MiB And it sometimes failed... $ pacman -Si pacman | grep Size Download Size : 662.82 KiB Installed Size : 4045.00 KiB Remove the spaces for a consistent output. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: do not run prepare() and pkgver() with --repackageAllan McRae2016-01-25
| | | | | | | Bug introduced with commit 8454daa7. Reported-by: Zuyi Hu <hzy068808@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix testing of arrays status for arch specific variablesZuyi Hu2016-01-25
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Pull translations updates from TransifexAllan McRae2016-01-17
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* doc: alpm-hooks.5: Remove extra space in alpm-hooks man pageJohannes Löthberg2016-01-15
| | | | | Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Cast events to void* before passing to callbackAllan McRae2016-01-15
| | | | | | | | Silence warnings from clang about typecasting alignment. Reported-by: Rikard Falkeborn Original-patch-by: Olivier Brunel Signed-off-by: Allan McRae <allan@archlinux.org>
* add alpm_list_appendAndrew Gregory2016-01-15
| | | | | | | | | | | alpm_list_add always returns the provided list making it impossible for callers to check whether or not the operation actually succeeded without manually comparing the list length before and after. alpm_list_append instead returns a pointer to the newly created list item so that success can be checked. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* test version range restrictions corner caseDominik Fischer2016-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test introduced herein illustrates a behavior that may be unexpected to package writers. It creates a package "pkg3" that is configured to depend on a "dependency" which version is between 3 and 4, inclusive. Two other packages are already present, providing "dependency" in version 2 and 5, respectively. So, the situation looks roughly like this: pkg1 pkg3 pkg2 provides depends on provides | <------------> | version __________2____________3____________4____________5___________... This seems to be enough to satisfy pacman when installing "pkg3". From an iterative standpoint, this is completely logical: First, the requirement "dependency>=3" is checked. There is a package that satisfies this restriction, it is called "pkg2". Afterwards, "dependency<=4" is covered in the same way by "pkg1". Nonetheless, what a package writer intends when specifying depends=('dependency>=3' 'dependency<=4') is most probably that pacman should only allow this package to be installed when there indeed is a package present that provides a version of "dependency" that lies _between_ 3 and 5. Signed-off-by: Dominik Fischer <d dot f dot fischer at web dot de> Signed-off-by: Allan McRae <allan@archlinux.org>
* Add pacsort tests with invalid inputRikard Falkeborn2016-01-04
| | | | | Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacsort, introduce define for escape_char error codeRikard Falkeborn2016-01-04
| | | | | | | | | | | | | | The signedness of char is implementation defined. On systems where char is unsigned, comparing a variable of type char with -1 is never true, due to integer promotion rules. To avoid this, introduce a define for invalid field separators where -1 is cast to char. This will ensure that the return value check works for both unsigned and signed char. Fixes one warning [-Wtype-limits] for comparissons with -1 when compiling with -funsigned-char. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Make alpm_graph state signedness explicitRikard Falkeborn2016-01-04
| | | | | | | | | | | | | | | | | | | | | | The signedness of char is implementation defined. Since the alpm_graph state is clearly meant to be signed, make the signedness explicit. This fixes bugs on systems where char is unsigned, in comparissons of the following type: if(v.state == -1) which, if state is unsigned, will never be true due to integer promotion rules. Fixes failing test/pacman/tests/sync012.py when compiling with -funsigned-char. Fixes two warnings [-Wtype-limits] for comparissons with -1 when compiling with -funsigned-char. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update NEWS for pacman-5.0Allan McRae2016-01-04
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Update README for pacman-5.0Allan McRae2016-01-04
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright years for 2016Allan McRae2016-01-04
| | | | | | make update-copyright OLD=2015 NEW=2016 Signed-off-by: Allan McRae <allan@archlinux.org>
* zsh_completion: add -q/--quiet for -Q/-SDaniel Hahler2016-01-04
| | | | | | | | | | This should also be added for "-Fh", but that is missing completely in zsh_completion. 1: https://lists.archlinux.org/pipermail/pacman-dev/2015-November/020538.html Signed-off-by: Daniel Hahler <git@thequod.de> Signed-off-by: Allan McRae <allan@archlinux.org>
* Replace mktemp's --tmpdir option with shell code.Alastair Hughes2016-01-04
| | | | | | | | | bacman and updpkgsums used GNU mktemp's --tmpdir option, which is not supported by some other implementations (including busybox). Replace that with shell code. Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Do not warn about missing files in NoExtractAllan McRae2016-01-04
| | | | | | | | | | The CheckSpace option checks the size of all files in a package being replaced and gives a warning when it can not read the file. However, files in NoExtract are expected to be missing and should not be warned about. Fixes FS#47470. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: Output full URL in case of download failureFlorian Pritz2015-12-15
| | | | | | | | | | | | | | | | | | | | Most entries in $sources contain variables so finding out why a URL fails to download is hard because one has to manually replace the variables when looking at the PKGBUILD. Simply output the full URL here so that it can be easily seen what is wrong. Old: ==> ERROR: Failure while downloading example-1.2.4.tar.gz New: ==> ERROR: Failure while downloading http://example.org/releases/1.1/example-1.2.4.tar.gz With the new format it is much more obvious that the directory name is the culprint (1.1 vs 1.2) while the old one would not display that information. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* alpm: Abort ASAP on failure in pre-transaction hooksOlivier Brunel2015-12-15
| | | | | | | | | | | | | | | There is no need to run any/remaining pre-transaction hooks as soon as a failure has occured, which will lead to aborting the transaction. So if an error occured during the first phase (reading directories/parsing files), or as soon as a hook flagged abort_on_fail does fail, we stop processing them and return. (For post-transaction hooks, all hooks are run regardless since there's no aborting.) Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: run pkgver() and prepare() with --noextractAllan McRae2015-12-15
| | | | | | | | | | Modifications made to the source before running with --noextract may alter the version string returned by pkgver(). Always run this function if present and check build status before proceeding. Fixes FS#46800. Also run prepare() when --noextract is used (unless --noprepare is specified). Signed-off-by: Allan McRae <allan@archlinux.org>
* Give error message when --files will do nothingAllan McRae2015-12-15
| | | | | | Point people towards the help when using "pacman -F" or "pacman -F foo". Signed-off-by: Allan McRae <allan@archlinux.org>
* alpm-hooks: add Description fieldAllan McRae2015-12-15
| | | | | | | | | The "Description" field allows a hook to provide a some text for frontends to use in describing what the hook is doing. For example: Description = updating info page directory Signed-off-by: Allan McRae <allan@archlinux.org>