Commit Graph

71 Commits

Author SHA1 Message Date
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
Allan McRae 0c99eabd50 Remove contrib
The contrib directory takes too much of the pacman developer's limited time,
which could be better spent developing and reviewing patches for the primary
projects. The community can pick this up in a separate repository if wanted.

Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-10 10:38:05 +10:00
Allan McRae 6ea97963b3 Create makepkg-template and system hook directories upon install
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-29 09:50:11 +10:00
Allan McRae 27e3125c8d Merge branch 'maint' 2015-02-12 13:33:20 +10:00
Andrew Gregory c3161925c2 sync200.py.in: remove unused substitution
LIBCURL was never set in the Makefile so XferCommand was always being
set in the test file.  This removes the only substitution in our test
files which will prevent the TESTS file from being rebuilt every time
configure is run.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-12 13:22:24 +10:00
Allan McRae bbac318d7a Add make rule to update copyright years
Usage: make update-copyright OLD=2014 NEW=2015

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-01 21:19:03 +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 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 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
Andrew Gregory 42c859e4cc pmtest: allow tests to specify test binary
Adds a cmd property to tests (defaults to pacman) which is resolved
using directories specified with --bindir (defaults to PATH).  The
ability to manually specify a particular binary is preserved in order to
allow running individual tests with differently named binaries such as
lt-pacman.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 12:54:29 +10:00
Jason St. John 6268e66efa Remove ChangeLog.proto and move important info to PKGBUILD(5)
The change log prototype should be distribution determined.

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:27 +10:00
Maxime Gauduin edce7555a6 Add PKGBUILD-vcs.proto
This PKGBUILD proto covers the newly introduced VCS capabilities of
pacman. It serves as a replacement for the current bzr, git, hg and svn
protos found in ABS.

Signed-off-by: Maxime Gauduin <alucryd@gmail.com>

[Allan: add to Makefile.am]
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:11:32 +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
Andrew Gregory 00b6694068 Makefile.am: move test-suite.log into test/
Pushing down the testing .gitignore entries in commit e25afaf6 exposed
test-suite.log in the root.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-10 14:30:05 +10:00
Jeremy Heiner f7f8964c23 Use the 'configure'd PYTHON to run pactest.
Use the 'configure'd PYTHON to run pactest instead of the one
hard-coded (with '#!') in pactest.py. Also remove useless '#!' from
non-main .py files.

Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-21 10:20:04 +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 8ab44c7986 Makefile.am: remove old targets from .PHONY
These targets were part of the old test suite and no longer exist.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14 13:01:15 +10:00
Andrew Gregory 3a6bb2735b Add make target for TESTS
This causes make to update TESTS when tests are added (or updated).
For simplicity, this changes TESTS from a single multi-line list to
individually appending each test file.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>

[Allan: use C locale for sorting]
Signed-off-by: Allan McRae <allan@archlinux.org>

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14 12:59:48 +10:00
Andrew Gregory d1ac6ffc13 Fix make distcheck
* set util binary paths relative to top_builddir
* set pactest.py path relative to top_srcdir
* include tap.py in check_SCRIPTS

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-19 10:42:15 +10:00
Andrew Gregory 403c175dbc integrate tests with 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 228221003d pactest: accept test names without a switch
This removes the --test switch, making it easier to call pactest from
a test harness.

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 296e630edd pmtest: set LC_ALL=C in subprocess.call
LC_ALL=C is required to force pacman's output to English for tests that
rely on that output, but setting it in Makefile.am results in those
tests breaking under different locales when pactest.py is run directly.
This will also ease an eventual transition to python3 which LC_ALL=C
causes to default to ascii encoded strings, creating problems for tests
with unicode strings.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-29 14:08:02 +10:00
Allan McRae d2ce93bc54 Quieten the build process some more
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-09 12:43:37 +10:00
Allan McRae 89ecf8cabe Make path to ldconfig configurable
The FHS (2.3) says having ldconfig in /sbin is optional and it is usually
located in /usr/sbin.  So /sbin/ldconfig should not be hard coded in
pacman.  Instead, provide a configure option --with-ldconfig that defaults
to the current path.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28 23:38:46 +10:00
Allan McRae 801f7d1033 pactest: handle non-default scriptlet shells
pacman can be configured to use a different shell than /bin/sh for
scriplets.  Pass the cnfigured value to the pactest suite and make the
necessary "copy" of the shell in the test root.

