Commit graph

6965 commits

Author SHA1 Message Date
Eli Schwartz
10bcf66db8 update a bunch of links for https and to adapt to changing domains
projects.archlinux.org and mailman.archlinux.org are both migrated to
new domains.

Transifex supports https, so encourage its use by default.

Take advantage of the opportunity when updating these links, to also
delist some projects that are dead.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-14 13:35:47 +10:00
Eli Schwartz
02598521b1 doc: add a couple missing manpages from the html index
The index embeds the names of all doc subpages, and these were never
updated.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-14 13:19:05 +10:00
Eli Schwartz
a769fbfd40 doc: keep manpages and html pages in sync
We forgot to add BUILDINFO to the list of html docs. Instead of always
updating things in two places, just derive the one from the other.

meson did not have this problem as it already derives both lists from
one template.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-14 13:15:11 +10:00
Eli Schwartz
b76dbb1159 meson: fix regression that broke building libmakepkg
In commit f7efa6a93d we added a new file,
and also wired it up to the build systems, but it got added under the
wrong name in meson.build

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-14 13:12:33 +10:00
Eli Schwartz
ce040514c4 makepkg: return E_PKGBUILD_ERROR for nonexistent PKGBUILD
This is not really an error with a "user function".

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 17:07:23 +10:00
Eli Schwartz
5d2f7ee6c3 libmakepkg: simplify splitting command output into array
Use mapfile instead of hacking around read -a with the $IFS.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 17:03:04 +10:00
Eli Schwartz
031611ff40 libmakepkg: add routine for linting $SOURCE_DATE_EPOCH
This can only ever be an int, and the specification states that a
malformed timestamp should be considered a fatal error.

https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 17:01:30 +10:00
Eli Schwartz
10fe71e5f3 makepkg: fix unguarded use of printf
paths can contain printf-unsafe chars, and printf -v is not somehow immune to this

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 17:00:05 +10:00
Luke Shumaker
aa284c97f1 makepkg: check_pkgrel: Don't say "decimal" in the error message
If you have a malformed pkgrel, the error message says that it must be a
"decimal".  That isn't quite true, as that would mean that `1.1 == 1.10`.

Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 17:00:05 +10:00
Luke Shumaker
f7efa6a93d makepkg: Better error messages for versions in (check, make, opt)depends/provides/conflicts
Given the depends

    depends=('foo>=1.2-1.par2')

and the error message

    ==> ERROR: pkgver in depends is not allowed to contain colons, forward slashes, hyphens or whitespace.

One would be lead to believe that the problem is that they gave a pkgrel in
depends at all, not that the pkgrel contains letters.

Each of the (check,make,opt)depends, conflicts, and provides linters use a
glob to trim off properly formed epoch an rel from the full version string,
and pass the remainder to check_pkgver().  This does a good job of
accepting/rejecting full versions, but doesn't do a good job of generating
good error messages when rejecting if it's because of the epoch or rel.

1. Factor out check_epoch() and check_pkgrel() from lint_epoch() and
   lint_pkgrel(), similarly to check_pkgver().
2. Add a check_fullpkgver() that takes a full [epoch:]ver[-rel] string and
   splits it in to epoch/ver/rel, and calls the appropriate check_ function
   on each.
3. Use check_fullpkgver() in the {,check,make,opt}depends, conflicts, and
   provides linters.

Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 17:00:03 +10:00
Eli Schwartz
30e3e21e87 libmakepkg/lint_pkgbuild: check for invalid variables even if they're empty
Checking the length of the variable to be non-zero before considering it
an error is inconsistent; license=() and depends='' and `declare arch`
should be considered just as wrong.

In fact the current check detects depends='' as non-zero and returns an
error, but happily considers the others to be perfectly okay.

A more reliable check is to simply see if the name has been declared
(whether it is set or not), and then enforce that it's been declared to
the right type.

As an added benefit, avoiding the creation of proxy-evaled variables to
count the number of indexes results in simpler code.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 15:21:13 +10:00
Allan McRae
03d85763e0 Add [ignored] to -Qu output for packages in repos that are not Usage = Upgrade
List all available updates in -Qu output, but include [ignored] beside
those that will not be updated in a -Su operation due to thier repo Usage
value (in addition to those that are Ignored).

Fixes FS#59854.

The following people provided initial patches to print [ignored] on -Qu
operations, which highlighted a larger problem to be fixed first:

With-thanks-to: morganamilo <morganamilo@gmail.com>
With-thanks-to: Michael Straube <michael.straube@posteo.de>

Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 14:14:04 +10:00
Allan McRae
e9d91a688d libalpm/sync.c: change alpm_sync_newversion() to alpm_sync_get_new_version()
The behaviour of "pacman -Qu" was very strange...  It would only consider
packages from repos with Usage = Search (or All), and ignore those with
Usage = Sync, Install or Upgrade.

This is because the function alpm_sync_newversion() used ALPM_DB_USAGE_SEARCH
for its filtering. Given this function is documented (at least in the source)
to "Check for new version of pkg in sync repos", I would expect that to look at
all repos. However, just changing this parameter, would result in a fairly
silent change in behaviour of this function. Instead, rename the function
and remove this filtering altogether.  Users of this function can filter
the dbs passed to this function to achieve their desired output.

Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 14:14:04 +10:00
Allan McRae
9b2a90cfb1 Add -fstack-clash-protection to CFLAGS in debug builds if available
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 14:14:04 +10:00
Allan McRae
9b637cc27a be_local.c: remove aligment in local_pkg_ops
The alignment was not overly helpful and caused unnecessary churn when a new
value with longer name was added.

Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 14:10:55 +10:00
morganamilo
f9eb2aacb4 libalpm: parse {check, make}depends when reading database
Commit 0994893b0e added the
alpm_pkg_get_{make,check}depends functions but forgot to include
logic for parsing these fields from the database. As a result these
functions will always return an empty list.

