Commit Graph

36 Commits

Author SHA1 Message Date
Eli Schwartz
bcb44891ef autotools: distribute meson files
If we use make dist to create the official, signed release tarballs,
those will not have meson build files by default since autotools doesn't
know what they are.

Also distribute all src/common/ files. We never strictly needed any of
them to be distributed with autotools, because the dist tarball
dereferences the symlinks (???), but only some of them were being
distributed, and meson needs them to be in the right location as we only
build libcommon from the primary files.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-04 11:25:48 +10:00
Dave Reisner
18a6440061 meson: remove tap-driver.py, use meson's TAP protocol
This includes a patch from Andrew to fix pactest's TAP output for
subtests. Original TAP support in meson was added in 0.50, but 0.51
contains a bugfix that ensures the test still work with the --verbose
flag passed to meson test, so let's depend on that.
2019-08-12 10:03:17 +10:00
Dave Reisner
51db84750e Add meson.build files to build with meson
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-11-02 03:16:34 -04:00
Eli Schwartz
860e4c4943 Remove all modelines from the project
Many of these are pointless (e.g. there is no need to explicitly turn on
spellchecking and language dictionaries for the manpages by default).

The only useful modelines are the ones enforcing the project coding
standards for indentation style (and "maybe" filetype/syntax, but
everything except the asciidoc manpages and makepkg.conf is already
autodetected), and indent style can be applied more easily with
.editorconfig

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-05-14 09:59:15 +10:00
Alad Wenter
1f8f0bd9ac makepkg: Move parseopts from library to libmakepkg
parseopts is used in makepkg and other scripts such as pacman-key as a
getopt replacement.

Instead of including it in those scripts via a macro, move it to
libmakepkg/util/parseopts.sh and have scripts source this file where
appropriate.

To keep the parseopts test, a new variable was introduced:
PM_LIBMAKEPKG_DIR

Signed-off-by: Alad Wenter <alad@archlinux.info>
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-22 20:50:54 +10:00
Dominik Fischer
b0ae59724e makepkg-template: support multiple --template-dirs
Especially when maintaining local templates in addition to the ones
stored in /usr/share/makepkg-template, it can be useful to include
templates stored in multiple different locations into one PKGBUILD. This
patch makes this possible by allowing --template-dir to be specified
multiple times.

This also introduces a dedicated error message when a template cannot be
found, in contrast to the already existing "Couldn't detect version for
template '%s'".

If a template of the same name is present in more than one of the given
directories, the last one always takes precedence.

Neither the default behaviour without the option given, nor the handling
of a single template dir is changed.

Signed-off-by: Dominik Fischer <d.f.fischer@web.de>
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-12 14:00:54 +10:00
Florian Pritz
0108884952 test makepkg-template: Add update-version-with-newest-option
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:25 +10:00
Florian Pritz
d5f703729f test makepkg-template: Add template-without-version
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:25 +10:00
Florian Pritz
bd2473797e test makepkg-template: Add name-charset-valid
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:25 +10:00
Florian Pritz
6201f6e5ac test makepkg-template: Add name-charset-invalid
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:24 +10:00
Florian Pritz
4dd9ccbc78 test makepkg-template: Add missing-template-symlink
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:24 +10:00
Florian Pritz
17ad845c41 test makepkg-template: Add missing-template-file
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:24 +10:00
Florian Pritz
287f7a575e test makepkg-template: Add keep-old-version
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:24 +10:00
Florian Pritz
dfacd8473e test makepkg-template: Add invalid-template-line-unknown-marker
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:24 +10:00
Florian Pritz
107eabdfb3 test makepkg-template: Add invalid-template-line-missing-name
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:24 +10:00
Florian Pritz
207ba1e05f test makepkg-template: Add invalid-key
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:24 +10:00
Florian Pritz
ca5af32b99 Add testrunner for makepkg-template
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:24 +10:00
Andrew Gregory
f1e010a5a7 add tap_ prefix to test helper functions
Allows tap.sh to show the line number where the helper function was
called on failures.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-28 13:06:39 +10:00
Andrew Gregory
29c0d8233b use tap.sh for bash tests
tap.sh is a reusable TAP library that handles test counting and provides
useful diagnostic messages on test failures.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-28 13:06:28 +10:00
Andrew Gregory
fda599df37 add vim modeline to test files
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:30 +10:00
Andrew Gregory
bd744d067d add pacman-db-upgrade-v9.py to check_SCRIPTS
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04 20:11:18 +10:00
Andrew Gregory
8cd41ec62b tests/pacman-db-upgrade-v9: set additional paths
--config does not respect root, causing pacman-db-upgrade to read the
local pacman.conf rather than the one in the test root.