Also update all copyright years in the pactest suite.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28 23:38:34 +10:00
Allan McRae ad280e1b56 Revert execvp and related commits
This reverts commit 4a8c2852a8.
This reverts commit 993700bc6b.
This reverts commit bb4d2b72c1.
This reverts commit 60b192e383.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28 23:30:40 +10:00
Allan McRae 4a8c2852a8 pmtest: resolve path to scriptlet shell
In order to support a variety of values for the --with-scriptlet-shell
configure flag, pmtest has to be aware of what kind of path was passed,
be it an absolute path or a fragment for a path lookup. For absolute
paths, leave the path alone. For fragments, search the PATH environment
var for the resolved path to the binary. In both cases, join the
resultant path to the root directory defined for the test, not a
pre-determined bin directory.

Fixes FS#31552.

With-contribution-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17 22:32:54 +10:00
Allan McRae 27d9c25ee2 Split common utility functions for libalpm and pacman
There is duplicated code in the util.c files in the libalpm and pacman
source code. Split this into a separate file so that it can be shared
via a symlink. This prevents code divergence between the two code bases.

Also, move mbasename and mdirname from pacman/util.c into util-common.c
in preparation for the following patch that uses them to add an extension
to pacsave files.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04 21:49:37 +10: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
Dan McGee 1583a2079c Split check steps in Makefile into multiple targets
This allows a `make -j4 check` invocation to actually run in parallel,
even though 95% of our test suite time is currently dominated by
pactest. It also allows running something like `make test-vercmp`.

Also, add some targets to the .PHONY list that belong in it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-24 20:44:29 -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
Lukas Fleischer cd75ae46ab Makefile.am: Extract "contrib/" into DIST_SUBDIRS
This implies following changes:

* contrib scripts can be built and installed easily by running make(1)
  in "contrib/". This removes the need to pick all contrib scripts
  manually when packaging pacman-contrib.

* contrib scripts will no longer be built when running make(1) in the
  top level source directory. This seems like the most natural approach.
  We install those separately and should act the same when building
  stuff.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-23 14:49:40 -06:00
Dan McGee 2df519f807 Add a top-level 'update-po' make target
This makes the maintainer's life (read: my life) a lot easier when
updating translation files to push to Transifex.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 22:36:34 -05:00
Allan McRae e3676ae7b5 Run pacman test-suite with LC_ALL=C
Running the pacman test-suite in a non-English locale results in a few
failures.  Force the test-suite to run with LC_ALL=C.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 19:54:33 -05:00
Dan McGee d9f9b87d3f Add a test harness for new pacsort command
Note that this is meant to exercise pacsort more than the underlying
version comparsion; that is better left to the standalone vercmptest.sh
test script.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 16:55:01 -05:00
Dave Reisner 6633b8e5c2 move proto files to new subdirectory, proto/
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30 13:37:58 -05:00
Dan McGee a4a7006a13 po/: split into scripts/po/ and src/pacman/po/
This is the first step at separating the pacman message catalog and the
scripts message catalog. Makefiles, configure.ac, and other such files
are adjusted accordingly, as well as renaming files. The TEXTDOMAIN of
scripts is also adjusted.

