Compare commits

..

46 Commits

Author SHA1 Message Date
morganamilo
47ee7e9442 Rework scriptlet printing and callbacks
This adds more info to the scriptlet callbacks and adds callbacks for
when and install file is about to run/finished running.

Indent and colour the scriptlet output so the user can see it clearly.
2023-12-04 18:38:32 +00:00
Levente Polyak
18e49f2c97 debugflags: ensure to only append debug flags once when building
During a package build we call prepare_buildenv in multiple stages of
the process. For debug packages, one of the hooks is buildenv_debugflags
which populates the debug flags to the according variables.

The issue is that the behavior of the current implementation of
buildenv_debugflags is not idempotent, so consecutive calls will append
the same flags again. In certain cases this isn't an issue, however
for context aware build frontends like cargo any change of the build
inputs leads to a fresh build. This means that any invocation of such
a build ecosystem inside the package() function will trigger a full
rebuild, which is not desired.

To fix this issue, this commit makes buildenv_debugflags idempotent
by only appending flags once to the target variables.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-11-17 18:56:44 +01:00
Patrick Northon
0108e2c64e Omit trailing .git from url when comparing git remote urls. 2023-11-04 10:09:59 +10:00
Diego Viola
94d9c2affe doc/PKGBUILD: fix typo
Signed-off-by: Diego Viola <diego.viola@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-11-04 00:03:23 +00:00
morganamilo
6e9ab43451 Document MAKEPKG_LIBRARY in makepkg(8) 2023-11-04 00:02:17 +00:00
morganamilo
9af4033cad Rename LIBRARY to MAKEPKG_LIBRARY
Implements #59.
2023-11-04 00:02:17 +00:00
Vekhir
31ffbc94ca Delete entire $srcdir upon clean build
Currently, the file glob used to clean the $srcdir misses dotfiles.

This commit instead removes the directory entirely and recreates it.
Since the directory has to exist prior to deletion, the creation commands
are duplicated. Perhaps they could be moved to a function later on.

The directory cannot be removed while inside it, so the directory change
is moved down the line. One important insight here is that almost all functions
after it are actually independent of $pwd, allowing the optimization of just
not changing directory. They do however depend on the existence of $srcdir, so
it has to be recreated.
The only exception to this is `extract_sources` which depends on $pwd being $srcdir.

An alternative proposal wanted to extend the file matching for deletion, but it
was deemed impractical.
2023-11-04 00:01:22 +00:00
Jack Rosenthal
e9b385a636 alpm: Don't chroot() to "/"
chroot() requires CAP_SYS_CHROOT.  If the caller has put us in the
right root directory already, don't call chroot().  This allows
running pacman in a containerized environment without CAP_SYS_CHROOT.
2023-10-23 12:13:10 +00:00
morganamilo
917b67f5d1 Fix -D in package()
When entering fakeroot makepkg calls itself with it's original args
causing it to cd again and error
2023-10-20 22:40:44 +01:00
Morten Linderud
331b277eea makepkg: Implement the verify function
This patch implements a new verify function in makepkg. It allows us to
do arbitrary authentication on sources before extraction.

There are several new signing and validation methods being implemented
and it would be hard to have `makepkg` implement support for things such
as sequoia, cosign or minisign. This would allow us to distribute
generic validation functions.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2023-10-02 05:12:12 +00:00
Felix Yan
30f9a2e263 Correct typos in zsh_completion.in 2023-10-02 04:34:24 +00:00
morganamilo
aff12189d8 libalpm: check filecache_find return and log errors
Some user had erros while updating their system.

:: Proceed with installation? [Y/n]
:: Retrieving packages...
checking keyring...
checking package integrity...
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

The issue was filecache_find returning null and alpm passing that null
path to check validity. How this happened I have no idea. It may be
something to do with the user's cachedir being a network drive.

Also warn when the file exists but it is not a regular file or can not
be opened.
2023-09-30 13:28:31 +00:00
Allan McRae
332d2a1922 repo-add: clarify exit messages
Clarify if repo-add does not create a new database due to failures
or due to there being nothing to do.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-30 23:27:04 +10:00
Ivan Shapovalov
f91fa546f6 repo-add: do not recreate the database if nothing was changed
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-30 23:18:41 +10:00
morganamilo
b4f11d5496 alpm: test access of symlinks not where they point
On platforms that have AT_SYMLINK_NOFOLLOW

Fixes FS#69720
2023-09-26 03:37:49 +00:00
morganamilo
015cdb21bd Fix unused variable warning 2023-09-20 04:32:21 +01:00
Xiretza
05f283b5ad tests: fix order of fakechroot + fakeroot nesting
As noted in the fakechroot(1) man page, fakeroot and fakechroot
might wrap the same C library functions. Arch Linux hit this
recently with calls to stat(). It is important to start the fake
environment in proper order - fakeroot should be started inside
fakechroot.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-19 17:55:24 +10:00
Finlay Maroney
34611a6643 Avoid double slash when explicitly passing --root or --rootdir
Passing a path with a trailing slash to --root or --rootdir can lead to a
double slash at the start of paths.  e.g.

$ pacman --root / -v 2>1  | grep " //"
Log File  : //var/log/pacman.log

In MSYS2, paths starting with // will hit the network and fail.

Avoid this be explicitly stripping the trailing / from paths passed to these
flags.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-12 14:22:36 +10:00
Robin Candau
76b140c72a Replace the bzr package by breezy for the bzr protocol in makepkg.conf 2023-09-11 19:11:40 +02:00
Matthew Sexton
5f43ac85f6 specify which files are updated by --refresh option
Ref: FS#77697

Signed-off-by: Matthew Sexton <mssxtn@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-11 22:59:53 +10:00
morganamilo
0dfe5c96ae makepkg: add -D flag to change directory before building
This is similar to -C in git/make/nina. Sadly -C is already taken for
us.

This is useful for scripts where you for loop over packages, as well as
when I'm testing makepkg builds and I'm too lazy to cd.
2023-09-09 11:52:11 +10:00
InsanePrawn
36d70a93e2 pacman-key: allow overriding KEYRING_IMPORT_DIR with --populate-from
Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-07 00:12:41 +10:00
Allan McRae
717e5e9157 Add PRINT_FORMAT_LIST define to remove repetitive code
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 17:56:55 +10:00
Allan McRae
e7d7433b4b Rename macro for print-format handling of strings
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 17:56:55 +10:00
Jelle van der Waa
e210634982 util.c: extend --print-format with "%m"
Add md5sum as printable format string.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 17:56:55 +10:00
Jelle van der Waa
6968f77026 util.c: extend --print-format with "%G"
Add a new print attribute "%G" which prints groups.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 17:56:55 +10:00
Jelle van der Waa
06db927a1a util.c: extend --print-format with "%H"
Add a new print attribute "%H" which shows conflicts.

Signed-off-by: Jelle van der Waa <jelle@archlinux.org>
2023-09-06 17:56:55 +10:00
Jelle van der Waa
909f2e86c3 util.c: add "%O" to --print-format
Add the option to print optional depends with "%O".

Signed-off-by: Jelle van der Waa <jelle@archlinux.org>
2023-09-06 17:56:55 +10:00
Jelle van der Waa
5bd0b98b42 util.c: extend --print-format with %R and %P
Add provides "%P" and replaces "%R" as format attribute.

Signed-off-by: Jelle van der Waa <jelle@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 17:56:55 +10:00
Jelle van der Waa
c1d4a6198c Extend --print-format with %L
Add format attribute for licenses.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 17:56:55 +10:00
Allan McRae
f5af66f130 Remove unnecessary check
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 17:56:55 +10:00
Allan McRae
5473c9fd3f squash
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 17:56:55 +10:00
Allan McRae
e58d799c47 Generalise concat_alpm_depends for any list
Replace concat_alpm_depends() with concat_list() which takes an
additional parameter to handle the formatting of non-string
data types.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 14:39:00 +10:00
Matthias Kurz
366b527757 libmakepkg: make sure git cloned repo's remote is named origin
makepkg assumes that the remote git repo is named "origin" at several
places in its handling of git sources. It is possible to set the remote
repo name since git v2.30.0 (with bug fix for bare checkouts in v2.30.2).

Add "--origin=origin" to all git clone commands.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-09-06 13:51:32 +10:00
morganamilo
e83e53f3f9 makepkg: lint empty arrays
While depend arrays are already linted, many array kinds are still
not. An empty string is never a valid array value so check all
arrays for it.
2023-09-06 12:14:55 +10:00
morganamilo
2348dcab22 pacman+libalpm: print version names for conflicting packages
When ever pacman prints a conflict, it now prints pkgname-version,
instead of just pkgname.

alpm_conflict_t now carries *alpm_pkg_ts instead of just the
names of each package.

