summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-01-10makepkg: fix broken check for the fakeroot binaryEli Schwartz1-1/+1
In commit d8ee8d0c99c3820951e2e49dbdb71a5390bd1dc4 we made use of fakeroot absolutely mandatory, and disabled a lot of the code which checked to see if this now-defunct BUILDENV option was set, before setting up the environment to use fakeroot. Unfortunately, we missed one spot. The check_software routine still checked to see if fakeroot was enabled, but due to the option being removed, thought that it was in fact disabled, and as a result this check would never run. Fix by checking to see if we are trying to build either a package or a source package, and if so, checking for fakeroot. These are the only two situations where fakeroot is needed. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10makepkg: add internal variable to track when we're building a packageEli Schwartz1-7/+8
There are state variables for everything else, and we use them to do conditional checks on things, but it's currently a bit difficult to test whether a package is being built, as it's the default action if *no* options are specified. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04makepkg: Make pkgdir a localJan Alexander Steffens (heftig)1-2/+2
Causes it to be reset (to $pkgdirbase/$pkgbase) between subpackages. This shouldn't be visible. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04makepkg: Create a single-package packaging functionJan Alexander Steffens (heftig)1-16/+15
Merge the similar code handling unsplit PKGBUILDs and individual packages in a split PKGBUILD and make it a new function. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04makepkg: Only backup package variables onceJan Alexander Steffens (heftig)1-1/+1
We don't need to re-backup the variables we restored on the previous iteration. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04libalpm/add.c: move assignment into conditional in alpm_add_pkgMichael Straube1-2/+1
While at it and for consistency move the assignment of the variable 'local' into the subsequent conditional. Signed-off-by: Michael Straube <michael.straube@posteo.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04Move skipping of duplicate sync/remove targets into libalpmMichael Straube4-19/+13
sync: As pointed out by Andrew Gregory there could be an error when adding duplicates if they are two separate packages with the same name. Add a check in alpm_add_pkg() to test whether the duplicate is actually the same package, and if so, log a debug message and return success to skip the package. If the duplicate is a different package return ALPM_ERR_TRANS_DUP_TARGET and treat that error just like any other error in pacman. remove: Change alpm_remove_pkg() to just log a debug message and return success to skip duplicates. Remove the handling of ALPM_ERR_TRANS_DUP_TARGET in pacman. Also fixes FS#49377. Suggested-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Michael Straube <michael.straube@posteo.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04repo-add: don't break if delta package sources contain epochEli Schwartz1-2/+2
Our sed parser for xdelta3 headers will greedily match on ":" which coincidentally is also the character we use to define a version with an epoch. While we are at it, simply use sed for the whole pipeline, rather than using both grep and sed. Fixes FS#61195 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04repo-remove: fix removing packages with deltasEli Schwartz1-1/+1
We have code in order to remove deltas when removing a package, but it is never run, since we try to remove the wrong file. This was broken in commit cb0f2bd0385f447e045e2b2aab9ffa55df3c2d8a which modified the internal layout we use to modify the db, changing "tree" to "db", but did not update all locations where it was used. This worked swimmingly well as long as only repo-add updates were handling the backup and restore of the delta file, as the delta file therefore got backed up to the correct location (db) in the shared db_remove_entry() function. But later on in the repo-remove logic, we tried removing a different file that will never exist (tree). Fixes FS#53041 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04allow tests for disabled features to be skippedAndrew Gregory6-19/+59
Previously, pacman's test suite would fail when compiled without signature support. Adds a require_capability method to pmtest objects. Currently recognized values are 'gpg', 'curl', and 'nls'; although only gpg is used presently. Missing features are indicated by running pactest with one of the --without-<feature> options. This modifies pmenv to run each case as independent tests. Previously, a single pmenv could run multiple tests, combining there output into a single TAP stream but making it impossible to properly skip an entire test case. This change does not affect running pactest.py with a single test (as both autotools and meson do), but will affect anybody manually running pactest.py with multiple tests at once. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04tap.py: add skip_all functionAndrew Gregory1-0/+5
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04remove unused test summary codeAndrew Gregory2-8/+0
Unused since 12e00af5315135a29a66c9aaa01e141a32d4634b Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04silence warning when built without curlAndrew Gregory1-0/+2
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-12-25update NEWS for v5.1.2Andrew Gregory2-0/+16
Signed-off-by: Andrew Gregory <andrew@archlinux.org> (cherry picked from commit f8c73464c9cf86d6b917542585d74514f150c67b)
2018-12-25update NEWS for v5.0.2Andrew Gregory2-0/+19
Signed-off-by: Andrew Gregory <andrew@archlinux.org> (cherry picked from commit fdf53393bc996a514bbfc9fcd6ea19a8bb2f02ed)
2018-12-12meson: add trailing slashes to directory components in configuration definesEli Schwartz1-3/+3
This matches what we currently do in the autotools build configuration, and ensures that the default pacman-conf definitions for unspecified values consistently end with the trailing directory slashes. This has ramifications for thirdparty tools that up to now, have relied on this slash being there. Those tools should be fixed to prevent breaking when custom locations are set, but this is no reason not to fix it on our end as well. An extra trailng slash should never cause harm. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-12-12meson: install the directories needed for successful pacman operationEli Schwartz1-0/+9
This was neglected in the initial meson port. We need these directories to exist in order to bootstrap a new installation. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-12-12meson: remove useless mkdir -pEli Schwartz1-7/+0
directories are created by install_dir within the subdir custom_target installation targets. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-12-10Enable additional debug flags/logging with debugoptimized buildsDave Reisner1-1/+1
This lets developers run a local build with optimizations but also the added debug logging that comes with PACMAN_DEBUG being defined. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-12-10scripts/library: fix typo in READMEMichael Straube1-1/+1
Simply fix a typo: in written -> is written Signed-off-by: Michael Straube <michael.straube@posteo.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-12-10check localdb before upgrading packageAndrew Gregory4-1/+30
Commit 2ee7a8d89ad693617307260604e1d58757fd2978 replaced a manual check for a local package with a check for the "oldpkg" member, which gets set at the beginning of the transaction. If the package was also in the remove list, such as when a package gets replaced, it would no longer be in the local db and pacman would try to remove it twice, resulting in superfluous error messages. Fixes: FS#50875, FS#55534 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-12-04libmakepkg/executable: don't rely on scoped value of $ret to flag outcomesEli Schwartz9-14/+12
Elsewhere, we return 1 if a library dropin fails, and when running functions in a loop, we use `|| ret=1` to preserve scope. This ensures the return value of the function remains useful in isolation. Do the same thing here as well. Drop trivial function which wraps a dropin that also uses $ret, since it's no longer needed. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-12-04Make `make distcheck` work when bash-completion is installed.Eli Schwartz1-1/+2
bash-completion uses pkg-config to determine the best installation directory, but this does not take --prefix into account (although it works fine with DESTDIR). The fallback value does attempt to set this based on --prefix. The distcheck uses --prefix, though, which means when attempting to install the results and bash-completion support for pkg-config was detected, it errors out on trying to write to, usually, /usr/share. Tell distcheck to use the prefix-based fallback location instead, as the PKG_CHECK_* override. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-12-03configure.ac: use $datarootdir instead of $prefix/shareAllan McRae1-2/+2
Even worse, makepkg-template ignored $prefix completely.
2018-11-28scripts: make repo-add utilize a wrapper as wellEli Schwartz1-5/+3
Now that repo-add uses libmakepkg, it needs to have $LIBRARY set before testing it in-tree. [Allan: fix "make distcheck"] Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28autotools: be more accurate in comments when generating processed scriptsEli Schwartz1-1/+1
Instead of assuming all scripts are .sh.in and leaving a comment to that effect, just take the input file directly. This depends on the first dependency for the target being the source of the script. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28scripts: fix some inaccurate Makefile targets, and be more templatedEli Schwartz1-14/+2
All of our scripts depend on the same pattern .sh.in, and since commit b5d62d2c91a2caf5c18945921cdf12af6f36b2d4, they also all (not just makepkg itself) depend on libmakepkg. There's no real reason to include separate targets for them just to establish dependency rules. While we are at it, fix a longstanding bug where generated wrapper scripts did not depend on wrapper.sh.in (which due to moving to .lib, requires we regenerate the script too), by making the shared target pattern depend on it. All our generated scripts now require the wrapper, even repo-add which now uses libmakepkg. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28scripts: fix repo-remove/elephant Makefile targetsEli Schwartz1-7/+3
repo-remove and repo-elephant don't care whether repo-add.sh.in is updated... but they do require the repo-add target to be up to date, so use that instead. As a bonus, use the same rule for both of them.
2018-11-28meson: be more accurate in comments when generating processed scriptsEli Schwartz1-1/+1
Instead of assuming all scripts are .sh.in and leaving a comment to that effect, just take the input file directly. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28build-aux: rm annoying and useless fileEli Schwartz1-652/+0
tap-driver.sh is added to the build tree by autoreconf, and contains upstream modifications as such. This results in dirty working trees. It was originally added in commit 403c175dbc84a8198b92bbe76f66eade613cff48 which made the testsuite use automake, but as far as I can tell, never served any purpose. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28add missing tests to meson.buildAndrew Gregory1-0/+2
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28common/ini: remove unnecessary alpm includeAndrew Gregory1-2/+1
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-27require actual siglevel for defaultAndrew Gregory1-1/+4
ALPM_SIG_USE_DEFAULT does not refer to an actual siglevel, rather it indicates that the global default should be used in place of the operation-specific one. Setting this value for the global default itself makes no sense. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-27always allow explicit empty siglevel for sync dbsAndrew Gregory1-1/+1
An empty siglevel does not do any signature verification which is exactly what we want when compiled without gpg support. This is already allowed in other parts of the codebase and required for the test suite to pass when compiled without gpg support. Fixes: FS#60880 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-27add specific error for missing gpg supportAndrew Gregory4-5/+10
"wrong or NULL argument passed" is a useless error for end users. Fixes FS#60880. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-27Split prepare_buildenv() to libmakepkgQue Quotion9-43/+236
This opens the door for third parties to provide libmakepkg extentions for the purpose of altering the build environment. Signed-off-by: Que Quotion <quequotion@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-27Split check_software() to libmakepkgQue Quotion15-172/+537
This opens the door for third parties who provide extensions to libmakepkg to supply scripts that confirm the presence of their dependant executables. Signed-off-by: Que Quotion <quequotion@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-27scripts/meson: ensure wrapper scripts are executableDave Reisner1-12/+9
2018-11-27makepkg: if "!buildflags" and "debug" coincide, unset the debug buildflags tooEli Schwartz1-1/+1
If a user has a makepkg.conf policy to enable debug builds, but a PKGBUILD has disabled buildflags, we would unset the *FLAGS but then later append the debug *FLAGS anyway, which would result in some *FLAGS being used, against the wishes of the PKGBUILD author. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-27buildsys: remove size_to_humanDave Reisner5-30/+1
This was only ever used by paccache, and paccache has since been moved to pacman-contrib.
2018-11-27meson: separate out wrapped from non-wrapped scriptsDave Reisner1-2/+18
makepkg-template is a perl script and doesn't get wrapped by our shell wrapper. It (wrongly) reads from the host machine rather than the build root, but this is working as implemented.
2018-11-27Remove Doxyfile from EXTRA_DISTAllan McRae1-1/+0
We generate this now, so no need to distribute. Fixes "make dist". Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-03repo-add: print the name of the database when extractingEli Schwartz1-1/+1
Currently this prints the following message: ==> Extracting database to a temporary location... ==> Extracting database to a temporary location... This redundancy is potentially confusing and may cause people to think something is wrong. Historically, this message came from a time when we only extracted one database, but repo-add was changed to always create the files database in commit cb0f2bd0385f447e045e2b2aab9ffa55df3c2d8a and whole code block with message intact was moved into a for loop and run (and printed) twice. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-03makepkg: fix .PKGINFO/.BUILDINFO files swallowing status printingEli Schwartz1-3/+2
The respective write_* functions are low-level and shouldn't be outputting statuses; move these to the logic flow where they are used. This ensures the functions can be used in the future wherever, and also solves an issue where, as fallout from the message.sh retrofitting in commit 882e707e40bbade0111cf3bdedbdac4d4b70453b, the statuses got redirected to the actual files. The resulting package was technically correct, except that it contained useless lines which pacman ignored, and repo-add also ignored but at the same time generated an error message: /usr/bin/repo-add: line 335: declare: `=-> Generating .PKGINFO file...': not a valid identifier Thirdparty package tools with stricter parsers may abort with errors, and "repose" is known to do so. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-03pacman-key: just accept one file to verify, and enforce detached sigsEli Schwartz2-13/+26
Simply pass options on to gpg the same way gpg uses them -- no looping through and checking lots of signatures. This prevents a situation where the signature file to be verified is manipulated to contain an embedded signature which is valid, but not a detached signature for the file you are actually trying to verify. gpg does not offer an option to verify many files at once by naming each signature/file pair, and there's no reason for us to do so either, since it would be quite tiresome to do so. In the event that there is no signature/file pair specified to pacman-key itself, - preserve gpg's behavior, *if* the matching file does not exist, by - assuming the signature is an embedded signature - deviate from gpg's behavior, by - offering a security warning about which one is happening - when there is an embedded signature *and* a matching detached file, assume the latter is desired Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-02meson: add a wrapper to bootstrap scripts from within build dirDave Reisner4-4/+42
This doesn't do quite as good of a job of "hiding away" the real script as we did with autotools, but it satisfies the need for being able to run scripts which depend on libmakepkg with the local copy within the repo. We do, however, improve upon the autotools script by ensuring that the bash path used in configuring pacman is the interpreter used to run the underlying script.
2018-11-02Add meson.build files to build with mesonDave Reisner27-0/+2063
Provide both build systems in parallel for now, to ensure that we work out all the differences between the two. Some time from now, we'll give up on autotools. Meson tends to be faster and probably easier to read/maintain. On my machine, the full meson configure+build+install takes a little under half as long as a similar autotools-based invocation. Building with meson is a two step process. First, configure the build: meson build Then, compile the project: ninja -C build There's some mild differences in functionality between meson and autotools. specifically: 1) No singular update-po target. meson only generates individual update-po targets for each textdomain (of which we have 3). To make this easier, there's a build-aux/update-po script which finds all update-po targets and runs them. 2) No 'make dist' equivalent. Just run 'git archive' to generate a suitable tarball for distribution.
2018-10-23Dynamically generate Doxyfile from inputDave Reisner3-2/+6
This isn't super interesting for the autotools side, but it's necessary in order to make things sane for other build systems which we might introduce in the future.
2018-10-21Port scripts to use libmakepkg's messaging code.Eli Schwartz9-95/+40
Remove all remnants of library/{output_format,term_colors}.sh Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-10-21message.sh: add modifications from output_format.shEli Schwartz1-0/+8
In the spirit of making libmakepkg more useful as a library, and, critically, *using* that library for additional pacman scripts, we should include all of output_format.sh and term_colors.sh directly in libmakepkg and hopefully stop having to embed additional copies in e.g. repo-add via m4 macros. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>