Note that no actual pot or po files get changed here; these will get
pruned in a future commit so each catalog contains only the necessary
messages.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-23 22:50:01 -05:00
Dan McGee d360153bc6 pactest: run with root in /tmp and clean up automatically
This moves the generated root/ directory into /tmp, or at least a path
returned by tempfile.mkdtemp(), by default. This can make test runs
significantly faster if done when /tmp is a tmpfs.

If you are debugging a failed test, use the new --keep-root option to
not clean up and pactest will print the location of the generated root/
test directory.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-05 11:12:26 -05:00
Dan McGee f489e969f0 Update build system (automake, autoconf, libtool)
Unfortunately this patch is hard to split up into smaller chunks. Our build
system and the associated automake/autoconf/libtool macros has been left
untouched for a while, and could use a refresher.

* Upgrade ltmain.sh to the latest version
* Move away from a huge acinclude.m4 directory to using individual files in
  the m4/ subdirectory, suggested by upstream automake documentation
* Update all macros to their latest available version
* Adjust Makefile.am and autogen.sh to accommodate m4/ subdirectory

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-23 09:10:53 -05:00
Dan McGee 2ee186506c Add test/util directory as necessary to build files
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-16 21:00:44 -05:00
Dan McGee 0ac96d94ec Move vercmp tests into util/ testing directory
Now that not everything is in 'pactest/', we can separate out the parts a
bit more and leave the pacman/ directory to be just pactest.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-02 13:24:22 -05:00
Allan McRae 844d82fad8 Move pacman test suite
Move the test suite to test/pacman in order to make a logical
location for a future makepkg test suite.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-02 13:14:51 -05:00
Allan McRae 219cb2eaac makepkg: Add PKGBUILD-split.proto
Prototype PKGBUILD for package splitting in makepkg

Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16 22:16:18 +10:00
Dan McGee d7e502a467 Attempt to idiot-proof making and refreshing docs
I mess this up more often than not, and maybe this will do the trick. Remove
the --enable-asciidoc option as it has been superseded by the --disable-doc
option in usefulness. If you want to skip building docs, you skip building
all docs which is much easier when it comes to ensuring the make 'dist' and
'distcheck' targets will always build the manpages and always build the most
up to date manpages.

Developers shouldn't be affected in their normal builds, nor should end
users of the source tarball.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-12 21:29:33 -05:00
Dan McGee 2cd0a87b3f Add simple vercmp test script
Commit 8428367285 updated the versioncmp code
in libalpm. Unfortunately for us, it also introduced the regression that
becomes apparant with the following upgrade:

warning: sonata: local (1.5-2) is newer than extra (1.5.1-2)

Add a vercmptest.sh test script that is run during the make check phase
which now points out three regressions in the version comparison function
that will need fixing. All current tests in this script pass with the old
versioncmp code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 17:25:37 -05:00
Chantry Xavier 7069b96173 Add new ChangeLog.proto file.
Fixes FS#7231.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-05 18:01:02 -06:00
Dan McGee d53388fb90 install: install prototype PKGBUILD and install to datadir
Move the prototypes out of contrib/ and into the top level directory, and
install them to what is usually /usr/share/pacman/ on a package install.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-06 10:23:49 -06:00
Dan McGee 26c05b1c8c Ensure that manpages are always distributed and installed
Commit 012f793978 was a bit misguided in its
thinking, and resulted in a package built without asciidoc enabled not
installing the manpages to the system on a 'make install' operation. Fix
this behavior by making manpages required in a normal build, and in order to
disable their existence, the '--disable-doc' option must be used.

Hopefully this solves manpage issues for both developers and package
builders while allowing as much flexibility as possible.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-28 20:06:58 -06:00
Dan McGee ac79135b94 Pick best python program available for 'make check'
Use an autoconf macro to find us a python executable, preferring python2.5
if we can find it. From there, fall back to python2.4 and then python.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-30 00:20:18 -05:00
Dan McGee 64e45a36f8 Create the pacman DB and cachedir directories upon install
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-10 14:58:45 -04:00