This commit adds the parsing logic.

Signed-off-by: morganamilo <morganamilo@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 14:04:59 +10:00
Eli Schwartz
238fa4af45 makepkg: fix broken check for the fakeroot binary
In commit d8ee8d0c99 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-10 13:25:12 +10:00
Eli Schwartz
268b0255fa makepkg: add internal variable to track when we're building a package
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-10 13:25:12 +10:00
Jan Alexander Steffens (heftig)
c5c7fc7f4a makepkg: Make pkgdir a local
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-04 15:43:41 +10:00
Jan Alexander Steffens (heftig)
2f15921230 makepkg: Create a single-package packaging function
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-04 15:43:41 +10:00
Jan Alexander Steffens (heftig)
7c5958e0eb makepkg: Only backup package variables once
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-04 15:43:41 +10:00
Michael Straube
e1fc2f901e libalpm/add.c: move assignment into conditional in alpm_add_pkg
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-04 11:32:49 +10:00
Michael Straube
3a5a0d53bc Move skipping of duplicate sync/remove targets into libalpm
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-04 11:31:55 +10:00
Eli Schwartz
984492b92f repo-add: don't break if delta package sources contain epoch
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-04 11:15:16 +10:00
Eli Schwartz
4778f13188 repo-remove: fix removing packages with deltas
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 cb0f2bd038 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-04 11:14:52 +10:00
Andrew Gregory
2d403709d9 allow tests for disabled features to be skipped
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-04 11:10:47 +10:00
Andrew Gregory
ecac357c1a tap.py: add skip_all function
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04 11:10:37 +10:00
Andrew Gregory
d150b97190 remove unused test summary code
Unused since 12e00af531

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04 11:09:48 +10:00
Andrew Gregory
33a8ced334 silence warning when built without curl
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04 11:08:54 +10:00
Andrew Gregory
6b541404cc update NEWS for v5.1.2
Signed-off-by: Andrew Gregory <andrew@archlinux.org>
(cherry picked from commit f8c73464c9)
2018-12-25 01:58:33 -08:00
Andrew Gregory
281cdb2e1c update NEWS for v5.0.2
Signed-off-by: Andrew Gregory <andrew@archlinux.org>
(cherry picked from commit fdf53393bc)
2018-12-25 01:57:01 -08:00
Eli Schwartz
b109d7096b meson: add trailing slashes to directory components in configuration defines
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-12 10:13:26 +10:00
Eli Schwartz
77b8ca7032 meson: install the directories needed for successful pacman operation
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-12 10:13:08 +10:00
Eli Schwartz
d73fed4e13 meson: remove useless mkdir -p
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-12 10:12:41 +10:00
Dave Reisner
b67ec90520 Enable additional debug flags/logging with debugoptimized builds
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-10 11:20:02 +10:00
Michael Straube
36a5069a59 scripts/library: fix typo in README
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-10 11:12:27 +10:00
Andrew Gregory
f28ddd9d93 check localdb before upgrading package
Commit 2ee7a8d89a 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-10 11:12:06 +10:00
Eli Schwartz
9f1b735d76 libmakepkg/executable: don't rely on scoped value of $ret to flag outcomes
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-04 17:22:27 +10:00
Eli Schwartz
65e09705d3 Make make distcheck work when bash-completion is installed.
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-04 17:20:57 +10:00
Allan McRae
f615f7bd5a configure.ac: use $datarootdir instead of $prefix/share
Even worse, makepkg-template ignored $prefix completely.
2018-12-03 15:18:27 +10:00
Eli Schwartz
5fc3056e6a scripts: make repo-add utilize a wrapper as well
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-28 11:06:12 +10:00
Eli Schwartz
e1b9dc6bea autotools: be more accurate in comments when generating processed scripts
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-28 11:02:19 +10:00
Eli Schwartz
71f837e45e scripts: fix some inaccurate Makefile targets, and be more templated
All of our scripts depend on the same pattern .sh.in, and since commit
b5d62d2c91, 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-28 11:02:19 +10:00
Eli Schwartz
83a16d3041 scripts: fix repo-remove/elephant Makefile targets
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-28 10:50:02 +10:00
Eli Schwartz
363664e47d meson: be more accurate in comments when generating processed scripts
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-28 10:48:57 +10:00
Eli Schwartz
fbc6d8b428 build-aux: rm annoying and useless file
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 403c175dbc
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-28 10:48:41 +10:00
Andrew Gregory
6e819c819a add missing tests to meson.build
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28 10:24:28 +10:00
Andrew Gregory
b95ba13df1 common/ini: remove unnecessary alpm include
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28 10:24:00 +10:00
Andrew Gregory
44cfc09511 require actual siglevel for default
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-27 22:48:43 +10:00
Andrew Gregory
61fe738043 always allow explicit empty siglevel for sync dbs
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-27 22:48:43 +10:00