Fixes FS#12536 (point 2)
2023-09-05 01:57:01 +00:00
morganamilo
f9d8beef45 Add meson log to artifacts 2023-09-04 22:00:51 +02:00
morganamilo
85ab0307d7 Fix compile on some platforms
Controlling the type of getmntinfo's param was decided by
whether or not we had the statvfs type avaliable. But getmntinfo uses
statfs regardless of this except on netbsd where it uses statvfs.

Add a check to detect which type our version of the function uses.
2023-09-04 22:00:48 +02:00
Nicolas Rolans
ffde12cebd repo-add: fix exit on mktemp failure 2023-08-28 12:43:56 +00:00
Jouke Witteveen
37dae721d3 Replace md5sums with sha256sums in documentation
As noted in !24, md5sums are outdated.
2023-08-28 12:27:28 +00:00
Ben Westover
aa3a1bc3b5 proto: Change the default checksum from md5 to sha256
MD5 isn't a very good checksum, and the PKGBUILD page on the Arch Wiki
states that it should not be used, instead recommending sha256 or b2.
This patch changes the default from md5 to sha256 because that seems to
be the most commonly used checksum today.

Signed-off-by: Ben Westover <kwestover.kw@gmail.com>
2023-08-28 22:25:10 +10:00
Allan McRae
298755c905 pacman: do not check file md5sums
The file md5sums are removed from the .MTREE file, so pacman should
not attempt to check them.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-08-28 22:17:51 +10:00
Levente Polyak
ee933acf84 makepkg: immutable bzr by hashing the checkout content
This feature makes bzr VCS build inputs immutable by adding support for
pinning a bzr checkout by a hash of its content using the deterministic
export functionality `bzr export`.

This feature allows to preserve security implications of immutable build inputs
using a trusted cryptographic hash function of the content.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-08-28 22:15:03 +10:00
Levente Polyak
ca3c873d48 makepkg: immutable mercurial sources by hashing the checkout content
This feature makes Mercurial VCS build inputs immutable by adding
support for pinning a Mercurial checkout by a hash of its content using
the deterministic export functionality `hg archive`.

This feature aids packagers by allowing them to use simple and
convenient refnames (instead of full commit hashes) in the `PKGBUILD`
while still preserving security implications of immutable build inputs
using a trusted cryptographic hash function of the content.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-08-28 22:15:03 +10:00
Levente Polyak
2fc2ab6cf0 makepkg: immutable git sources by hashing the checkout content
This feature makes Git VCS build inputs immutable by adding support for
pinning a Git checkout by a hash of its content using the deterministic
export functionality `git archive`.

This feature aids packagers by allowing them to use simple and
convenient refnames (instead of full commit hashes) in the `PKGBUILD`
while still preserving security implications of immutable build inputs
using a trusted cryptographic hash function of the content.

Previously VCS source downloads have been skipped for `--geninteg` and
`--source` as both options did not need a checkout. This commit changes
this behavior by forcing the download of all sources as integrity checks
and generation requires to have an up to date state.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-08-28 22:15:03 +10:00
kpcyrd
843bf21e79 libmakepkg: Fix non-reproducible binaries by processing debuginfo in order 2023-08-27 13:03:40 +02:00
127 changed files with 866 additions and 824 deletions

View File

@@ -16,6 +16,10 @@ default:
python
fakeroot fakechroot
meson
artifacts:
when: always
paths:
- build/meson-logs/meson-log.txt
arch:
extends: .arch-test

View File

@@ -3,4 +3,4 @@
# This script serves as a trampoline for running scripts which depend on
# libmakepkg with the libmakepkg within the build tree.
LIBRARY=@BUILDDIR@/libmakepkg exec @BASH@ -$- @REAL_PROGPATH@ "$@"
MAKEPKG_LIBRARY=@BUILDDIR@/libmakepkg exec @BASH@ -$- @REAL_PROGPATH@ "$@"

View File