Also add a rule to ensure the ALPM_DB_VERSION file is actually being
created.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04 20:11:18 +10:00
Andrew Gregory
627ede8779 add pacman-db-upgrade test
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 15:10:37 +10:00
Florian Pritz
cd2370754a Remove ts and sw from vim modeline when noet is set
Forcing vim users to view files with a tabstop of 2 seems really
unnecessary when noet is set. I find it much easier to read code with
ts=4 and I dislike having to override the modeline by hand.

Command run:
find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} +

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:19:25 +10:00
Jason St. John
7bfaa358ea Replace "echo" command with "printf" in human_to_size_test.sh
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15 11:02:27 +10:00
Jason St. John
230bd5c2fd Fix whitespace and other formatting issues
This commit:
-- replaces space-based indents with tabs per the coding standards
-- removes extraneous whitespace (e.g. extra spaces between function args)
-- adds missing braces for a one-line if statement

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
2013-11-15 11:02:27 +10:00
Andrew Gregory
ea6aeef8ba Makefile.am: fix typo in LOG_DRIVER variable
Self-executing tests were not being run through the tap log driver.
This caused `make check` to ignore discrepancies between the expected
number of tests and the actual number of tests.

Also, fix some uncommented output from test scripts that could confuse
TAP parsers.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15 11:02:27 +10:00
Andrew Gregory
9263cc5874 provide default values for test scripts
Our test scripts currently require that the first argument be the
library or binary to be tested.  This makes integrating them with
automake which doesn't have a mechanism for passing specific arguments
to individual tests.  Instead, provide a default built from paths in the
environment which can be provided to all test scripts by automake.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-08-21 11:00:18 +10:00
Andrew Gregory
d3726bbd26 convert test scripts to tap output
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-08-21 11:00:18 +10:00
Allan McRae
0f988beff8 Merge branch 'maint' 2013-05-07 12:59:44 +10:00
Eric Bélanger
9de33488bf Add --noprepare option to makepkg
This new option disables the prepare function. Useful in combination
with -o to get an unpatched copy of the sources for testing purpose.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-30 21:04:21 +10:00
Anatol Pomozov
769facca22 Fix spelling errors using 'codespell' tool
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-18 13:20:13 +10:00
Andrew Gregory
274c3890b0 make test/scripts/human_to_size.sh executable
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-07 10:48:11 +10:00
Allan McRae
47711947dd Scripts testsuite output consistency
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:39:52 -05:00
Dave Reisner
b58489d29a scripts/library: add human_to_size
This is a bash wrapper around an awk function that parses human readable
sizes and returns their representative values in bytes, as a string. A
small test harness is added to validate the functionality.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:39:12 -05:00
Dave Reisner
8679cd68d8 scripts/library: introduce parseopts
This will replace our current options parser used in pacman-key,
makepkg, and ideally elsewhere. It follows heuristics closer to that of
GNU getopt long (and thus pacman itself), with the exception that it
does not allow for options with optional arguments. Due to the way this
parser will be used, this sort of functionality will not be needed.

Instead of relying on eval+set, options are normalized into an array,
OPTRET, which callers should expect to be populated after returning from
parseopts. This avoids problems with quotes and spaces in arguments,
assuming that the user quotes properly when passing into the
application.

A new test harness for parseopts is added in test/scripts.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 08:38:36 -05:00