@@ -12,8 +12,8 @@ depends=('glibc')
makedepends=('ed')
optdepends=('ed: for "patch -e" functionality')
source=("ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig})
md5sums=('e9ae5393426d3ad783a300a338c09b72'
'SKIP')
sha256sums=('9124ba46db0abd873d0995c2ca880e81252676bb6c03e0a37dfc5f608a9b0ceb'
'SKIP')
build() {
cd "$srcdir/$pkgname-$pkgver"

View File

@@ -336,6 +336,13 @@ function.
the optional functions listed below. The packaging stage is run using
fakeroot to ensure correct file permissions in the resulting package.
All other functions will be run as the user calling makepkg.
This function is run inside `$srcdir`.
*verify() Function*::
An optional `verify()` function can be specified to implement arbitrary
source authentication. The function should return a non-zero exit code when
verification fails. This function is run before sources are extracted.
This function is run inside `$startdir`.
*prepare() Function*::
An optional `prepare()` function can be specified in which operations to
@@ -343,16 +350,19 @@ function.
function is run after the source extraction and before the `build()`
function. The `prepare()` function is skipped when source extraction
is skipped.
This function is run inside `$srcdir`.
*build() Function*::
The optional `build()` function is used to compile and/or adjust the source
files in preparation to be installed by the `package()` function.
This function is run inside `$srcdir`.
*check() Function*::
An optional `check()` function can be specified in which a package's
test-suite may be run. This function is run between the `build()` and
`package()` functions. Be sure any exotic commands used are covered by the
`checkdepends` array.
This function is run inside `$srcdir`.
All of the above variables such as `$pkgname` and `$pkgver` are available for
use in the packaging functions. In addition, makepkg defines the following
@@ -362,7 +372,6 @@ variables:
This contains the directory where makepkg extracts, or copies, all source
files.
+
All of the packaging functions defined above are run starting inside `$srcdir`
*pkgdir*::
This contains the directory where makepkg bundles the installed package.
@@ -464,6 +473,9 @@ Currently makepkg supports the Bazaar, Git, Subversion, Fossil and Mercurial
version control systems. For other version control systems, manual cloning of
upstream repositories must be done in the `prepare()` function.
Some <<VCS,VCS Sources>> like Git support pinning the checkout by a checksum of
its content using deterministic export functionality like ``git archive''.
The source URL is divided into four components:
*directory*::

View File

@@ -85,7 +85,7 @@ Example PKGBUILD
license=('PerlArtistic' 'GPL')
depends=('perl')
source=("http://search.cpan.org/CPAN/authors/id/S/SH/SHERZODR/Config-Simple-${pkgver}.tar.gz")
md5sums=('f014aec54f0a1e2e880d317180fce502')
sha256sums=('dd9995706f0f9384a15ccffe116c3b6e22f42ba2e58d8f24ed03c4a0e386edb4')
_distname="Config-Simple"
# template start; name=perl-module; version=1.0;

View File

@@ -146,6 +146,9 @@ Options
*-C, \--cleanbuild*::
Remove the $srcdir before building the package.
*-D* <dir>, *\--dir* <dir> ::
Change to directory <dir> before reading the PKGBUILD or doing anything else.
*\--allsource*::
Do not actually build the package, but build a source-only tarball that
includes all sources, including those that are normally downloaded via
@@ -168,6 +171,9 @@ Options
*\--noprepare*::
Do not run the prepare() function in the PKGBUILD.
*\--noverify*::
Do not run the verify() function in the PKGBUILD.
*\--sign*::
Sign the resulting package with gpg, overriding the setting in
linkman:makepkg.conf[5].
@@ -227,6 +233,9 @@ before building.
Environment Variables
---------------------
**MAKEPKG_LIBRARY**="/path/to/directory"::
Use an alternative libmakepkg path instead of the {libmakepkgdir} default.
**PACMAN**::
The command that will be used to check for missing dependencies and to
install and remove packages. Pacman's '-Qq', '-Rns', '-S', '-T', and '-U'

View File

@@ -35,6 +35,7 @@ asciidoc_opts = [
'-a', 'sysconfdir=@0@'.format(SYSCONFDIR),
'-a', 'datarootdir=@0@'.format(DATAROOTDIR),
'-a', 'rootdir=@0@'.format(ROOTDIR),
'-a', 'libmakepkgdir=@0@'.format(LIBMAKEPKGDIR),
]
html_targets = []

View File

@@ -237,10 +237,12 @@ Transaction Options (apply to '-S', '-R' and '-U')
Specify a printf-like format to control the output of the '\--print'
operation. The possible attributes are: "%a" for arch, "%b" for
builddate, "%d" for description, "%e" for pkgbase, "%f" for filename,
"%g" for base64 encoded PGP signature, "%h" for sha256sum, "%n" for
pkgname, "%p" for packager, "%v" for pkgver, "%l" for location, "%r"
for repository, "%s" for size, "%C" for checkdepends, "%D" for depends
and "%M" for makedepends.
"%g" for base64 encoded PGP signature, "%h" for sha256sum, "%m" for
md5sum, "%n" for pkgname, "%p" for packager, "%v" for pkgver, "%l" for
location, "%r" for repository, "%s" for size, "%C" for checkdepends,
"%D" for depends, "%G" for groups, "%H" for conflicts, "%L" for
licenses, "%M" for makedepends, "%O" for optional depends, "%P" for
provides and "%R" for replaces.
Implies '\--print'.
@@ -454,11 +456,11 @@ Additional targets can also be specified manually, so that '-Su foo' will do a
system upgrade and install/upgrade the "foo" package in the same operation.
*-y, \--refresh*::
Download a fresh copy of the master package database from the server(s)
defined in linkman:pacman.conf[5]. This should typically be used each time
you use '\--sysupgrade' or '-u'. Passing two '\--refresh' or '-y' flags
will force a refresh of all package databases, even if they appear to be
up-to-date.
Download a fresh copy of the master package databases '(repo.db)' from the
server(s) defined in linkman:pacman.conf[5]. This should typically be used
each time you use '\--sysupgrade' or '-u'. Passing two '\--refresh' or '-y'
flags will force a refresh of all package databases, even if they appear to
be up-to-date.
Database Options (apply to '-D')[[QO]]
@@ -487,8 +489,8 @@ Database Options (apply to '-D')[[QO]]
File Options (apply to '-F')[[FO]]
----------------------------------
*-y, --refresh*::
Download fresh package databases from the server. Use twice to force a
refresh even if databases are up to date.
Download fresh package file databases '(repo.files)' from the server.
Use twice to force a refresh even if databases are up to date.
*-l, \--list*::
List the files owned by the queried package.

View File

@@ -23,7 +23,7 @@ DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
#-- The package required by makepkg to download VCS sources
# Format: 'protocol::package'
VCSCLIENTS=('bzr::bzr'
VCSCLIENTS=('bzr::breezy'
'fossil::fossil'
'git::git'
'hg::mercurial'

View File

@@ -415,7 +415,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
size_t pkg_current, size_t pkg_count)
{
int i, ret = 0, errors = 0;
int ret = 0, errors = 0;
int is_upgrade = 0;
alpm_pkg_t *oldpkg = NULL;
alpm_db_t *db = handle->db_local;
@@ -469,7 +469,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
!(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
const char *scriptlet_name = is_upgrade ? "pre_upgrade" : "pre_install";
_alpm_runscriptlet(handle, pkgfile, scriptlet_name,
_alpm_runscriptlet(handle, newpkg->name, pkgfile, scriptlet_name,
newpkg->version, oldpkg ? oldpkg->version : NULL, 1);
}
@@ -538,7 +538,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
/* call PROGRESS once with 0 percent, as we sort-of skip that here */
PROGRESS(handle, progress, newpkg->name, 0, pkg_count, pkg_current);
for(i = 0; archive_read_next_header(archive, &entry) == ARCHIVE_OK; i++) {
while(archive_read_next_header(archive, &entry) == ARCHIVE_OK) {
int percent;
if(newpkg->size != 0) {
@@ -641,7 +641,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
char *scriptlet = _alpm_local_db_pkgpath(db, newpkg, "install");
const char *scriptlet_name = is_upgrade ? "post_upgrade" : "post_install";
_alpm_runscriptlet(handle, scriptlet, scriptlet_name,
_alpm_runscriptlet(handle, newpkg->name, scriptlet, scriptlet_name,
newpkg->version, oldpkg ? oldpkg->version : NULL, 0);
free(scriptlet);
}

View File

@@ -600,16 +600,10 @@ typedef struct _alpm_depmissing_t {
/** A conflict that has occurred between two packages. */
typedef struct _alpm_conflict_t {
/** Hash of the first package name
* (used internally to speed up conflict checks) */
unsigned long package1_hash;
/** Hash of the second package name
* (used internally to speed up conflict checks) */
unsigned long package2_hash;
/** Name of the first package */
char *package1;
/** Name of the second package */
char *package2;
/** The first package */
alpm_pkg_t *package1;
/** The second package */
alpm_pkg_t *package2;
/** The conflict */
alpm_depend_t *reason;
} alpm_conflict_t;
@@ -756,6 +750,10 @@ typedef enum _alpm_event_type_t {
ALPM_EVENT_LOAD_START,
/** Target package is finished loading. */
ALPM_EVENT_LOAD_DONE,
/** An install file is about to be ran */
ALPM_EVENT_INSTALL_RUN_START,
/** An install file has finished running */
ALPM_EVENT_INSTALL_RUN_DONE,
/** Scriptlet has printed information; See alpm_event_scriptlet_info_t for
* arguments. */
ALPM_EVENT_SCRIPTLET_INFO,
@@ -846,10 +844,32 @@ typedef struct _alpm_event_optdep_removal_t {
alpm_depend_t *optdep;
} alpm_event_optdep_removal_t;
/** Enum of the kinds of scriptlets */
typedef enum _alpm_scriptlet_kind_t {
/** We are running an install file */
ALPM_SCRIPTLET_KIND_INSTALL_FILE,
/** We are running a hook */
ALPM_SCRIPTLET_KIND_HOOK,
/** We are running a command */
ALPM_SCRIPTLET_KIND_COMMAND,
} alpm_scriptlet_kind_t;
/** We are running an install file. */
typedef struct _alpm_event_install_run_t {
/** Type of event */
alpm_event_type_t type;
/** The name of the package */
const char *pkgname;
} alpm_event_install_run_t;
/** A scriptlet was ran. */
typedef struct _alpm_event_scriptlet_info_t {
/** Type of event */
alpm_event_type_t type;
/** The kind of scriptlet being ran */
alpm_scriptlet_kind_t kind;
/** The name of the scriptlet **/
const char *name;
/** Line of scriptlet output */
const char *line;
} alpm_event_scriptlet_info_t;
@@ -952,6 +972,8 @@ typedef union _alpm_event_t {
alpm_event_package_operation_t package_operation;
/** An optdept was remove */
alpm_event_optdep_removal_t optdep_removal;
/** An install file is about to be run */
alpm_event_install_run_t install_run;
/** A scriptlet was ran */
alpm_event_scriptlet_info_t scriptlet_info;
/** A database is missing */

View File

@@ -50,10 +50,8 @@ static alpm_conflict_t *conflict_new(alpm_pkg_t *pkg1, alpm_pkg_t *pkg2,
CALLOC(conflict, 1, sizeof(alpm_conflict_t), return NULL);
conflict->package1_hash = pkg1->name_hash;
conflict->package2_hash = pkg2->name_hash;
STRDUP(conflict->package1, pkg1->name, goto error);
STRDUP(conflict->package2, pkg2->name, goto error);
ASSERT(_alpm_pkg_dup(pkg1, &conflict->package1) == 0, goto error);
ASSERT(_alpm_pkg_dup(pkg2, &conflict->package2) == 0, goto error);
conflict->reason = reason;
return conflict;
@@ -66,8 +64,9 @@ error:
void SYMEXPORT alpm_conflict_free(alpm_conflict_t *conflict)
{
ASSERT(conflict != NULL, return);
FREE(conflict->package2);
FREE(conflict->package1);
_alpm_pkg_free(conflict->package1);
_alpm_pkg_free(conflict->package2);
FREE(conflict);
}
@@ -79,10 +78,8 @@ alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict)
alpm_conflict_t *newconflict;
CALLOC(newconflict, 1, sizeof(alpm_conflict_t), return NULL);
newconflict->package1_hash = conflict->package1_hash;
newconflict->package2_hash = conflict->package2_hash;
STRDUP(newconflict->package1, conflict->package1, goto error);
STRDUP(newconflict->package2, conflict->package2, goto error);
ASSERT(_alpm_pkg_dup(conflict->package1, &newconflict->package1) == 0, goto error);
ASSERT(_alpm_pkg_dup(conflict->package2, &newconflict->package2) == 0, goto error);
newconflict->reason = conflict->reason;
return newconflict;
@@ -105,10 +102,10 @@ static int conflict_isin(alpm_conflict_t *needle, alpm_list_t *haystack)
alpm_list_t *i;
for(i = haystack; i; i = i->next) {
alpm_conflict_t *conflict = i->data;
if(needle->package1_hash == conflict->package1_hash
&& needle->package2_hash == conflict->package2_hash
&& strcmp(needle->package1, conflict->package1) == 0
&& strcmp(needle->package2, conflict->package2) == 0) {
if(needle->package1->name_hash == conflict->package1->name_hash
&& needle->package2->name_hash == conflict->package2->name_hash
&& strcmp(needle->package1->name, conflict->package1->name) == 0
&& strcmp(needle->package2->name, conflict->package2->name) == 0) {
return 1;
}
}

View File

@@ -522,10 +522,10 @@ static int _alpm_hook_run_hook(alpm_handle_t *handle, struct _alpm_hook_t *hook)
alpm_list_count(hook->matches), (alpm_list_fn_cmp)strcmp);
/* hooks with multiple triggers could have duplicate matches */
ctx = hook->matches = _alpm_strlist_dedup(hook->matches);
return _alpm_run_chroot(handle, hook->cmd[0], hook->cmd,
return _alpm_run_chroot(handle, hook->name, ALPM_SCRIPTLET_KIND_HOOK, hook->cmd[0], hook->cmd,
(_alpm_cb_io) _alpm_hook_feed_targets, &ctx);
} else {
return _alpm_run_chroot(handle, hook->cmd[0], hook->cmd, NULL, NULL);
return _alpm_run_chroot(handle, hook->name, ALPM_SCRIPTLET_KIND_HOOK, hook->cmd[0], hook->cmd, NULL, NULL);
}
}

View File

@@ -692,7 +692,7 @@ int _alpm_remove_single_package(alpm_handle_t *handle,
!(handle->trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
char *scriptlet = _alpm_local_db_pkgpath(handle->db_local,
oldpkg, "install");
_alpm_runscriptlet(handle, scriptlet, "pre_remove", pkgver, NULL, 0);
_alpm_runscriptlet(handle, oldpkg->name, scriptlet, "pre_remove", pkgver, NULL, 0);
free(scriptlet);
}
}
@@ -712,7 +712,7 @@ int _alpm_remove_single_package(alpm_handle_t *handle,
!(handle->trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
char *scriptlet = _alpm_local_db_pkgpath(handle->db_local,
oldpkg, "install");
_alpm_runscriptlet(handle, scriptlet, "post_remove", pkgver, NULL, 0);
_alpm_runscriptlet(handle, oldpkg->name, scriptlet, "post_remove", pkgver, NULL, 0);
free(scriptlet);
}

View File

@@ -517,21 +517,23 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
for(i = deps; i; i = i->next) {
alpm_conflict_t *conflict = i->data;
const char *name1 = conflict->package1->name;
const char *name2 = conflict->package2->name;
alpm_pkg_t *rsync, *sync, *sync1, *sync2;
/* have we already removed one of the conflicting targets? */
sync1 = alpm_pkg_find(trans->add, conflict->package1);
sync2 = alpm_pkg_find(trans->add, conflict->package2);
sync1 = alpm_pkg_find(trans->add, name1);
sync2 = alpm_pkg_find(trans->add, name2);
if(!sync1 || !sync2) {
continue;
}
_alpm_log(handle, ALPM_LOG_DEBUG, "conflicting packages in the sync list: '%s' <-> '%s'\n",
conflict->package1, conflict->package2);
name1, name2);
/* if sync1 provides sync2, we remove sync2 from the targets, and vice versa */
alpm_depend_t *dep1 = alpm_dep_from_string(conflict->package1);
alpm_depend_t *dep2 = alpm_dep_from_string(conflict->package2);
alpm_depend_t *dep1 = alpm_dep_from_string(name1);
alpm_depend_t *dep2 = alpm_dep_from_string(name2);
if(_alpm_depcmp(sync1, dep2)) {
rsync = sync2;
sync = sync1;
@@ -559,8 +561,8 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
/* Prints warning */
_alpm_log(handle, ALPM_LOG_WARNING,
_("removing '%s' from target list because it conflicts with '%s'\n"),
rsync->name, sync->name);
_("removing '%s-%s' from target list because it conflicts with '%s-%s'\n"),
rsync->name, rsync->version, sync->name, sync->version);
trans->add = alpm_list_remove(trans->add, rsync, _alpm_pkg_cmp, NULL);
/* rsync is not a transaction target anymore */
trans->unresolvable = alpm_list_add(trans->unresolvable, rsync);
@@ -581,16 +583,18 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
.conflict = i->data
};
alpm_conflict_t *conflict = i->data;
const char *name1 = conflict->package1->name;
const char *name2 = conflict->package2->name;
int found = 0;
/* if conflict->package2 (the local package) is not elected for removal,
/* if name2 (the local package) is not elected for removal,
we ask the user */
if(alpm_pkg_find(trans->remove, conflict->package2)) {
if(alpm_pkg_find(trans->remove, name2)) {
found = 1;
}
for(j = trans->add; j && !found; j = j->next) {
alpm_pkg_t *spkg = j->data;
if(alpm_pkg_find(spkg->removes, conflict->package2)) {
if(alpm_pkg_find(spkg->removes, name2)) {
found = 1;
}
}
@@ -598,15 +602,15 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
continue;
}
_alpm_log(handle, ALPM_LOG_DEBUG, "package '%s' conflicts with '%s'\n",
conflict->package1, conflict->package2);
_alpm_log(handle, ALPM_LOG_DEBUG, "package '%s-%s' conflicts with '%s-%s'\n",
name1, conflict->package1->version, name2,conflict->package2->version);
QUESTION(handle, &question);
if(question.remove) {
/* append to the removes list */
alpm_pkg_t *sync = alpm_pkg_find(trans->add, conflict->package1);
alpm_pkg_t *local = _alpm_db_get_pkgfromcache(handle->db_local, conflict->package2);
_alpm_log(handle, ALPM_LOG_DEBUG, "electing '%s' for removal\n", conflict->package2);
alpm_pkg_t *sync = alpm_pkg_find(trans->add, name1);
alpm_pkg_t *local = _alpm_db_get_pkgfromcache(handle->db_local, name2);
_alpm_log(handle, ALPM_LOG_DEBUG, "electing '%s' for removal\n", name2);
sync->removes = alpm_list_add(sync->removes, local);
} else { /* abort */
_alpm_log(handle, ALPM_LOG_ERROR, _("unresolvable package conflicts detected\n"));
@@ -991,6 +995,13 @@ static int check_validity(alpm_handle_t *handle,
current_bytes += v.pkg->size;
v.path = _alpm_filecache_find(handle, v.pkg->filename);
if(!v.path) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: could not find package in cache\n"), v.pkg->name);
RET_ERR(handle, ALPM_ERR_PKG_NOT_FOUND, -1);
}
v.siglevel = alpm_db_get_siglevel(alpm_pkg_get_db(v.pkg));
if(_alpm_pkg_validate_internal(handle, v.path, v.pkg,
@@ -1082,6 +1093,12 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data,
current_bytes += spkg->size;
filepath = _alpm_filecache_find(handle, spkg->filename);
if(!filepath) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: could not find package in cache\n"), spkg->name);
RET_ERR(handle, ALPM_ERR_PKG_NOT_FOUND, -1);
}
/* load the package file and replace pkgcache entry with it in the target list */
/* TODO: alpm_pkg_get_db() will not work on this target anymore */
_alpm_log(handle, ALPM_LOG_DEBUG,

View File

@@ -334,7 +334,7 @@ static int grep(const char *fn, const char *needle)
return 0;
}
int _alpm_runscriptlet(alpm_handle_t *handle, const char *filepath,
int _alpm_runscriptlet(alpm_handle_t *handle, const char *pkgname, const char *filepath,
const char *script, const char *ver, const char *oldver, int is_archive)
{
char arg0[64], arg1[3], cmdline[PATH_MAX];
@@ -407,7 +407,16 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *filepath,
_alpm_log(handle, ALPM_LOG_DEBUG, "executing \"%s\"\n", cmdline);
retval = _alpm_run_chroot(handle, SCRIPTLET_SHELL, argv, NULL, NULL);
alpm_event_install_run_t event = {
.type = ALPM_EVENT_INSTALL_RUN_START,
.pkgname = pkgname,
};
EVENT(handle, &event);
retval = _alpm_run_chroot(handle, pkgname, ALPM_SCRIPTLET_KIND_INSTALL_FILE, SCRIPTLET_SHELL, argv, NULL, NULL);
event.type = ALPM_EVENT_INSTALL_RUN_DONE;
EVENT(handle, &event);
cleanup:
if(scriptfn && unlink(scriptfn)) {

View File

@@ -49,7 +49,7 @@ typedef struct _alpm_trans_t {
void _alpm_trans_free(alpm_trans_t *trans);
/* flags is a bitfield of alpm_transflag_t flags */
int _alpm_trans_init(alpm_trans_t *trans, int flags);
int _alpm_runscriptlet(alpm_handle_t *handle, const char *filepath,
int _alpm_runscriptlet(alpm_handle_t *handle, const char *name, const char *filepath,
const char *script, const char *ver, const char *oldver, int is_archive);
#endif /* ALPM_TRANS_H */

View File

@@ -31,6 +31,7 @@
#include <limits.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <poll.h>
#include <signal.h>
@@ -496,18 +497,21 @@ static int _alpm_chroot_write_to_child(alpm_handle_t *handle, int fd,
return 0;
}
static void _alpm_chroot_process_output(alpm_handle_t *handle, const char *line)
static void _alpm_chroot_process_output(alpm_handle_t *handle, const char *name,
alpm_scriptlet_kind_t kind, const char *line)
{
alpm_event_scriptlet_info_t event = {
.type = ALPM_EVENT_SCRIPTLET_INFO,
.kind = kind,
.name = name,
.line = line
};
alpm_logaction(handle, "ALPM-SCRIPTLET", "%s", line);
EVENT(handle, &event);
}
static int _alpm_chroot_read_from_child(alpm_handle_t *handle, int fd,
char *buf, ssize_t *buf_size, ssize_t buf_limit)
static int _alpm_chroot_read_from_child(alpm_handle_t *handle, int fd, const char *name,
alpm_scriptlet_kind_t kind, char *buf, ssize_t *buf_size, ssize_t buf_limit)
{
ssize_t space = buf_limit - *buf_size - 2; /* reserve 2 for "\n\0" */
ssize_t nread = read(fd, buf + *buf_size, space);
@@ -519,7 +523,7 @@ static int _alpm_chroot_read_from_child(alpm_handle_t *handle, int fd,
size_t linelen = newline - buf + 1;
char old = buf[linelen];
buf[linelen] = '\0';
_alpm_chroot_process_output(handle, buf);
_alpm_chroot_process_output(handle, name, kind, buf);
buf[linelen] = old;
*buf_size -= linelen;
@@ -529,14 +533,14 @@ static int _alpm_chroot_read_from_child(alpm_handle_t *handle, int fd,
} else if(nread == space) {
/* we didn't read a full line, but we're out of space */
strcpy(buf + *buf_size, "\n");
_alpm_chroot_process_output(handle, buf);
_alpm_chroot_process_output(handle, name, kind, buf);
*buf_size = 0;
}
} else if(nread == 0) {
/* end-of-file */
if(*buf_size) {
strcpy(buf + *buf_size, "\n");
_alpm_chroot_process_output(handle, buf);
_alpm_chroot_process_output(handle, name, kind, buf);
}
return -1;
} else if(should_retry(errno)) {
@@ -545,7 +549,7 @@ static int _alpm_chroot_read_from_child(alpm_handle_t *handle, int fd,
/* read error */
if(*buf_size) {
strcpy(buf + *buf_size, "\n");
_alpm_chroot_process_output(handle, buf);
_alpm_chroot_process_output(handle, name, kind, buf);
}
_alpm_log(handle, ALPM_LOG_ERROR,
_("unable to read from pipe (%s)\n"), strerror(errno));
@@ -581,14 +585,16 @@ static void _alpm_reset_signals(void)
/** Execute a command with arguments in a chroot.
* @param handle the context handle
* @param name a human readable name to describe the command
* @param kind what kind of scriptlet is running
* @param cmd command to execute
* @param argv arguments to pass to cmd
* @param stdin_cb callback to provide input to the chroot on stdin
* @param stdin_ctx context to be passed to @a stdin_cb
* @return 0 on success, 1 on error
*/
int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
_alpm_cb_io stdin_cb, void *stdin_ctx)
int _alpm_run_chroot(alpm_handle_t *handle, const char *name, alpm_scriptlet_kind_t kind,
const char *cmd, char *const argv[], _alpm_cb_io stdin_cb, void *stdin_ctx)
{
pid_t pid;
int child2parent_pipefd[2], parent2child_pipefd[2];
@@ -649,12 +655,15 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
close(parent2child_pipefd[HEAD]);
close(child2parent_pipefd[TAIL]);
close(child2parent_pipefd[HEAD]);
if(cwdfd >= 0) {
close(cwdfd);
}
/* use fprintf instead of _alpm_log to send output through the parent */
if(chroot(handle->root) != 0) {
/* don't chroot() to "/": this allows running with less caps when the
* caller puts us in the right root */
if(strcmp(handle->root, "/") != 0 && chroot(handle->root) != 0) {
fprintf(stderr, _("could not change the root directory (%s)\n"), strerror(errno));
exit(1);
}
@@ -674,24 +683,38 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
_alpm_reset_signals();
execv(cmd, argv);
/* execv only returns if there was an error */
fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno));
fprintf(stderr, _("%s: failed to execv '%s' (%s)\n"), name, cmd, strerror(errno));
exit(1);
} else {
/* this code runs for the parent only (wait on the child) */
int status;
char obuf[PIPE_BUF]; /* writes <= PIPE_BUF are guaranteed atomic */
char ibuf[LINE_MAX];
char sciptlet_name[32];
ssize_t olen = 0, ilen = 0;
nfds_t nfds = 2;
struct pollfd fds[2], *child2parent = &(fds[0]), *parent2child = &(fds[1]);
int poll_ret;
switch(kind) {
case ALPM_SCRIPTLET_KIND_HOOK:
snprintf(sciptlet_name, 32, "hook '%s'", name);
break;
case ALPM_SCRIPTLET_KIND_INSTALL_FILE:
snprintf(sciptlet_name, 32, "'%s.install'", name);
break;
case ALPM_SCRIPTLET_KIND_COMMAND:
strncpy(sciptlet_name, "ldconfig", 32);
break;
}
child2parent->fd = child2parent_pipefd[TAIL];
child2parent->events = POLLIN;
fcntl(child2parent->fd, F_SETFL, O_NONBLOCK);
close(child2parent_pipefd[HEAD]);
close(parent2child_pipefd[TAIL]);
if(stdin_cb) {
parent2child->fd = parent2child_pipefd[HEAD];
parent2child->events = POLLOUT;
@@ -714,7 +737,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
}
}
if(child2parent->revents & POLLIN) {
if(_alpm_chroot_read_from_child(handle, child2parent->fd,
if(_alpm_chroot_read_from_child(handle, child2parent->fd, name, kind,
ibuf, &ilen, sizeof(ibuf)) != 0) {
/* we encountered end-of-file or an error */
STOP_POLLING(child2parent);
@@ -737,7 +760,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
if(ilen) {
/* buffer would have already been flushed if it had a newline */
strcpy(ibuf + ilen, "\n");
_alpm_chroot_process_output(handle, ibuf);
_alpm_chroot_process_output(handle, name, kind, ibuf);
}
#undef STOP_POLLING
@@ -753,7 +776,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
while(waitpid(pid, &status, 0) == -1) {
if(errno != EINTR) {
_alpm_log(handle, ALPM_LOG_ERROR, _("call to waitpid failed (%s)\n"), strerror(errno));
_alpm_log(handle, ALPM_LOG_ERROR, _("failed to run %s: call to waitpid failed (%s)\n"), sciptlet_name, strerror(errno));
retval = 1;
goto cleanup;
}
@@ -763,7 +786,8 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
if(WIFEXITED(status)) {
_alpm_log(handle, ALPM_LOG_DEBUG, "call to waitpid succeeded\n");
if(WEXITSTATUS(status) != 0) {
_alpm_log(handle, ALPM_LOG_ERROR, _("command failed to execute correctly\n"));
_alpm_log(handle, ALPM_LOG_ERROR, _("%s did not complete sucessfully (%s exited %d)\n"),
sciptlet_name, cmd, WEXITSTATUS(status));
retval = 1;
}
} else if(WIFSIGNALED(status) != 0) {
@@ -772,8 +796,8 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
if(signal_description == NULL) {
signal_description = _("Unknown signal");
}
_alpm_log(handle, ALPM_LOG_ERROR, _("command terminated by signal %d: %s\n"),
WTERMSIG(status), signal_description);
_alpm_log(handle, ALPM_LOG_ERROR, _("%s terminated by signal %d: %s\n"),
sciptlet_name, WTERMSIG(status), signal_description);
retval = 1;
}
}
@@ -804,10 +828,9 @@ int _alpm_ldconfig(alpm_handle_t *handle)
if(access(line, F_OK) == 0) {
snprintf(line, PATH_MAX, "%s%s", handle->root, LDCONFIG);
if(access(line, X_OK) == 0) {
char arg0[32];
char *arg0 = strdup(LDCONFIG);
char *argv[] = { arg0, NULL };
strcpy(arg0, "ldconfig");
return _alpm_run_chroot(handle, LDCONFIG, argv, NULL, NULL);
return _alpm_run_chroot(handle, "ldconfig", ALPM_SCRIPTLET_KIND_COMMAND, LDCONFIG, argv, NULL, NULL);
}
}
@@ -842,10 +865,17 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename)
for(i = handle->cachedirs; i; i = i->next) {
snprintf(path, PATH_MAX, "%s%s", (char *)i->data,
filename);
if(stat(path, &buf) == 0 && S_ISREG(buf.st_mode)) {
retpath = strdup(path);
_alpm_log(handle, ALPM_LOG_DEBUG, "found cached pkg: %s\n", retpath);
return retpath;
if(stat(path, &buf) == 0) {
if(S_ISREG(buf.st_mode)) {
retpath = strdup(path);
_alpm_log(handle, ALPM_LOG_DEBUG, "found cached pkg: %s\n", retpath);
return retpath;
} else {
_alpm_log(handle, ALPM_LOG_WARNING,
"cached pkg '%s' is not a regular file: mode=%i\n", path, buf.st_mode);
}
} else if(errno != ENOENT) {
_alpm_log(handle, ALPM_LOG_WARNING, "could not open '%s'\n: %s", path, strerror(errno));
}
}
/* package wasn't found in any cachedir */
@@ -1352,6 +1382,11 @@ int _alpm_access(alpm_handle_t *handle, const char *dir, const char *file, int a
size_t len = 0;
int ret = 0;
int flag = 0;
#ifdef AT_SYMLINK_NOFOLLOW
flag |= AT_SYMLINK_NOFOLLOW;
#endif
if(dir) {
char *check_path;
@@ -1359,11 +1394,11 @@ int _alpm_access(alpm_handle_t *handle, const char *dir, const char *file, int a
CALLOC(check_path, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(check_path, len, "%s%s", dir, file);
ret = access(check_path, amode);
ret = faccessat(AT_FDCWD, check_path, amode, flag);
free(check_path);
} else {
dir = "";
ret = access(file, amode);
ret = faccessat(AT_FDCWD, file, amode, flag);
}
if(ret != 0) {

View File

@@ -129,8 +129,8 @@ ssize_t _alpm_files_in_directory(alpm_handle_t *handle, const char *path, int fu
typedef ssize_t (*_alpm_cb_io)(void *buf, ssize_t len, void *ctx);
int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
_alpm_cb_io in_cb, void *in_ctx);
int _alpm_run_chroot(alpm_handle_t *handle, const char *name, alpm_scriptlet_kind_t kind,
const char *cmd, char *const argv[], _alpm_cb_io in_cb, void *in_ctx);
int _alpm_ldconfig(alpm_handle_t *handle);
int _alpm_str_cmp(const void *s1, const void *s2);
char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename);

View File

@@ -182,7 +182,22 @@ foreach type : [
endif
endforeach
if conf.has('HAVE_STRUCT_STATVFS_F_FLAG')
if conf.has('HAVE_GETMNTINFO')
if cc.compiles('''
#include <sys/types.h>
#include <sys/statvfs.h>
void func() {
struct statvfs *buf;
getmntinfo(&buf, 0);
}
''')
conf.set('FSSTATSTYPE', 'struct statvfs')
else
conf.set('FSSTATSTYPE', 'struct statfs')
endif
elif conf.has('HAVE_STRUCT_STATVFS_F_FLAG')
conf.set('FSSTATSTYPE', 'struct statvfs')
elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')
conf.set('FSSTATSTYPE', 'struct statfs')

View File

@@ -28,7 +28,7 @@ changelog=
source=("$pkgbase-$pkgver.tar.gz"
"$pkgname-$pkgver.patch")
noextract=()
md5sums=()
sha256sums=()
validpgpkeys=()
prepare() {

View File

@@ -25,7 +25,7 @@ options=()
install=
source=('FOLDER::VCS+URL#FRAGMENT')
noextract=()
md5sums=('SKIP')
sha256sums=('SKIP')
# Please refer to the 'USING VCS SOURCES' section of the PKGBUILD man page for
# a description of each element in the source array.

View File

@@ -27,7 +27,7 @@ changelog=
source=("$pkgname-$pkgver.tar.gz"
"$pkgname-$pkgver.patch")
noextract=()
md5sums=()
sha256sums=()
validpgpkeys=()
prepare() {

View File

@@ -553,7 +553,7 @@ _pacman_conf_directive() {
_pacman_conf_commands=(
{-l,--repo-list}'[List configured repositories]:*: :->repo_list'
{-h,--help}'[Output systax and command line options]:*: :->complete'
{-h,--help}'[Output syntax and command line options]:*: :->complete'
{-V,--version}'[Display version and exit]:*: :->complete'
)
@@ -564,7 +564,7 @@ _pacman_conf_options=(
_pacman_conf_options_common=(
'*'{-c,--config=}'[Specify an alternate configuration file]: :_files'
'*'{-R,--rootdir=}'[Specify an alternate insallation root]: :_files'
'*'{-R,--rootdir=}'[Specify an alternate installation root]: :_files'
)
_pacman_conf() {

View File

@@ -21,11 +21,11 @@
[[ -n "$LIBMAKEPKG_AUTODEP_SH" ]] && return
LIBMAKEPKG_AUTODEP_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
declare -a autodep_functions
for lib in "$LIBRARY/autodep/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/autodep/"*.sh; do
source "$lib"
done

View File

@@ -21,7 +21,7 @@
[[ -n "$LIBMAKEPKG_AUTODEP_LIBRARY_DEPENDS_SH" ]] && return
LIBMAKEPKG_AUTODEP_LIBRARY_DEPENDS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
autodep_functions+=('library_depends')

View File

@@ -21,7 +21,7 @@
[[ -n "$LIBMAKEPKG_AUTODEP_LIBRARY_PROVIDES_SH" ]] && return
LIBMAKEPKG_AUTODEP_LIBRARY_PROVIDES_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
autodep_functions+=('library_provides')

View File

@@ -22,12 +22,12 @@
[[ -n "$LIBMAKEPKG_BUILDENV_SH" ]] && return
LIBMAKEPKG_BUILDENV_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
declare -a buildenv_functions build_options
buildenv_vars=('CPPFLAGS' 'CFLAGS' 'CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST')
for lib in "$LIBRARY/buildenv/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/buildenv/"*.sh; do
source "$lib"
done

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_BUILDENV_BUILDFLAGS_SH" ]] && return
LIBMAKEPKG_BUILDENV_BUILDFLAGS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
build_options+=('buildflags')

View File

@@ -23,9 +23,9 @@
[[ -n "$LIBMAKEPKG_BUILDENV_COMPILER_SH" ]] && return
LIBMAKEPKG_BUILDENV_COMPILER_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
build_options+=('ccache' 'distcc')
buildenv_functions+=('buildenv_ccache' 'buildenv_distcc')

View File

@@ -22,17 +22,18 @@
[[ -n "$LIBMAKEPKG_BUILDENV_DEBUGFLAGS_SH" ]] && return
LIBMAKEPKG_BUILDENV_DEBUGFLAGS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/util.sh"
buildenv_functions+=('buildenv_debugflags')
buildenv_debugflags() {
if check_option "debug" "y" && ! check_option "buildflags" "n"; then
DEBUG_CFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
DEBUG_CXXFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
CFLAGS+=" $DEBUG_CFLAGS"
CXXFLAGS+=" $DEBUG_CXXFLAGS"
append_once DEBUG_CFLAGS "-ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
append_once DEBUG_CXXFLAGS "-ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
append_once CFLAGS "$DEBUG_CFLAGS"
append_once CXXFLAGS "$DEBUG_CXXFLAGS"
fi
}

View File

@@ -22,17 +22,18 @@
[[ -n "$LIBMAKEPKG_BUILDENV_LTO_SH" ]] && return
LIBMAKEPKG_BUILDENV_LTO_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/util.sh"
build_options+=('lto')
buildenv_functions+=('buildenv_lto')
buildenv_lto() {
if check_option "lto" "y" && ! check_option "buildflags" "n"; then
CFLAGS+=" ${LTOFLAGS:--flto}"
CXXFLAGS+=" ${LTOFLAGS:--flto}"
LDFLAGS+=" ${LTOFLAGS:--flto}"
append_once CFLAGS "${LTOFLAGS:--flto}"
append_once CXXFLAGS "${LTOFLAGS:--flto}"
append_once LDFLAGS "${LTOFLAGS:--flto}"
fi
}

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_BUILDENV_MAKEFLAGS_SH" ]] && return
LIBMAKEPKG_BUILDENV_MAKEFLAGS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
build_options+=('makeflags')
buildenv_functions+=('buildenv_makeflags')

View File

@@ -21,16 +21,17 @@
[[ -n "$LIBMAKEPKG_BUILDENV_RUST_SH" ]] && return
LIBMAKEPKG_BUILDENV_RUST_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/util.sh"
buildenv_var+=('RUSTFLAGS' 'DEBUG_RUSTFLAGS')
buildenv_functions+=('buildenv_rust')
buildenv_rust() {
if check_option "debug" "y" && ! check_option "buildflags" "n"; then
DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
RUSTFLAGS+=" $DEBUG_RUSTFLAGS"
append_once DEBUG_RUSTFLAGS "--remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
append_once RUSTFLAGS "$DEBUG_RUSTFLAGS"
fi
}

View File

@@ -21,11 +21,11 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
declare -a executable_functions
for lib in "$LIBRARY/executable/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/executable/"*.sh; do
source "$lib"
done

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_CCACHE_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_CCACHE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
executable_functions+=('executable_ccache')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_CHECKSUM_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_CHECKSUM_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
executable_functions+=('executable_checksum')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_DEBUGEDIT_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_DEBUGEDIT_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
executable_functions+=('executable_debugedit')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_DISTCC_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_DISTCC_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
executable_functions+=('executable_distcc')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_FAKEROOT_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_FAKEROOT_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
executable_functions+=('executable_fakeroot')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_GPG_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_GPG_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
executable_functions+=('executable_gpg')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_GZIP_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_GZIP_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
executable_functions+=('executable_gzip')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_PACMAN_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_PACMAN_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
executable_functions+=('executable_pacman')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_STRIP_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_STRIP_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
executable_functions+=('executable_strip')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_SUDO_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_SUDO_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
executable_functions+=('executable_sudo')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_VCS_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_VCS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/error.sh"
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/error.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
executable_functions+=('executable_vcs')

View File

@@ -21,11 +21,11 @@
[[ -n "$LIBMAKEPKG_INTEGRITY_SH" ]] && return
LIBMAKEPKG_INTEGRITY_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
for lib in "$LIBRARY/integrity/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/integrity/"*.sh; do
source "$lib"
done
@@ -42,4 +42,7 @@ check_source_integrity() {
check_checksums "$@"
check_pgpsigs "$@"
fi
if (( VERIFYFUNC )); then
run_verify
fi
}

View File

@@ -21,11 +21,11 @@
[[ -n "$LIBMAKEPKG_INTEGRITY_GENERATE_CHECKSUM_SH" ]] && return
LIBMAKEPKG_INTEGRITY_GENERATE_CHECKSUM_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/util/schema.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/schema.sh"
generate_one_checksum() {
local integ=$1 arch=$2 sources numsrc indentsz idx
@@ -54,7 +54,17 @@ generate_one_checksum() {
case $proto in
bzr|git|hg|svn)
sum="SKIP"
if declare -f "calc_checksum_$proto" > /dev/null; then
if ! sum=$("calc_checksum_$proto" "$netfile" "$integ"); then
local name
name=$(get_filename "$netfile")
error "$(gettext "Failure while calculating %s %s checksum")" "${name}" "${proto}"
plainerr "$(gettext "Aborting...")"
exit 1
fi
else
sum="SKIP"
fi
;;
*)
if [[ ${netfile%%::*} != *.@(sig?(n)|asc) ]]; then

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_INTEGRITY_GENERATE_SIGNATURE_SH" ]] && return
LIBMAKEPKG_INTEGRITY_GENERATE_SIGNATURE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
create_signature() {
local ret=0

View File

@@ -21,11 +21,12 @@
[[ -n "$LIBMAKEPKG_INTEGRITY_VERIFY_CHECKSUM_SH" ]] && return
LIBMAKEPKG_INTEGRITY_CHECKSUM_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/util/schema.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/schema.sh"
source "$MAKEPKG_LIBRARY/source.sh"
check_checksums() {
local integ a
@@ -68,9 +69,9 @@ check_checksums() {
}
verify_integrity_one() {
local source_name=$1 integ=$2 expectedsum=$3
local source_name=$1 integ=$2 expectedsum=$3 file proto realsum
local file="$(get_filename "$source_name")"
file="$(get_filename "$source_name")"
printf ' %s ... ' "$file" >&2
if [[ $expectedsum = 'SKIP' ]]; then
@@ -78,20 +79,18 @@ verify_integrity_one() {
return
fi
if ! file="$(get_filepath "$file")"; then
printf '%s\n' "$(gettext "NOT FOUND")" >&2
return 1
proto="$(get_protocol "$source_name")"
if declare -f "calc_checksum_${proto}" > /dev/null; then
realsum=$("calc_checksum_${proto}" "$source_name" "$integ") || return 1
else
realsum=$(calc_checksum_file "$source_name" "$integ") || return 1
fi
local realsum="$("${integ}sum" "$file")"
realsum="${realsum%% *}"
if [[ ${expectedsum,,} = "$realsum" ]]; then
printf '%s\n' "$(gettext "Passed")" >&2
else
if [[ ${expectedsum,,} != "$realsum" ]]; then
printf '%s\n' "$(gettext "FAILED")" >&2
return 1
fi
printf '%s\n' "$(gettext "Passed")" >&2
return 0
}

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_INTEGRITY_VERIFY_SIGNATURE_SH" ]] && return
LIBMAKEPKG_INTEGRITY_VERIFY_SIGNATURE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
check_pgpsigs() {
(( SKIPPGPCHECK )) && return 0

View File

@@ -21,15 +21,15 @@
[[ -n "$LIBMAKEPKG_LINT_CONFIG_SH" ]] && return
LIBMAKEPKG_LINT_CONFIG_SH=1
LIBRARY=${LIBRARY:-'/usr/share/makepkg'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'/usr/share/makepkg'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/util.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/util.sh"
declare -a lint_config_functions
for lib in "$LIBRARY/lint_config/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/lint_config/"*.sh; do
source "$lib"
done

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_CONFIG_EXT_SH" ]] && return
LIBMAKEPKG_LINT_CONFIG_EXT_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_config_functions+=('lint_ext')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_LINT_CONFIG_PATHS_SH" ]] && return
LIBMAKEPKG_LINT_CONFIG_PATHS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_config_functions+=('lint_paths')

View File

@@ -21,9 +21,9 @@
[[ -n $LIBMAKEPKG_LINT_CONFIG_SOURCE_DATE_EPOCH_SH ]] && return
LIBMAKEPKG_LINT_CONFIG_SOURCE_DATE_EPOCH_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_config_functions+=('lint_source_date_epoch')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_CONFIG_VARIABLE_SH" ]] && return
LIBMAKEPKG_LINT_CONFIG_VARIABLE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_config_functions+=('lint_config_variables')

View File

@@ -21,15 +21,15 @@
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_SH" ]] && return
LIBMAKEPKG_LINT_PACKAGE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/util.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/util.sh"
declare -a lint_package_functions
for lib in "$LIBRARY/lint_package/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/lint_package/"*.sh; do
source "$lib"
done

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_BUILD_REFERENCES_SH" ]] && return
LIBMAKEPKG_LINT_PACKAGE_BUILD_REFERENCES_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_package_functions+=('warn_build_references')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_DOTFILES_SH" ]] && return
LIBMAKEPKG_LINT_PACKAGE_DOTFILES_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_package_functions+=('check_dotfiles')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_FILE_NAMES_SH" ]] && return
LIBMAKEPKG_LINT_PACKAGE_FILE_NAMES_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_package_functions+=('lint_file_names')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_MISSING_BACKUP_SH" ]] && return
LIBMAKEPKG_LINT_PACKAGE_MISSING_BACKUP_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_package_functions+=('warn_missing_backup')

View File

@@ -21,14 +21,14 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
declare -a lint_pkgbuild_functions
for lib in "$LIBRARY/lint_pkgbuild/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/lint_pkgbuild/"*.sh; do
source "$lib"
done

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_ARCH_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_ARCH_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_arch')

View File

@@ -21,12 +21,12 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_ARCH_SPECIFIC_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_ARCH_SPECIFIC_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/util/schema.sh"
source "$LIBRARY/util/util.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/schema.sh"
source "$MAKEPKG_LIBRARY/util/util.sh"
lint_pkgbuild_functions+=('lint_arch_specific')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_BACKUP_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_BACKUP_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_backup')

View File

@@ -21,11 +21,11 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CHANGELOG_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_CHANGELOG_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/lint_pkgbuild/util.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/util.sh"
lint_pkgbuild_functions+=('lint_changelog')

View File

@@ -21,12 +21,12 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_checkdepends')

View File

@@ -21,12 +21,12 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_conflicts')

View File

@@ -21,12 +21,12 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_depends')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_EPOCH_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_EPOCH_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_pkgbuild_functions+=('lint_epoch')

View File

@@ -21,11 +21,11 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_FULLPKGVER_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_FULLPKGVER_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/lint_pkgbuild/epoch.sh"
source "$LIBRARY/lint_pkgbuild/pkgrel.sh"
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/epoch.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgrel.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgver.sh"
check_fullpkgver() {

View File

@@ -21,11 +21,11 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_INSTALL_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_INSTALL_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/lint_pkgbuild/util.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/util.sh"
lint_pkgbuild_functions+=('lint_install')

View File

@@ -21,12 +21,12 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_makedepends')

View File

@@ -21,12 +21,12 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_optdepends')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_OPTIONS_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_OPTIONS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_options')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_package_function')

View File

@@ -21,12 +21,12 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/util/schema.sh"
source "$LIBRARY/util/util.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/schema.sh"
source "$MAKEPKG_LIBRARY/util/util.sh"
lint_pkgbuild_functions+=('lint_package_function_variable')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGBASE_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_PKGBASE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_pkgbuild_functions+=('lint_pkgbase')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGLIST_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_PKGLIST_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/util.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/util.sh"
lint_pkgbuild_functions+=('lint_pkglist')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGNAME_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_PKGNAME_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_pkgbuild_functions+=('lint_pkgname')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGREL_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_PKGREL_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_pkgbuild_functions+=('lint_pkgrel')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGVER_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_PKGVER_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_pkgbuild_functions+=('lint_pkgver')

View File

@@ -21,12 +21,12 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PROVIDES_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_PROVIDES_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
lint_pkgbuild_functions+=('lint_provides')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_SOURCE_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_SOURCE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
lint_pkgbuild_functions+=('lint_source')

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_UTIL_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_UTIL_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
check_files_exist() {

View File

@@ -21,14 +21,14 @@
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_VARIABLE_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_VARIABLE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/util/schema.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/schema.sh"
lint_pkgbuild_functions+=('lint_variable')
lint_pkgbuild_functions+=('lint_array')
lint_variable() {
local i a pkg out bad ret=0
@@ -95,3 +95,21 @@ lint_variable() {
return $ret
}
lint_array() {
local i var ret=0
for i in ${pkgbuild_schema_arrays[@]}; do
local l=()
get_pkgbuild_all_split_attributes $i l
for var in "${l[@]}"; do
if [[ -z $var ]]; then
error "$(gettext "%s does not allow empty values.")" "$i"
ret=1
fi
done
done
return $ret
}

View File

@@ -21,9 +21,9 @@
[[ -n "$LIBMAKEPKG_REPRODUCIBLE_SH" ]] && return
LIBMAKEPKG_REPRODUCIBLE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
for lib in "$LIBRARY/reproducible/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/reproducible/"*.sh; do
source "$lib"
done

View File

@@ -22,7 +22,7 @@
LIBMAKEPKG_REPRODUCIBLE_PYTHON_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
# disable hash randomization when creating .pyc files

View File

@@ -21,14 +21,14 @@
[[ -n "$LIBMAKEPKG_SOURCE_SH" ]] && return
LIBMAKEPKG_SOURCE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/util/source.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/source.sh"
for lib in "$LIBRARY/source/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/source/"*.sh; do
source "$lib"
done

View File

@@ -22,10 +22,10 @@
LIBMAKEPKG_SOURCE_BZR_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
download_bzr() {
@@ -109,3 +109,29 @@ extract_bzr() {
popd &>/dev/null
}
calc_checksum_bzr() {
local netfile=$1 integ=$2 ret=0 shellopts dir url fragment fragval sum
# this function requires pipefail - save current status to restore later
shellopts=$(shopt -p -o pipefail)
shopt -s -o pipefail
dir=$(get_filepath "$netfile")
url=$(get_url "$netfile")
fragment=$(get_uri_fragment "$url")
case ${fragment%%=*} in
revision)
fragval=${fragment##*=}
sum=$(bzr export --directory "$dir" --format tar --revision "$fragval" - | "${integ}sum" 2>&1) || ret=1
sum="${sum%% *}"
;;
*)
sum="SKIP"
esac
eval "$shellopts"
printf '%s' "$sum"
return $ret
}

View File

@@ -22,10 +22,10 @@
LIBMAKEPKG_SOURCE_FILE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
download_file() {
@@ -151,3 +151,18 @@ extract_file() {
chown -R 0:0 "$srcdir"
fi
}
calc_checksum_file() {
local netfile=$1 integ=$2 ret=0 file sum
if ! file="$(get_filepath "$netfile")"; then
printf '%s\n' "$(gettext "NOT FOUND")" >&2
return 1
fi
sum="$("${integ}sum" "$file")" || ret=1
sum="${sum%% *}"
printf '%s' "$sum"
return $ret
}

View File

@@ -22,10 +22,10 @@
LIBMAKEPKG_SOURCE_FOSSIL_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
download_fossil() {
# abort early if parent says not to fetch

View File

@@ -22,10 +22,10 @@
LIBMAKEPKG_SOURCE_GIT_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
download_git() {
@@ -48,7 +48,7 @@ download_git() {
if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git"
if ! git clone ${GITFLAGS:---mirror} "$url" "$dir"; then
if ! git clone --origin=origin ${GITFLAGS:---mirror} "$url" "$dir"; then
error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git"
plainerr "$(gettext "Aborting...")"
exit 1
@@ -56,7 +56,8 @@ download_git() {
elif (( ! HOLDVER )); then
cd_safe "$dir"
# Make sure we are fetching the right repo
if [[ "$url" != "$(git config --get remote.origin.url)" ]] ; then
local remote_url="$(git config --get remote.origin.url)"
if [[ "${url%%.git}" != "${remote_url%%.git}" ]] ; then
error "$(gettext "%s is not a clone of %s")" "$dir" "$url"
plainerr "$(gettext "Aborting...")"
exit 1
@@ -91,7 +92,7 @@ extract_git() {
exit 1
fi
cd_safe "$srcdir"
elif ! git clone -s "$dir" "${dir##*/}"; then
elif ! git clone --origin=origin -s "$dir" "${dir##*/}"; then
error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "git"
plainerr "$(gettext "Aborting...")"
exit 1
@@ -134,3 +135,30 @@ extract_git() {
popd &>/dev/null
}
calc_checksum_git() {
local netfile=$1 integ=$2 ret=0 shellopts dir url fragment sum
# this function requires pipefail - save current status to restore later
shellopts=$(shopt -p -o pipefail)
shopt -s -o pipefail
dir=$(get_filepath "$netfile")
url=$(get_url "$netfile")
fragment=$(get_uri_fragment "$url")
case ${fragment%%=*} in
tag|commit)
fragval=${fragment##*=}
sum=$(git -c core.abbrev=no -C "$dir" archive --format tar "$fragval" | "${integ}sum" 2>&1) || ret=1
sum="${sum%% *}"
;;
*)
sum="SKIP"
;;
esac
eval "$shellopts"
printf '%s' "$sum"
return $ret
}

View File

@@ -22,10 +22,10 @@
LIBMAKEPKG_SOURCE_HG_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
download_hg() {
@@ -111,3 +111,30 @@ extract_hg() {
popd &>/dev/null
}
calc_checksum_hg() {
local netfile=$1 integ=$2 ret=0 shellopts dir url fragment fragval sum
# this function requires pipefail - save current status to restore later
shellopts=$(shopt -p -o pipefail)
shopt -s -o pipefail
dir=$(get_filepath "$netfile")
url=$(get_url "$netfile")
fragment=$(get_uri_fragment "$url")
case ${fragment%%=*} in
tag|revision)
fragval=${fragment##*=}
sum=$(hg --repository "$dir" archive --type tar --rev "$fragval" - | "${integ}sum" 2>&1) || ret=1
sum="${sum%% *}"
;;
*)
sum="SKIP"
;;
esac
eval "$shellopts"
printf '%s' "$sum"
return $ret
}

View File

@@ -22,10 +22,10 @@
LIBMAKEPKG_SOURCE_LOCAL_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
download_local() {

View File

@@ -22,10 +22,10 @@
LIBMAKEPKG_SOURCE_SVN_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
download_svn() {

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_SRCINFO_SH" ]] && return
LIBMAKEPKG_SRCINFO_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/util/schema.sh"
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
source "$MAKEPKG_LIBRARY/util/schema.sh"
srcinfo_open_section() {
printf '%s = %s\n' "$1" "$2"

View File

@@ -22,14 +22,14 @@
[[ -n "$LIBMAKEPKG_TIDY_SH" ]] && return
LIBMAKEPKG_TIDY_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
declare -a packaging_options tidy_remove tidy_modify
for lib in "$LIBRARY/tidy/"*.sh; do
for lib in "$MAKEPKG_LIBRARY/tidy/"*.sh; do
source "$lib"
done

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_TIDY_DOCS_SH" ]] && return
LIBMAKEPKG_TIDY_DOCS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
packaging_options+=('docs')
tidy_remove+=('tidy_docs')

View File

@@ -21,10 +21,10 @@
[[ -n "$LIBMAKEPKG_TIDY_EMPTYDIRS_SH" ]] && return
LIBMAKEPKG_TIDY_EMPTYDIRS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/message.sh"
source "$MAKEPKG_LIBRARY/util/option.sh"
packaging_options+=('emptydirs')

Some files were not shown because too many files have changed in this diff Show More