forked from mirrors/pacman
Compare commits
105 Commits
andrew/pfo
...
morganamil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83838214b7 | ||
|
|
4baeb8e40b | ||
|
|
18b65ec909 | ||
|
|
45ce932fd0 | ||
|
|
da4b590bce | ||
|
|
0649a66ee5 | ||
|
|
6e6d3f18e3 | ||
|
|
0a394144b2 | ||
|
|
fde59b99e8 | ||
|
|
edd57c8b96 | ||
|
|
5c75a55c7d | ||
|
|
56f1eeef4b | ||
|
|
f8c2e59ec5 | ||
|
|
16a064701a | ||
|
|
86ec26b2d3 | ||
|
|
3aa096a74f | ||
|
|
bf76b5e89f | ||
|
|
ce528a2654 | ||
|
|
f996f30163 | ||
|
|
2ba08e622b | ||
|
|
4856fb53ac | ||
|
|
a6b2524762 | ||
|
|
2079f6866a | ||
|
|
845dadf183 | ||
|
|
dfee773364 | ||
|
|
c64f898c48 | ||
|
|
16a2a79728 | ||
|
|
6711d10f96 | ||
|
|
36fcff6e13 | ||
|
|
3c28c30133 | ||
|
|
4c93e63ddf | ||
|
|
f69d9b4475 | ||
|
|
42fa74e91a | ||
|
|
929bad61c0 | ||
|
|
00d2b1f902 | ||
|
|
7a4fff3310 | ||
|
|
8d38746586 | ||
|
|
0df44c2e20 | ||
|
|
dc91476555 | ||
|
|
bad3e13eaa | ||
|
|
45e94e2dae | ||
|
|
3aa1975c1d | ||
|
|
56626816b6 | ||
|
|
0f512ae46e | ||
|
|
d56e9ed083 | ||
|
|
2d190d5a33 | ||
|
|
2e23126e2a | ||
|
|
18e49f2c97 | ||
|
|
0108e2c64e | ||
|
|
94d9c2affe | ||
|
|
6e9ab43451 | ||
|
|
9af4033cad | ||
|
|
31ffbc94ca | ||
|
|
e9b385a636 | ||
|
|
917b67f5d1 | ||
|
|
331b277eea | ||
|
|
30f9a2e263 | ||
|
|
aff12189d8 | ||
|
|
332d2a1922 | ||
|
|
f91fa546f6 | ||
|
|
b4f11d5496 | ||
|
|
015cdb21bd | ||
|
|
05f283b5ad | ||
|
|
34611a6643 | ||
|
|
76b140c72a | ||
|
|
5f43ac85f6 | ||
|
|
0dfe5c96ae | ||
|
|
36d70a93e2 | ||
|
|
717e5e9157 | ||
|
|
e7d7433b4b | ||
|
|
e210634982 | ||
|
|
6968f77026 | ||
|
|
06db927a1a | ||
|
|
909f2e86c3 | ||
|
|
5bd0b98b42 | ||
|
|
c1d4a6198c | ||
|
|
f5af66f130 | ||
|
|
5473c9fd3f | ||
|
|
e58d799c47 | ||
|
|
366b527757 | ||
|
|
e83e53f3f9 | ||
|
|
2348dcab22 | ||
|
|
f9d8beef45 | ||
|
|
85ab0307d7 | ||
|
|
ffde12cebd | ||
|
|
37dae721d3 | ||
|
|
aa3a1bc3b5 | ||
|
|
298755c905 | ||
|
|
ee933acf84 | ||
|
|
ca3c873d48 | ||
|
|
2fc2ab6cf0 | ||
|
|
843bf21e79 | ||
|
|
2c45e854ab | ||
|
|
a81ec016d7 | ||
|
|
55da1a01b6 | ||
|
|
5e94752434 | ||
|
|
262aa6c24e | ||
|
|
3323662ee0 | ||
|
|
6c913af95d | ||
|
|
71764b6d4c | ||
|
|
e0bbfb5682 | ||
|
|
09e82f01ea | ||
|
|
d35728f924 | ||
|
|
3f8029af92 | ||
|
|
6344aab3bd |
@@ -16,6 +16,10 @@ default:
|
|||||||
python
|
python
|
||||||
fakeroot fakechroot
|
fakeroot fakechroot
|
||||||
meson
|
meson
|
||||||
|
artifacts:
|
||||||
|
when: always
|
||||||
|
paths:
|
||||||
|
- build/meson-logs/meson-log.txt
|
||||||
|
|
||||||
arch:
|
arch:
|
||||||
extends: .arch-test
|
extends: .arch-test
|
||||||
@@ -46,14 +50,14 @@ arch-clang:
|
|||||||
- ninja -C build
|
- ninja -C build
|
||||||
- fakechroot meson test -C build
|
- fakechroot meson test -C build
|
||||||
|
|
||||||
arch-valgrind:
|
#arch-valgrind:
|
||||||
extends: .arch-test
|
# extends: .arch-test
|
||||||
script:
|
# script:
|
||||||
- pacman -Syu --needed --noconfirm valgrind
|
# - pacman -Syu --needed --noconfirm valgrind
|
||||||
- pacman -U --noconfirm https://geo.mirror.pkgbuild.com/core-debug/os/x86_64/glibc-debug-$(pacman -S --print-format %v glibc)-x86_64.pkg.tar.zst
|
# - pacman -U --noconfirm https://geo.mirror.pkgbuild.com/core-debug/os/x86_64/glibc-debug-$(pacman -S --print-format %v glibc)-x86_64.pkg.tar.zst
|
||||||
- meson setup build
|
# - meson setup build
|
||||||
- ninja -C build
|
# - ninja -C build
|
||||||
- PACTEST_VALGRIND=1 fakechroot meson test -C build
|
# - PACTEST_VALGRIND=1 fakechroot meson test -C build
|
||||||
|
|
||||||
arch-nettle:
|
arch-nettle:
|
||||||
extends: .arch-test
|
extends: .arch-test
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
# This script serves as a trampoline for running scripts which depend on
|
# This script serves as a trampoline for running scripts which depend on
|
||||||
# libmakepkg with the libmakepkg within the build tree.
|
# libmakepkg with the libmakepkg within the build tree.
|
||||||
|
|
||||||
LIBRARY=@BUILDDIR@/libmakepkg exec @BASH@ -$- @REAL_PROGPATH@ "$@"
|
MAKEPKG_LIBRARY=@BUILDDIR@/libmakepkg exec @BASH@ -$- @REAL_PROGPATH@ "$@"
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ HTML_EXTRA_FILES =
|
|||||||
HTML_COLORSTYLE_HUE = 220
|
HTML_COLORSTYLE_HUE = 220
|
||||||
HTML_COLORSTYLE_SAT = 100
|
HTML_COLORSTYLE_SAT = 100
|
||||||
HTML_COLORSTYLE_GAMMA = 80
|
HTML_COLORSTYLE_GAMMA = 80
|
||||||
HTML_TIMESTAMP = YES
|
|
||||||
HTML_DYNAMIC_MENUS = YES
|
HTML_DYNAMIC_MENUS = YES
|
||||||
HTML_DYNAMIC_SECTIONS = NO
|
HTML_DYNAMIC_SECTIONS = NO
|
||||||
HTML_INDEX_NUM_ENTRIES = 100
|
HTML_INDEX_NUM_ENTRIES = 100
|
||||||
@@ -239,7 +238,6 @@ USE_PDFLATEX = NO
|
|||||||
LATEX_BATCHMODE = NO
|
LATEX_BATCHMODE = NO
|
||||||
LATEX_HIDE_INDICES = NO
|
LATEX_HIDE_INDICES = NO
|
||||||
LATEX_BIB_STYLE = plain
|
LATEX_BIB_STYLE = plain
|
||||||
LATEX_TIMESTAMP = NO
|
|
||||||
LATEX_EMOJI_DIRECTORY =
|
LATEX_EMOJI_DIRECTORY =
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration options related to the RTF output
|
# Configuration options related to the RTF output
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ depends=('glibc')
|
|||||||
makedepends=('ed')
|
makedepends=('ed')
|
||||||
optdepends=('ed: for "patch -e" functionality')
|
optdepends=('ed: for "patch -e" functionality')
|
||||||
source=("ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig})
|
source=("ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig})
|
||||||
md5sums=('e9ae5393426d3ad783a300a338c09b72'
|
sha256sums=('9124ba46db0abd873d0995c2ca880e81252676bb6c03e0a37dfc5f608a9b0ceb'
|
||||||
'SKIP')
|
'SKIP')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "$srcdir/$pkgname-$pkgver"
|
cd "$srcdir/$pkgname-$pkgver"
|
||||||
|
|||||||
@@ -336,6 +336,13 @@ function.
|
|||||||
the optional functions listed below. The packaging stage is run using
|
the optional functions listed below. The packaging stage is run using
|
||||||
fakeroot to ensure correct file permissions in the resulting package.
|
fakeroot to ensure correct file permissions in the resulting package.
|
||||||
All other functions will be run as the user calling makepkg.
|
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*::
|
*prepare() Function*::
|
||||||
An optional `prepare()` function can be specified in which operations to
|
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 is run after the source extraction and before the `build()`
|
||||||
function. The `prepare()` function is skipped when source extraction
|
function. The `prepare()` function is skipped when source extraction
|
||||||
is skipped.
|
is skipped.
|
||||||
|
This function is run inside `$srcdir`.
|
||||||
|
|
||||||
*build() Function*::
|
*build() Function*::
|
||||||
The optional `build()` function is used to compile and/or adjust the source
|
The optional `build()` function is used to compile and/or adjust the source
|
||||||
files in preparation to be installed by the `package()` function.
|
files in preparation to be installed by the `package()` function.
|
||||||
|
This function is run inside `$srcdir`.
|
||||||
|
|
||||||
*check() Function*::
|
*check() Function*::
|
||||||
An optional `check()` function can be specified in which a package's
|
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
|
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
|
`package()` functions. Be sure any exotic commands used are covered by the
|
||||||
`checkdepends` array.
|
`checkdepends` array.
|
||||||
|
This function is run inside `$srcdir`.
|
||||||
|
|
||||||
All of the above variables such as `$pkgname` and `$pkgver` are available for
|
All of the above variables such as `$pkgname` and `$pkgver` are available for
|
||||||
use in the packaging functions. In addition, makepkg defines the following
|
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
|
This contains the directory where makepkg extracts, or copies, all source
|
||||||
files.
|
files.
|
||||||
+
|
+
|
||||||
All of the packaging functions defined above are run starting inside `$srcdir`
|
|
||||||
|
|
||||||
*pkgdir*::
|
*pkgdir*::
|
||||||
This contains the directory where makepkg bundles the installed package.
|
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
|
version control systems. For other version control systems, manual cloning of
|
||||||
upstream repositories must be done in the `prepare()` function.
|
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:
|
The source URL is divided into four components:
|
||||||
|
|
||||||
*directory*::
|
*directory*::
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ Current maintainers:
|
|||||||
|
|
||||||
* Allan McRae <allan@archlinux.org>
|
* Allan McRae <allan@archlinux.org>
|
||||||
* Andrew Gregory <andrew.gregory.8@gmail.com>
|
* Andrew Gregory <andrew.gregory.8@gmail.com>
|
||||||
* Eli Schwartz <eschwartz@archlinux.org>
|
|
||||||
* Morgan Adamiec <morganamilo@archlinux.org>
|
* Morgan Adamiec <morganamilo@archlinux.org>
|
||||||
|
|
||||||
Past major contributors:
|
Past major contributors:
|
||||||
@@ -30,6 +29,7 @@ Past major contributors:
|
|||||||
* Xavier Chantry <shiningxc@gmail.com>
|
* Xavier Chantry <shiningxc@gmail.com>
|
||||||
* Nagy Gabor <ngaba@bibl.u-szeged.hu>
|
* Nagy Gabor <ngaba@bibl.u-szeged.hu>
|
||||||
* Dave Reisner <dreisner@archlinux.org>
|
* Dave Reisner <dreisner@archlinux.org>
|
||||||
|
* Eli Schwartz <eschwartz@archlinux.org>
|
||||||
|
|
||||||
For additional contributors, use `git shortlog -s` on the pacman.git
|
For additional contributors, use `git shortlog -s` on the pacman.git
|
||||||
repository.
|
repository.
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ Example PKGBUILD
|
|||||||
license=('PerlArtistic' 'GPL')
|
license=('PerlArtistic' 'GPL')
|
||||||
depends=('perl')
|
depends=('perl')
|
||||||
source=("http://search.cpan.org/CPAN/authors/id/S/SH/SHERZODR/Config-Simple-${pkgver}.tar.gz")
|
source=("http://search.cpan.org/CPAN/authors/id/S/SH/SHERZODR/Config-Simple-${pkgver}.tar.gz")
|
||||||
md5sums=('f014aec54f0a1e2e880d317180fce502')
|
sha256sums=('dd9995706f0f9384a15ccffe116c3b6e22f42ba2e58d8f24ed03c4a0e386edb4')
|
||||||
_distname="Config-Simple"
|
_distname="Config-Simple"
|
||||||
|
|
||||||
# template start; name=perl-module; version=1.0;
|
# template start; name=perl-module; version=1.0;
|
||||||
|
|||||||
@@ -146,6 +146,9 @@ Options
|
|||||||
*-C, \--cleanbuild*::
|
*-C, \--cleanbuild*::
|
||||||
Remove the $srcdir before building the package.
|
Remove the $srcdir before building the package.
|
||||||
|
|
||||||
|
*-D* <dir>, *\--dir* <dir> ::
|
||||||
|
Change to directory <dir> before reading the PKGBUILD or doing anything else.
|
||||||
|
|
||||||
*\--allsource*::
|
*\--allsource*::
|
||||||
Do not actually build the package, but build a source-only tarball that
|
Do not actually build the package, but build a source-only tarball that
|
||||||
includes all sources, including those that are normally downloaded via
|
includes all sources, including those that are normally downloaded via
|
||||||
@@ -168,6 +171,9 @@ Options
|
|||||||
*\--noprepare*::
|
*\--noprepare*::
|
||||||
Do not run the prepare() function in the PKGBUILD.
|
Do not run the prepare() function in the PKGBUILD.
|
||||||
|
|
||||||
|
*\--noverify*::
|
||||||
|
Do not run the verify() function in the PKGBUILD.
|
||||||
|
|
||||||
*\--sign*::
|
*\--sign*::
|
||||||
Sign the resulting package with gpg, overriding the setting in
|
Sign the resulting package with gpg, overriding the setting in
|
||||||
linkman:makepkg.conf[5].
|
linkman:makepkg.conf[5].
|
||||||
@@ -227,6 +233,9 @@ before building.
|
|||||||
|
|
||||||
Environment Variables
|
Environment Variables
|
||||||
---------------------
|
---------------------
|
||||||
|
**MAKEPKG_LIBRARY**="/path/to/directory"::
|
||||||
|
Use an alternative libmakepkg path instead of the {libmakepkgdir} default.
|
||||||
|
|
||||||
**PACMAN**::
|
**PACMAN**::
|
||||||
The command that will be used to check for missing dependencies and to
|
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'
|
install and remove packages. Pacman's '-Qq', '-Rns', '-S', '-T', and '-U'
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ Options
|
|||||||
flags specified in LTOFLAGS to CFLAGS, CXXFLAGS and LDFLAGS (or
|
flags specified in LTOFLAGS to CFLAGS, CXXFLAGS and LDFLAGS (or
|
||||||
``-flto'' if LTOFLAGS is empty).
|
``-flto'' if LTOFLAGS is empty).
|
||||||
|
|
||||||
*autodep*;;
|
*autodeps*;;
|
||||||
Enable the automatic addition of libraries to the depends and
|
Enable the automatic addition of libraries to the depends and
|
||||||
provides arrays. Search library directories are controlled by
|
provides arrays. Search library directories are controlled by
|
||||||
the LIB_DIRS variable defined below.
|
the LIB_DIRS variable defined below.
|
||||||
@@ -236,7 +236,7 @@ Options
|
|||||||
|
|
||||||
**LIB_DIRS=(**lib:usr/lib ...**)**::
|
**LIB_DIRS=(**lib:usr/lib ...**)**::
|
||||||
If `autodeps` is specified in the `OPTIONS` array, this variable will
|
If `autodeps` is specified in the `OPTIONS` array, this variable will
|
||||||
instruct makepkg where to look to find librarys to add to the `provides`
|
instruct makepkg where to look to find libraries to add to the `provides`
|
||||||
array. The format is "prefix:path", where provides will be added for
|
array. The format is "prefix:path", where provides will be added for
|
||||||
libraries found in "path" with the specified prefix added.
|
libraries found in "path" with the specified prefix added.
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ asciidoc_opts = [
|
|||||||
'-a', 'sysconfdir=@0@'.format(SYSCONFDIR),
|
'-a', 'sysconfdir=@0@'.format(SYSCONFDIR),
|
||||||
'-a', 'datarootdir=@0@'.format(DATAROOTDIR),
|
'-a', 'datarootdir=@0@'.format(DATAROOTDIR),
|
||||||
'-a', 'rootdir=@0@'.format(ROOTDIR),
|
'-a', 'rootdir=@0@'.format(ROOTDIR),
|
||||||
|
'-a', 'libmakepkgdir=@0@'.format(LIBMAKEPKGDIR),
|
||||||
]
|
]
|
||||||
|
|
||||||
html_targets = []
|
html_targets = []
|
||||||
|
|||||||
@@ -237,10 +237,12 @@ Transaction Options (apply to '-S', '-R' and '-U')
|
|||||||
Specify a printf-like format to control the output of the '\--print'
|
Specify a printf-like format to control the output of the '\--print'
|
||||||
operation. The possible attributes are: "%a" for arch, "%b" for
|
operation. The possible attributes are: "%a" for arch, "%b" for
|
||||||
builddate, "%d" for description, "%e" for pkgbase, "%f" for filename,
|
builddate, "%d" for description, "%e" for pkgbase, "%f" for filename,
|
||||||
"%g" for base64 encoded PGP signature, "%h" for sha256sum, "%n" for
|
"%g" for base64 encoded PGP signature, "%h" for sha256sum, "%m" for
|
||||||
pkgname, "%p" for packager, "%v" for pkgver, "%l" for location, "%r"
|
md5sum, "%n" for pkgname, "%p" for packager, "%v" for pkgver, "%l" for
|
||||||
for repository, "%s" for size, "%C" for checkdepends, "%D" for depends
|
location, "%r" for repository, "%s" for size, "%C" for checkdepends,
|
||||||
and "%M" for makedepends.
|
"%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'.
|
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.
|
system upgrade and install/upgrade the "foo" package in the same operation.
|
||||||
|
|
||||||
*-y, \--refresh*::
|
*-y, \--refresh*::
|
||||||
Download a fresh copy of the master package database from the server(s)
|
Download a fresh copy of the master package databases '(repo.db)' from the
|
||||||
defined in linkman:pacman.conf[5]. This should typically be used each time
|
server(s) defined in linkman:pacman.conf[5]. This should typically be used
|
||||||
you use '\--sysupgrade' or '-u'. Passing two '\--refresh' or '-y' flags
|
each time you use '\--sysupgrade' or '-u'. Passing two '\--refresh' or '-y'
|
||||||
will force a refresh of all package databases, even if they appear to be
|
flags will force a refresh of all package databases, even if they appear to
|
||||||
up-to-date.
|
be up-to-date.
|
||||||
|
|
||||||
|
|
||||||
Database Options (apply to '-D')[[QO]]
|
Database Options (apply to '-D')[[QO]]
|
||||||
@@ -487,8 +489,8 @@ Database Options (apply to '-D')[[QO]]
|
|||||||
File Options (apply to '-F')[[FO]]
|
File Options (apply to '-F')[[FO]]
|
||||||
----------------------------------
|
----------------------------------
|
||||||
*-y, --refresh*::
|
*-y, --refresh*::
|
||||||
Download fresh package databases from the server. Use twice to force a
|
Download fresh package file databases '(repo.files)' from the server.
|
||||||
refresh even if databases are up to date.
|
Use twice to force a refresh even if databases are up to date.
|
||||||
|
|
||||||
*-l, \--list*::
|
*-l, \--list*::
|
||||||
List the files owned by the queried package.
|
List the files owned by the queried package.
|
||||||
|
|||||||
@@ -240,6 +240,12 @@ number.
|
|||||||
general configuration options. Wildcards in the specified paths will get
|
general configuration options. Wildcards in the specified paths will get
|
||||||
expanded based on linkman:glob[7] rules.
|
expanded based on linkman:glob[7] rules.
|
||||||
|
|
||||||
|
*CacheServer =* url::
|
||||||
|
A full URL to a location where the packages, and signatures (if
|
||||||
|
available) for this repository can be found. Cache servers will be tried
|
||||||
|
before any non-cache servers, will not be removed from the server pool for
|
||||||
|
404 download errors, and will not be used for database files.
|
||||||
|
|
||||||
*Server =* url::
|
*Server =* url::
|
||||||
A full URL to a location where the database, packages, and signatures (if
|
A full URL to a location where the database, packages, and signatures (if
|
||||||
available) for this repository can be found.
|
available) for this repository can be found.
|
||||||
|
|||||||
11
etc/makepkg.conf.d/rust.conf.in
Normal file
11
etc/makepkg.conf.d/rust.conf.in
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/hint/bash
|
||||||
|
#
|
||||||
|
# @sysconfdir@/makepkg.conf.d/rust.conf
|
||||||
|
#
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
# RUST LANGUAGE SUPPORT
|
||||||
|
#########################################################################
|
||||||
|
#
|
||||||
|
#RUSTFLAGS="-C opt-level=2"
|
||||||
|
#DEBUG_RUSTFLAGS="-C debuginfo=2"
|
||||||
@@ -23,7 +23,7 @@ DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
|
|||||||
|
|
||||||
#-- The package required by makepkg to download VCS sources
|
#-- The package required by makepkg to download VCS sources
|
||||||
# Format: 'protocol::package'
|
# Format: 'protocol::package'
|
||||||
VCSCLIENTS=('bzr::bzr'
|
VCSCLIENTS=('bzr::breezy'
|
||||||
'fossil::fossil'
|
'fossil::fossil'
|
||||||
'git::git'
|
'git::git'
|
||||||
'hg::mercurial'
|
'hg::mercurial'
|
||||||
@@ -42,13 +42,11 @@ CHOST="@CHOST@"
|
|||||||
#CXXFLAGS="-O2 -pipe"
|
#CXXFLAGS="-O2 -pipe"
|
||||||
#LDFLAGS=""
|
#LDFLAGS=""
|
||||||
#LTOFLAGS="-flto"
|
#LTOFLAGS="-flto"
|
||||||
#RUSTFLAGS="-C opt-level=2"
|
|
||||||
#-- Make Flags: change this for DistCC/SMP systems
|
#-- Make Flags: change this for DistCC/SMP systems
|
||||||
#MAKEFLAGS="-j2"
|
#MAKEFLAGS="-j2"
|
||||||
#-- Debugging flags
|
#-- Debugging flags
|
||||||
#DEBUG_CFLAGS="-g"
|
#DEBUG_CFLAGS="-g"
|
||||||
#DEBUG_CXXFLAGS="-g"
|
#DEBUG_CXXFLAGS="-g"
|
||||||
#DEBUG_RUSTFLAGS="-C debuginfo=2"
|
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# BUILD ENVIRONMENT
|
# BUILD ENVIRONMENT
|
||||||
@@ -111,7 +109,7 @@ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
|
|||||||
#-- Directory to store source code in for debug packages
|
#-- Directory to store source code in for debug packages
|
||||||
DBGSRCDIR="/usr/src/debug"
|
DBGSRCDIR="/usr/src/debug"
|
||||||
#-- Prefix and directories for library autodeps
|
#-- Prefix and directories for library autodeps
|
||||||
LIB_DIRS=('lib:/usr/lib' 'lib32:/usr/lib32')
|
LIB_DIRS=('lib:usr/lib' 'lib32:usr/lib32')
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# PACKAGE OUTPUT
|
# PACKAGE OUTPUT
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
|
|||||||
"filesystem: %o package: %o\n"), filename, lsbuf.st_mode & mask,
|
"filesystem: %o package: %o\n"), filename, lsbuf.st_mode & mask,
|
||||||
entrymode & mask);
|
entrymode & mask);
|
||||||
alpm_logaction(handle, ALPM_CALLER_PREFIX,
|
alpm_logaction(handle, ALPM_CALLER_PREFIX,
|
||||||
"warning: directory permissions differ on %s\n"
|
"warning: directory permissions differ on %s, "
|
||||||
"filesystem: %o package: %o\n", filename, lsbuf.st_mode & mask,
|
"filesystem: %o package: %o\n", filename, lsbuf.st_mode & mask,
|
||||||
entrymode & mask);
|
entrymode & mask);
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
|
|||||||
"filesystem: %u:%u package: %u:%u\n"), filename,
|
"filesystem: %u:%u package: %u:%u\n"), filename,
|
||||||
lsbuf.st_uid, lsbuf.st_gid, entryuid, entrygid);
|
lsbuf.st_uid, lsbuf.st_gid, entryuid, entrygid);
|
||||||
alpm_logaction(handle, ALPM_CALLER_PREFIX,
|
alpm_logaction(handle, ALPM_CALLER_PREFIX,
|
||||||
"warning: directory ownership differs on %s\n"
|
"warning: directory ownership differs on %s, "
|
||||||
"filesystem: %u:%u package: %u:%u\n", filename,
|
"filesystem: %u:%u package: %u:%u\n", filename,
|
||||||
lsbuf.st_uid, lsbuf.st_gid, entryuid, entrygid);
|
lsbuf.st_uid, lsbuf.st_gid, entryuid, entrygid);
|
||||||
}
|
}
|
||||||
@@ -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,
|
static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
|
||||||
size_t pkg_current, size_t pkg_count)
|
size_t pkg_current, size_t pkg_count)
|
||||||
{
|
{
|
||||||
int i, ret = 0, errors = 0;
|
int ret = 0, errors = 0;
|
||||||
int is_upgrade = 0;
|
int is_upgrade = 0;
|
||||||
alpm_pkg_t *oldpkg = NULL;
|
alpm_pkg_t *oldpkg = NULL;
|
||||||
alpm_db_t *db = handle->db_local;
|
alpm_db_t *db = handle->db_local;
|
||||||
@@ -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 */
|
/* call PROGRESS once with 0 percent, as we sort-of skip that here */
|
||||||
PROGRESS(handle, progress, newpkg->name, 0, pkg_count, pkg_current);
|
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;
|
int percent;
|
||||||
|
|
||||||
if(newpkg->size != 0) {
|
if(newpkg->size != 0) {
|
||||||
|
|||||||
@@ -93,34 +93,16 @@ cleanup:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check current state and free all resources including storage locks */
|
||||||
int SYMEXPORT alpm_release(alpm_handle_t *myhandle)
|
int SYMEXPORT alpm_release(alpm_handle_t *myhandle)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
alpm_db_t *db;
|
|
||||||
|
|
||||||
CHECK_HANDLE(myhandle, return -1);
|
CHECK_HANDLE(myhandle, return -1);
|
||||||
|
ASSERT(myhandle->trans == NULL, RET_ERR(myhandle, ALPM_ERR_TRANS_NOT_NULL, -1));
|
||||||
/* close local database */
|
|
||||||
db = myhandle->db_local;
|
|
||||||
if(db) {
|
|
||||||
db->ops->unregister(db);
|
|
||||||
myhandle->db_local = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(alpm_unregister_all_syncdbs(myhandle) == -1) {
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBCURL
|
|
||||||
curl_multi_cleanup(myhandle->curlm);
|
|
||||||
curl_global_cleanup();
|
|
||||||
FREELIST(myhandle->server_errors);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_alpm_handle_unlock(myhandle);
|
_alpm_handle_unlock(myhandle);
|
||||||
_alpm_handle_free(myhandle);
|
_alpm_handle_free(myhandle);
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char SYMEXPORT *alpm_version(void)
|
const char SYMEXPORT *alpm_version(void)
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ typedef struct _alpm_siglist_t {
|
|||||||
* Check the PGP signature for the given package file.
|
* Check the PGP signature for the given package file.
|
||||||
* @param pkg the package to check
|
* @param pkg the package to check
|
||||||
* @param siglist a pointer to storage for signature results
|
* @param siglist a pointer to storage for signature results
|
||||||
* @return a int value : 0 (valid), 1 (invalid), -1 (an error occurred)
|
* @return 0 if valid, -1 if an error occurred or signature is invalid
|
||||||
*/
|
*/
|
||||||
int alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg, alpm_siglist_t *siglist);
|
int alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg, alpm_siglist_t *siglist);
|
||||||
|
|
||||||
@@ -496,7 +496,7 @@ int alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg, alpm_siglist_t *siglist);
|
|||||||
* Check the PGP signature for the given database.
|
* Check the PGP signature for the given database.
|
||||||
* @param db the database to check
|
* @param db the database to check
|
||||||
* @param siglist a pointer to storage for signature results
|
* @param siglist a pointer to storage for signature results
|
||||||
* @return a int value : 0 (valid), 1 (invalid), -1 (an error occurred)
|
* @return 0 if valid, -1 if an error occurred or signature is invalid
|
||||||
*/
|
*/
|
||||||
int alpm_db_check_pgp_signature(alpm_db_t *db, alpm_siglist_t *siglist);
|
int alpm_db_check_pgp_signature(alpm_db_t *db, alpm_siglist_t *siglist);
|
||||||
|
|
||||||
@@ -600,16 +600,10 @@ typedef struct _alpm_depmissing_t {
|
|||||||
|
|
||||||
/** A conflict that has occurred between two packages. */
|
/** A conflict that has occurred between two packages. */
|
||||||
typedef struct _alpm_conflict_t {
|
typedef struct _alpm_conflict_t {
|
||||||
/** Hash of the first package name
|
/** The first package */
|
||||||
* (used internally to speed up conflict checks) */
|
alpm_pkg_t *package1;
|
||||||
unsigned long package1_hash;
|
/** The second package */
|
||||||
/** Hash of the second package name
|
alpm_pkg_t *package2;
|
||||||
* (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 conflict */
|
/** The conflict */
|
||||||
alpm_depend_t *reason;
|
alpm_depend_t *reason;
|
||||||
} alpm_conflict_t;
|
} alpm_conflict_t;
|
||||||
@@ -1155,7 +1149,9 @@ typedef enum _alpm_progress_t {
|
|||||||
* make take a while to complete.
|
* make take a while to complete.
|
||||||
* @param ctx user-provided context
|
* @param ctx user-provided context
|
||||||
* @param progress the kind of event that is progressing
|
* @param progress the kind of event that is progressing
|
||||||
* @param pkg for package operations, the name of the package being operated on
|
* @param pkg the name of the package being operated on. if the progress kind
|
||||||
|
* is a packae operation (add, upgrade, downgrade, reinstall, remove).
|
||||||
|
* otherwise this will be an empty string.
|
||||||
* @param percent the percent completion of the action
|
* @param percent the percent completion of the action
|
||||||
* @param howmany the total amount of items in the action
|
* @param howmany the total amount of items in the action
|
||||||
* @param current the current amount of items completed
|
* @param current the current amount of items completed
|
||||||
@@ -1349,6 +1345,34 @@ int alpm_db_add_server(alpm_db_t *db, const char *url);
|
|||||||
*/
|
*/
|
||||||
int alpm_db_remove_server(alpm_db_t *db, const char *url);
|
int alpm_db_remove_server(alpm_db_t *db, const char *url);
|
||||||
|
|
||||||
|
/** Get the list of cache servers assigned to this db.
|
||||||
|
* @param db pointer to the database to get the servers from
|
||||||
|
* @return a char* list of servers
|
||||||
|
*/
|
||||||
|
alpm_list_t *alpm_db_get_cache_servers(const alpm_db_t *db);
|
||||||
|
|
||||||
|
/** Sets the list of cache servers for the database to use.
|
||||||
|
* @param db the database to set the servers. The list will be duped and
|
||||||
|
* the original will still need to be freed by the caller.
|
||||||
|
* @param servers a char* list of servers.
|
||||||
|
*/
|
||||||
|
int alpm_db_set_cache_servers(alpm_db_t *db, alpm_list_t *servers);
|
||||||
|
|
||||||
|
/** Add a download cache server to a database.
|
||||||
|
* @param db database pointer
|
||||||
|
* @param url url of the server
|
||||||
|
* @return 0 on success, -1 on error (pm_errno is set accordingly)
|
||||||
|
*/
|
||||||
|
int alpm_db_add_cache_server(alpm_db_t *db, const char *url);
|
||||||
|
|
||||||
|
/** Remove a download cache server from a database.
|
||||||
|
* @param db database pointer
|
||||||
|
* @param url url of the server
|
||||||
|
* @return 0 on success, 1 on server not present,
|
||||||
|
* -1 on error (pm_errno is set accordingly)
|
||||||
|
*/
|
||||||
|
int alpm_db_remove_cache_server(alpm_db_t *db, const char *url);
|
||||||
|
|
||||||
/* End of server accessors */
|
/* End of server accessors */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
@@ -2271,7 +2295,9 @@ typedef enum _alpm_pkgreason_t {
|
|||||||
/** Explicitly requested by the user. */
|
/** Explicitly requested by the user. */
|
||||||
ALPM_PKG_REASON_EXPLICIT = 0,
|
ALPM_PKG_REASON_EXPLICIT = 0,
|
||||||
/** Installed as a dependency for another package. */
|
/** Installed as a dependency for another package. */
|
||||||
ALPM_PKG_REASON_DEPEND = 1
|
ALPM_PKG_REASON_DEPEND = 1,
|
||||||
|
/** Failed parsing of local database */
|
||||||
|
ALPM_PKG_REASON_UNKNOWN = 2
|
||||||
} alpm_pkgreason_t;
|
} alpm_pkgreason_t;
|
||||||
|
|
||||||
/** Location a package object was loaded from. */
|
/** Location a package object was loaded from. */
|
||||||
@@ -2913,9 +2939,6 @@ int alpm_capabilities(void);
|
|||||||
/* End of libalpm_api */
|
/* End of libalpm_api */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
size_t alpm_info_print_pkg(const char *format, alpm_pkg_t *pkg);
|
|
||||||
size_t alpm_info_print_pkgs(const char *format, alpm_list_t *pkgs);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ alpm_list_t SYMEXPORT *alpm_list_reverse(alpm_list_t *list)
|
|||||||
while(lp) {
|
while(lp) {
|
||||||
if(alpm_list_append(&newlist, lp->data) == NULL) {
|
if(alpm_list_append(&newlist, lp->data) == NULL) {
|
||||||
alpm_list_free(newlist);
|
alpm_list_free(newlist);
|
||||||
|
list->prev = backup;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
lp = lp->prev;
|
lp = lp->prev;
|
||||||
|
|||||||
@@ -250,7 +250,6 @@ static int _cache_changelog_close(const alpm_pkg_t UNUSED *pkg, void *fp)
|
|||||||
*/
|
*/
|
||||||
static struct archive *_cache_mtree_open(alpm_pkg_t *pkg)
|
static struct archive *_cache_mtree_open(alpm_pkg_t *pkg)
|
||||||
{
|
{
|
||||||
int r;
|
|
||||||
struct archive *mtree;
|
struct archive *mtree;
|
||||||
|
|
||||||
alpm_db_t *db = alpm_pkg_get_db(pkg);
|
alpm_db_t *db = alpm_pkg_get_db(pkg);
|
||||||
@@ -268,7 +267,7 @@ static struct archive *_cache_mtree_open(alpm_pkg_t *pkg)
|
|||||||
_alpm_archive_read_support_filter_all(mtree);
|
_alpm_archive_read_support_filter_all(mtree);
|
||||||
archive_read_support_format_mtree(mtree);
|
archive_read_support_format_mtree(mtree);
|
||||||
|
|
||||||
if((r = _alpm_archive_read_open_file(mtree, mtfile, ALPM_BUFFER_SIZE))) {
|
if(_alpm_archive_read_open_file(mtree, mtfile, ALPM_BUFFER_SIZE)) {
|
||||||
_alpm_log(pkg->handle, ALPM_LOG_ERROR, _("error while reading file %s: %s\n"),
|
_alpm_log(pkg->handle, ALPM_LOG_ERROR, _("error while reading file %s: %s\n"),
|
||||||
mtfile, archive_error_string(mtree));
|
mtfile, archive_error_string(mtree));
|
||||||
_alpm_archive_read_free(mtree);
|
_alpm_archive_read_free(mtree);
|
||||||
@@ -631,6 +630,10 @@ static int local_db_populate(alpm_db_t *db)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* treat local metadata errors as warning-only,
|
||||||
|
* they are already installed and otherwise they can't be operated on */
|
||||||
|
_alpm_pkg_check_meta(pkg);
|
||||||
|
|
||||||
/* add to the collection */
|
/* add to the collection */
|
||||||
_alpm_log(db->handle, ALPM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
|
_alpm_log(db->handle, ALPM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
|
||||||
pkg->name, db->treename);
|
pkg->name, db->treename);
|
||||||
@@ -651,6 +654,17 @@ static int local_db_populate(alpm_db_t *db)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static alpm_pkgreason_t _read_pkgreason(alpm_handle_t *handle, const char *pkgname, const char *line) {
|
||||||
|
if(strcmp(line, "0") == 0) {
|
||||||
|
return ALPM_PKG_REASON_EXPLICIT;
|
||||||
|
} else if(strcmp(line, "1") == 0) {
|
||||||
|
return ALPM_PKG_REASON_DEPEND;
|
||||||
|
} else {
|
||||||
|
_alpm_log(handle, ALPM_LOG_ERROR, _("unknown install reason for package %s: %s\n"), pkgname, line);
|
||||||
|
return ALPM_PKG_REASON_UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Note: the return value must be freed by the caller */
|
/* Note: the return value must be freed by the caller */
|
||||||
char *_alpm_local_db_pkgpath(alpm_db_t *db, alpm_pkg_t *info,
|
char *_alpm_local_db_pkgpath(alpm_db_t *db, alpm_pkg_t *info,
|
||||||
const char *filename)
|
const char *filename)
|
||||||
@@ -773,7 +787,7 @@ static int local_db_read(alpm_pkg_t *info, int inforeq)
|
|||||||
READ_AND_STORE(info->packager);
|
READ_AND_STORE(info->packager);
|
||||||
} else if(strcmp(line, "%REASON%") == 0) {
|
} else if(strcmp(line, "%REASON%") == 0) {
|
||||||
READ_NEXT();
|
READ_NEXT();
|
||||||
info->reason = (alpm_pkgreason_t)atoi(line);
|
info->reason = _read_pkgreason(db->handle, info->name, line);
|
||||||
} else if(strcmp(line, "%VALIDATION%") == 0) {
|
} else if(strcmp(line, "%VALIDATION%") == 0) {
|
||||||
alpm_list_t *i, *v = NULL;
|
alpm_list_t *i, *v = NULL;
|
||||||
READ_AND_STORE_ALL(v);
|
READ_AND_STORE_ALL(v);
|
||||||
@@ -823,6 +837,12 @@ static int local_db_read(alpm_pkg_t *info, int inforeq)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREELIST(lines);
|
FREELIST(lines);
|
||||||
|
} else {
|
||||||
|
_alpm_log(db->handle, ALPM_LOG_ERROR, _("%s: unknown key '%s' in sync database\n"), info->name, line);
|
||||||
|
alpm_list_t *lines = NULL;
|
||||||
|
READ_AND_STORE_ALL(lines);
|
||||||
|
FREELIST(lines);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|||||||
@@ -251,8 +251,10 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t *
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
const char *pkgname = newpkg->name ? newpkg->name : "error";
|
||||||
|
_alpm_log(handle, ALPM_LOG_ERROR, _("%s: unknown key '%s' in package description\n"), pkgname, key);
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "%s: unknown key '%s' in description file line %d\n",
|
_alpm_log(handle, ALPM_LOG_DEBUG, "%s: unknown key '%s' in description file line %d\n",
|
||||||
newpkg->name ? newpkg->name : "error", key, linenum);
|
pkgname, key, linenum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -652,8 +654,6 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
|
|||||||
goto pkg_invalid;
|
goto pkg_invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
_alpm_archive_read_free(archive);
|
|
||||||
|
|
||||||
/* internal fields for package struct */
|
/* internal fields for package struct */
|
||||||
newpkg->origin = ALPM_PKG_FROM_FILE;
|
newpkg->origin = ALPM_PKG_FROM_FILE;
|
||||||
STRDUP(newpkg->origin_data.file, pkgfile, goto error);
|
STRDUP(newpkg->origin_data.file, pkgfile, goto error);
|
||||||
@@ -675,6 +675,11 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
|
|||||||
newpkg->infolevel |= INFRQ_FILES;
|
newpkg->infolevel |= INFRQ_FILES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_alpm_pkg_check_meta(newpkg) != 0) {
|
||||||
|
goto pkg_invalid;
|
||||||
|
}
|
||||||
|
|
||||||
|
_alpm_archive_read_free(archive);
|
||||||
close(fd);
|
close(fd);
|
||||||
return newpkg;
|
return newpkg;
|
||||||
|
|
||||||
@@ -683,9 +688,7 @@ pkg_invalid:
|
|||||||
error:
|
error:
|
||||||
_alpm_pkg_free(newpkg);
|
_alpm_pkg_free(newpkg);
|
||||||
_alpm_archive_read_free(archive);
|
_alpm_archive_read_free(archive);
|
||||||
if(fd >= 0) {
|
close(fd);
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,6 +344,11 @@ static alpm_pkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname,
|
|||||||
pkg->ops = get_sync_pkg_ops();
|
pkg->ops = get_sync_pkg_ops();
|
||||||
pkg->handle = db->handle;
|
pkg->handle = db->handle;
|
||||||
|
|
||||||
|
if(_alpm_pkg_check_meta(pkg) != 0) {
|
||||||
|
_alpm_pkg_free(pkg);
|
||||||
|
RET_ERR(db->handle, ALPM_ERR_PKG_INVALID, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/* add to the collection */
|
/* add to the collection */
|
||||||
_alpm_log(db->handle, ALPM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
|
_alpm_log(db->handle, ALPM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
|
||||||
pkg->name, db->treename);
|
pkg->name, db->treename);
|
||||||
@@ -452,6 +457,14 @@ static int sync_db_populate(alpm_db_t *db)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* the db file was successfully read, but contained errors */
|
||||||
|
if(ret == -1) {
|
||||||
|
db->status &= ~DB_STATUS_VALID;
|
||||||
|
db->status |= DB_STATUS_INVALID;
|
||||||
|
_alpm_db_free_pkgcache(db);
|
||||||
|
GOTO_ERR(db->handle, ALPM_ERR_DB_INVALID, cleanup);
|
||||||
|
}
|
||||||
|
/* reading the db file failed */
|
||||||
if(archive_ret != ARCHIVE_EOF) {
|
if(archive_ret != ARCHIVE_EOF) {
|
||||||
_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not read db '%s' (%s)\n"),
|
_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not read db '%s' (%s)\n"),
|
||||||
db->treename, archive_error_string(archive));
|
db->treename, archive_error_string(archive));
|
||||||
@@ -678,6 +691,11 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREELIST(lines);
|
FREELIST(lines);
|
||||||
|
} else {
|
||||||
|
_alpm_log(db->handle, ALPM_LOG_ERROR, _("%s: unknown key '%s' in local database\n"), pkg->name, line);
|
||||||
|
alpm_list_t *lines = NULL;
|
||||||
|
READ_AND_STORE_ALL(lines);
|
||||||
|
FREELIST(lines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ret != ARCHIVE_EOF) {
|
if(ret != ARCHIVE_EOF) {
|
||||||
|
|||||||
@@ -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);
|
CALLOC(conflict, 1, sizeof(alpm_conflict_t), return NULL);
|
||||||
|
|
||||||
conflict->package1_hash = pkg1->name_hash;
|
ASSERT(_alpm_pkg_dup(pkg1, &conflict->package1) == 0, goto error);
|
||||||
conflict->package2_hash = pkg2->name_hash;
|
ASSERT(_alpm_pkg_dup(pkg2, &conflict->package2) == 0, goto error);
|
||||||
STRDUP(conflict->package1, pkg1->name, goto error);
|
|
||||||
STRDUP(conflict->package2, pkg2->name, goto error);
|
|
||||||
conflict->reason = reason;
|
conflict->reason = reason;
|
||||||
|
|
||||||
return conflict;
|
return conflict;
|
||||||
@@ -66,8 +64,9 @@ error:
|
|||||||
void SYMEXPORT alpm_conflict_free(alpm_conflict_t *conflict)
|
void SYMEXPORT alpm_conflict_free(alpm_conflict_t *conflict)
|
||||||
{
|
{
|
||||||
ASSERT(conflict != NULL, return);
|
ASSERT(conflict != NULL, return);
|
||||||
FREE(conflict->package2);
|
_alpm_pkg_free(conflict->package1);
|
||||||
FREE(conflict->package1);
|
_alpm_pkg_free(conflict->package2);
|
||||||
|
|
||||||
FREE(conflict);
|
FREE(conflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,10 +78,8 @@ alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict)
|
|||||||
alpm_conflict_t *newconflict;
|
alpm_conflict_t *newconflict;
|
||||||
CALLOC(newconflict, 1, sizeof(alpm_conflict_t), return NULL);
|
CALLOC(newconflict, 1, sizeof(alpm_conflict_t), return NULL);
|
||||||
|
|
||||||
newconflict->package1_hash = conflict->package1_hash;
|
ASSERT(_alpm_pkg_dup(conflict->package1, &newconflict->package1) == 0, goto error);
|
||||||
newconflict->package2_hash = conflict->package2_hash;
|
ASSERT(_alpm_pkg_dup(conflict->package2, &newconflict->package2) == 0, goto error);
|
||||||
STRDUP(newconflict->package1, conflict->package1, goto error);
|
|
||||||
STRDUP(newconflict->package2, conflict->package2, goto error);
|
|
||||||
newconflict->reason = conflict->reason;
|
newconflict->reason = conflict->reason;
|
||||||
|
|
||||||
return newconflict;
|
return newconflict;
|
||||||
@@ -105,10 +102,10 @@ static int conflict_isin(alpm_conflict_t *needle, alpm_list_t *haystack)
|
|||||||
alpm_list_t *i;
|
alpm_list_t *i;
|
||||||
for(i = haystack; i; i = i->next) {
|
for(i = haystack; i; i = i->next) {
|
||||||
alpm_conflict_t *conflict = i->data;
|
alpm_conflict_t *conflict = i->data;
|
||||||
if(needle->package1_hash == conflict->package1_hash
|
if(needle->package1->name_hash == conflict->package1->name_hash
|
||||||
&& needle->package2_hash == conflict->package2_hash
|
&& needle->package2->name_hash == conflict->package2->name_hash
|
||||||
&& strcmp(needle->package1, conflict->package1) == 0
|
&& strcmp(needle->package1->name, conflict->package1->name) == 0
|
||||||
&& strcmp(needle->package2, conflict->package2) == 0) {
|
&& strcmp(needle->package2->name, conflict->package2->name) == 0) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,6 +131,26 @@ int SYMEXPORT alpm_db_unregister(alpm_db_t *db)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alpm_list_t SYMEXPORT *alpm_db_get_cache_servers(const alpm_db_t *db)
|
||||||
|
{
|
||||||
|
ASSERT(db != NULL, return NULL);
|
||||||
|
return db->cache_servers;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SYMEXPORT alpm_db_set_cache_servers(alpm_db_t *db, alpm_list_t *cache_servers)
|
||||||
|
{
|
||||||
|
alpm_list_t *i;
|
||||||
|
ASSERT(db != NULL, return -1);
|
||||||
|
FREELIST(db->cache_servers);
|
||||||
|
for(i = cache_servers; i; i = i->next) {
|
||||||
|
char *url = i->data;
|
||||||
|
if(alpm_db_add_cache_server(db, url) != 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
alpm_list_t SYMEXPORT *alpm_db_get_servers(const alpm_db_t *db)
|
alpm_list_t SYMEXPORT *alpm_db_get_servers(const alpm_db_t *db)
|
||||||
{
|
{
|
||||||
ASSERT(db != NULL, return NULL);
|
ASSERT(db != NULL, return NULL);
|
||||||
@@ -164,6 +184,25 @@ static char *sanitize_url(const char *url)
|
|||||||
return newurl;
|
return newurl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SYMEXPORT alpm_db_add_cache_server(alpm_db_t *db, const char *url)
|
||||||
|
{
|
||||||
|
char *newurl;
|
||||||
|
|
||||||
|
/* Sanity checks */
|
||||||
|
ASSERT(db != NULL, return -1);
|
||||||
|
db->handle->pm_errno = ALPM_ERR_OK;
|
||||||
|
ASSERT(url != NULL && strlen(url) != 0, RET_ERR(db->handle, ALPM_ERR_WRONG_ARGS, -1));
|
||||||
|
|
||||||
|
newurl = sanitize_url(url);
|
||||||
|
ASSERT(newurl != NULL, RET_ERR(db->handle, ALPM_ERR_MEMORY, -1));
|
||||||
|
|
||||||
|
db->cache_servers = alpm_list_add(db->cache_servers, newurl);
|
||||||
|
_alpm_log(db->handle, ALPM_LOG_DEBUG, "adding new cache server URL to database '%s': %s\n",
|
||||||
|
db->treename, newurl);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int SYMEXPORT alpm_db_add_server(alpm_db_t *db, const char *url)
|
int SYMEXPORT alpm_db_add_server(alpm_db_t *db, const char *url)
|
||||||
{
|
{
|
||||||
char *newurl;
|
char *newurl;
|
||||||
@@ -174,9 +213,8 @@ int SYMEXPORT alpm_db_add_server(alpm_db_t *db, const char *url)
|
|||||||
ASSERT(url != NULL && strlen(url) != 0, RET_ERR(db->handle, ALPM_ERR_WRONG_ARGS, -1));
|
ASSERT(url != NULL && strlen(url) != 0, RET_ERR(db->handle, ALPM_ERR_WRONG_ARGS, -1));
|
||||||
|
|
||||||
newurl = sanitize_url(url);
|
newurl = sanitize_url(url);
|
||||||
if(!newurl) {
|
ASSERT(newurl != NULL, RET_ERR(db->handle, ALPM_ERR_MEMORY, -1));
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
db->servers = alpm_list_add(db->servers, newurl);
|
db->servers = alpm_list_add(db->servers, newurl);
|
||||||
_alpm_log(db->handle, ALPM_LOG_DEBUG, "adding new server URL to database '%s': %s\n",
|
_alpm_log(db->handle, ALPM_LOG_DEBUG, "adding new server URL to database '%s': %s\n",
|
||||||
db->treename, newurl);
|
db->treename, newurl);
|
||||||
@@ -184,6 +222,32 @@ int SYMEXPORT alpm_db_add_server(alpm_db_t *db, const char *url)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SYMEXPORT alpm_db_remove_cache_server(alpm_db_t *db, const char *url)
|
||||||
|
{
|
||||||
|
char *newurl, *vdata = NULL;
|
||||||
|
int ret = 1;
|
||||||
|
|
||||||
|
/* Sanity checks */
|
||||||
|
ASSERT(db != NULL, return -1);
|
||||||
|
db->handle->pm_errno = ALPM_ERR_OK;
|
||||||
|
ASSERT(url != NULL && strlen(url) != 0, RET_ERR(db->handle, ALPM_ERR_WRONG_ARGS, -1));
|
||||||
|
|
||||||
|
newurl = sanitize_url(url);
|
||||||
|
ASSERT(newurl != NULL, RET_ERR(db->handle, ALPM_ERR_MEMORY, -1));
|
||||||
|
|
||||||
|
db->cache_servers = alpm_list_remove_str(db->cache_servers, newurl, &vdata);
|
||||||
|
|
||||||
|
if(vdata) {
|
||||||
|
_alpm_log(db->handle, ALPM_LOG_DEBUG, "removed cache server URL from database '%s': %s\n",
|
||||||
|
db->treename, newurl);
|
||||||
|
free(vdata);
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(newurl);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int SYMEXPORT alpm_db_remove_server(alpm_db_t *db, const char *url)
|
int SYMEXPORT alpm_db_remove_server(alpm_db_t *db, const char *url)
|
||||||
{
|
{
|
||||||
char *newurl, *vdata = NULL;
|
char *newurl, *vdata = NULL;
|
||||||
@@ -195,9 +259,7 @@ int SYMEXPORT alpm_db_remove_server(alpm_db_t *db, const char *url)
|
|||||||
ASSERT(url != NULL && strlen(url) != 0, RET_ERR(db->handle, ALPM_ERR_WRONG_ARGS, -1));
|
ASSERT(url != NULL && strlen(url) != 0, RET_ERR(db->handle, ALPM_ERR_WRONG_ARGS, -1));
|
||||||
|
|
||||||
newurl = sanitize_url(url);
|
newurl = sanitize_url(url);
|
||||||
if(!newurl) {
|
ASSERT(newurl != NULL, RET_ERR(db->handle, ALPM_ERR_MEMORY, -1));
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
db->servers = alpm_list_remove_str(db->servers, newurl, &vdata);
|
db->servers = alpm_list_remove_str(db->servers, newurl, &vdata);
|
||||||
|
|
||||||
@@ -328,6 +390,7 @@ void _alpm_db_free(alpm_db_t *db)
|
|||||||
/* cleanup pkgcache */
|
/* cleanup pkgcache */
|
||||||
_alpm_db_free_pkgcache(db);
|
_alpm_db_free_pkgcache(db);
|
||||||
/* cleanup server list */
|
/* cleanup server list */
|
||||||
|
FREELIST(db->cache_servers);
|
||||||
FREELIST(db->servers);
|
FREELIST(db->servers);
|
||||||
FREE(db->_path);
|
FREE(db->_path);
|
||||||
FREE(db->treename);
|
FREE(db->treename);
|
||||||
@@ -500,18 +563,17 @@ static void free_groupcache(alpm_db_t *db)
|
|||||||
|
|
||||||
void _alpm_db_free_pkgcache(alpm_db_t *db)
|
void _alpm_db_free_pkgcache(alpm_db_t *db)
|
||||||
{
|
{
|
||||||
if(db == NULL || !(db->status & DB_STATUS_PKGCACHE)) {
|
if(db == NULL || db->pkgcache == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_alpm_log(db->handle, ALPM_LOG_DEBUG,
|
_alpm_log(db->handle, ALPM_LOG_DEBUG,
|
||||||
"freeing package cache for repository '%s'\n", db->treename);
|
"freeing package cache for repository '%s'\n", db->treename);
|
||||||
|
|
||||||
if(db->pkgcache) {
|
alpm_list_free_inner(db->pkgcache->list,
|
||||||
alpm_list_free_inner(db->pkgcache->list,
|
(alpm_list_fn_free)_alpm_pkg_free);
|
||||||
(alpm_list_fn_free)_alpm_pkg_free);
|
_alpm_pkghash_free(db->pkgcache);
|
||||||
_alpm_pkghash_free(db->pkgcache);
|
db->pkgcache = NULL;
|
||||||
}
|
|
||||||
db->status &= ~DB_STATUS_PKGCACHE;
|
db->status &= ~DB_STATUS_PKGCACHE;
|
||||||
|
|
||||||
free_groupcache(db);
|
free_groupcache(db);
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ struct _alpm_db_t {
|
|||||||
char *_path;
|
char *_path;
|
||||||
alpm_pkghash_t *pkgcache;
|
alpm_pkghash_t *pkgcache;
|
||||||
alpm_list_t *grpcache;
|
alpm_list_t *grpcache;
|
||||||
|
alpm_list_t *cache_servers;
|
||||||
alpm_list_t *servers;
|
alpm_list_t *servers;
|
||||||
const struct db_operations *ops;
|
const struct db_operations *ops;
|
||||||
|
|
||||||
|
|||||||
@@ -556,7 +556,7 @@ static void _alpm_select_depends(alpm_list_t **from, alpm_list_t **to,
|
|||||||
for(i = *from; i; i = next) {
|
for(i = *from; i; i = next) {
|
||||||
alpm_pkg_t *deppkg = i->data;
|
alpm_pkg_t *deppkg = i->data;
|
||||||
next = i->next;
|
next = i->next;
|
||||||
if((explicit || alpm_pkg_get_reason(deppkg) != ALPM_PKG_REASON_EXPLICIT)
|
if((explicit || alpm_pkg_get_reason(deppkg) == ALPM_PKG_REASON_DEPEND)
|
||||||
&& _alpm_pkg_depends_on(pkg, deppkg)) {
|
&& _alpm_pkg_depends_on(pkg, deppkg)) {
|
||||||
*to = alpm_list_add(*to, deppkg);
|
*to = alpm_list_add(*to, deppkg);
|
||||||
*from = alpm_list_remove_item(*from, i);
|
*from = alpm_list_remove_item(*from, i);
|
||||||
|
|||||||
@@ -111,6 +111,10 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while((mnt = getmntent(fp))) {
|
while((mnt = getmntent(fp))) {
|
||||||
|
if(mnt->mnt_dir == NULL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
||||||
STRDUP(mp->mount_dir, mnt->mnt_dir, free(mp); RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
STRDUP(mp->mount_dir, mnt->mnt_dir, free(mp); RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
||||||
mp->mount_dir_len = strlen(mp->mount_dir);
|
mp->mount_dir_len = strlen(mp->mount_dir);
|
||||||
@@ -134,6 +138,10 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while((ret = getmntent(fp, &mnt)) == 0) {
|
while((ret = getmntent(fp, &mnt)) == 0) {
|
||||||
|
if(mnt->mnt_mountp == NULL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
||||||
STRDUP(mp->mount_dir, mnt->mnt_mountp, free(mp); RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
STRDUP(mp->mount_dir, mnt->mnt_mountp, free(mp); RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
||||||
mp->mount_dir_len = strlen(mp->mount_dir);
|
mp->mount_dir_len = strlen(mp->mount_dir);
|
||||||
@@ -161,6 +169,10 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(; entries-- > 0; fsp++) {
|
for(; entries-- > 0; fsp++) {
|
||||||
|
if(fsp->f_mntonname == NULL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
||||||
STRDUP(mp->mount_dir, fsp->f_mntonname, free(mp); RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
STRDUP(mp->mount_dir, fsp->f_mntonname, free(mp); RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
||||||
mp->mount_dir_len = strlen(mp->mount_dir);
|
mp->mount_dir_len = strlen(mp->mount_dir);
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ static int curl_gethost(const char *url, char *buffer, size_t buf_len);
|
|||||||
|
|
||||||
/* number of "soft" errors required to blacklist a server, set to 0 to disable
|
/* number of "soft" errors required to blacklist a server, set to 0 to disable
|
||||||
* server blacklisting */
|
* server blacklisting */
|
||||||
const unsigned int server_error_limit = 3;
|
const int server_error_limit = 3;
|
||||||
|
|
||||||
struct server_error_count {
|
struct server_error_count {
|
||||||
char server[HOSTNAME_SIZE];
|
char server[HOSTNAME_SIZE];
|
||||||
unsigned int errors;
|
int errors;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct server_error_count *find_server_errors(alpm_handle_t *handle, const char *server)
|
static struct server_error_count *find_server_errors(alpm_handle_t *handle, const char *server)
|
||||||
@@ -94,22 +94,34 @@ static struct server_error_count *find_server_errors(alpm_handle_t *handle, cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* skip for hard errors or too many soft errors */
|
||||||
static int should_skip_server(alpm_handle_t *handle, const char *server)
|
static int should_skip_server(alpm_handle_t *handle, const char *server)
|
||||||
{
|
{
|
||||||
struct server_error_count *h;
|
struct server_error_count *h;
|
||||||
if(server_error_limit && (h = find_server_errors(handle, server)) ) {
|
if(server_error_limit && (h = find_server_errors(handle, server)) ) {
|
||||||
return h->errors >= server_error_limit;
|
return h->errors < 0 || h->errors >= server_error_limit;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void server_increment_error(alpm_handle_t *handle, const char *server, int count)
|
/* only skip for hard errors */
|
||||||
|
static int should_skip_cache_server(alpm_handle_t *handle, const char *server)
|
||||||
|
{
|
||||||
|
struct server_error_count *h;
|
||||||
|
if(server_error_limit && (h = find_server_errors(handle, server)) ) {
|
||||||
|
return h->errors < 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* block normal servers after too many errors */
|
||||||
|
static void server_soft_error(alpm_handle_t *handle, const char *server)
|
||||||
{
|
{
|
||||||
struct server_error_count *h;
|
struct server_error_count *h;
|
||||||
if(server_error_limit
|
if(server_error_limit
|
||||||
&& (h = find_server_errors(handle, server))
|
&& (h = find_server_errors(handle, server))
|
||||||
&& !should_skip_server(handle, server) ) {
|
&& !should_skip_server(handle, server) ) {
|
||||||
h->errors += count;
|
h->errors++;
|
||||||
|
|
||||||
if(should_skip_server(handle, server)) {
|
if(should_skip_server(handle, server)) {
|
||||||
_alpm_log(handle, ALPM_LOG_WARNING,
|
_alpm_log(handle, ALPM_LOG_WARNING,
|
||||||
@@ -119,14 +131,46 @@ static void server_increment_error(alpm_handle_t *handle, const char *server, in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void server_soft_error(alpm_handle_t *handle, const char *server)
|
/* immediate block for both servers and cache servers */
|
||||||
{
|
|
||||||
server_increment_error(handle, server, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void server_hard_error(alpm_handle_t *handle, const char *server)
|
static void server_hard_error(alpm_handle_t *handle, const char *server)
|
||||||
{
|
{
|
||||||
server_increment_error(handle, server, server_error_limit);
|
struct server_error_count *h;
|
||||||
|
if(server_error_limit && (h = find_server_errors(handle, server))) {
|
||||||
|
if(h->errors != -1) {
|
||||||
|
/* always set even if already skipped for soft errors
|
||||||
|
* to disable cache servers too */
|
||||||
|
h->errors = -1;
|
||||||
|
|
||||||
|
_alpm_log(handle, ALPM_LOG_WARNING,
|
||||||
|
_("fatal error from %s, skipping for the remainder of this transaction\n"),
|
||||||
|
h->server);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *payload_next_server(struct dload_payload *payload)
|
||||||
|
{
|
||||||
|
while(payload->cache_servers
|
||||||
|
&& should_skip_cache_server(payload->handle, payload->cache_servers->data)) {
|
||||||
|
payload->cache_servers = payload->cache_servers->next;
|
||||||
|
}
|
||||||
|
if(payload->cache_servers) {
|
||||||
|
const char *server = payload->cache_servers->data;
|
||||||
|
payload->cache_servers = payload->cache_servers->next;
|
||||||
|
payload->request_errors_ok = 1;
|
||||||
|
return server;
|
||||||
|
}
|
||||||
|
while(payload->servers
|
||||||
|
&& should_skip_server(payload->handle, payload->servers->data)) {
|
||||||
|
payload->servers = payload->servers->next;
|
||||||
|
}
|
||||||
|
if(payload->servers) {
|
||||||
|
const char *server = payload->servers->data;
|
||||||
|
payload->servers = payload->servers->next;
|
||||||
|
payload->request_errors_ok = payload->errors_ok;
|
||||||
|
return server;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *get_filename(const char *url)
|
static const char *get_filename(const char *url)
|
||||||
@@ -408,21 +452,16 @@ static FILE *create_tempfile(struct dload_payload *payload, const char *localpat
|
|||||||
/* Return 0 if retry was successful, -1 otherwise */
|
/* Return 0 if retry was successful, -1 otherwise */
|
||||||
static int curl_retry_next_server(CURLM *curlm, CURL *curl, struct dload_payload *payload)
|
static int curl_retry_next_server(CURLM *curlm, CURL *curl, struct dload_payload *payload)
|
||||||
{
|
{
|
||||||
const char *server;
|
const char *server = NULL;
|
||||||
size_t len;
|
size_t len;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
alpm_handle_t *handle = payload->handle;
|
alpm_handle_t *handle = payload->handle;
|
||||||
|
|
||||||
while(payload->servers && should_skip_server(handle, payload->servers->data)) {
|
if((server = payload_next_server(payload)) == NULL) {
|
||||||
payload->servers = payload->servers->next;
|
|
||||||
}
|
|
||||||
if(!payload->servers) {
|
|
||||||
_alpm_log(payload->handle, ALPM_LOG_DEBUG,
|
_alpm_log(payload->handle, ALPM_LOG_DEBUG,
|
||||||
"%s: no more servers to retry\n", payload->remote_name);
|
"%s: no more servers to retry\n", payload->remote_name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
server = payload->servers->data;
|
|
||||||
payload->servers = payload->servers->next;
|
|
||||||
|
|
||||||
/* regenerate a new fileurl */
|
/* regenerate a new fileurl */
|
||||||
FREE(payload->fileurl);
|
FREE(payload->fileurl);
|
||||||
@@ -433,7 +472,6 @@ static int curl_retry_next_server(CURLM *curlm, CURL *curl, struct dload_payload
|
|||||||
"%s: retrying from %s\n",
|
"%s: retrying from %s\n",
|
||||||
payload->remote_name, payload->fileurl);
|
payload->remote_name, payload->fileurl);
|
||||||
|
|
||||||
|
|
||||||
fflush(payload->localf);
|
fflush(payload->localf);
|
||||||
|
|
||||||
if(payload->allow_resume && stat(payload->tempfile_name, &st) == 0) {
|
if(payload->allow_resume && stat(payload->tempfile_name, &st) == 0) {
|
||||||
@@ -503,7 +541,7 @@ static int curl_check_finished_download(alpm_handle_t *handle, CURLM *curlm, CUR
|
|||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "%s: response code %ld\n",
|
_alpm_log(handle, ALPM_LOG_DEBUG, "%s: response code %ld\n",
|
||||||
payload->remote_name, payload->respcode);
|
payload->remote_name, payload->respcode);
|
||||||
if(payload->respcode >= 400) {
|
if(payload->respcode >= 400) {
|
||||||
if(!payload->errors_ok) {
|
if(!payload->request_errors_ok) {
|
||||||
handle->pm_errno = ALPM_ERR_RETRIEVE;
|
handle->pm_errno = ALPM_ERR_RETRIEVE;
|
||||||
/* non-translated message is same as libcurl */
|
/* non-translated message is same as libcurl */
|
||||||
snprintf(payload->error_buffer, sizeof(payload->error_buffer),
|
snprintf(payload->error_buffer, sizeof(payload->error_buffer),
|
||||||
@@ -535,7 +573,6 @@ static int curl_check_finished_download(alpm_handle_t *handle, CURLM *curlm, CUR
|
|||||||
case CURLE_ABORTED_BY_CALLBACK:
|
case CURLE_ABORTED_BY_CALLBACK:
|
||||||
/* handle the interrupt accordingly */
|
/* handle the interrupt accordingly */
|
||||||
if(dload_interrupted == ABORT_OVER_MAXFILESIZE) {
|
if(dload_interrupted == ABORT_OVER_MAXFILESIZE) {
|
||||||
curlerr = CURLE_FILESIZE_EXCEEDED;
|
|
||||||
payload->unlink_on_fail = 1;
|
payload->unlink_on_fail = 1;
|
||||||
handle->pm_errno = ALPM_ERR_LIBCURL;
|
handle->pm_errno = ALPM_ERR_LIBCURL;
|
||||||
_alpm_log(handle, ALPM_LOG_ERROR,
|
_alpm_log(handle, ALPM_LOG_ERROR,
|
||||||
@@ -558,7 +595,7 @@ static int curl_check_finished_download(alpm_handle_t *handle, CURLM *curlm, CUR
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if(!payload->errors_ok) {
|
if(!payload->request_errors_ok) {
|
||||||
handle->pm_errno = ALPM_ERR_LIBCURL;
|
handle->pm_errno = ALPM_ERR_LIBCURL;
|
||||||
_alpm_log(handle, ALPM_LOG_ERROR,
|
_alpm_log(handle, ALPM_LOG_ERROR,
|
||||||
_("failed retrieving file '%s' from %s : %s\n"),
|
_("failed retrieving file '%s' from %s : %s\n"),
|
||||||
@@ -764,18 +801,13 @@ static int curl_add_payload(alpm_handle_t *handle, CURLM *curlm,
|
|||||||
if(payload->fileurl) {
|
if(payload->fileurl) {
|
||||||
ASSERT(!payload->servers, GOTO_ERR(handle, ALPM_ERR_WRONG_ARGS, cleanup));
|
ASSERT(!payload->servers, GOTO_ERR(handle, ALPM_ERR_WRONG_ARGS, cleanup));
|
||||||
ASSERT(!payload->filepath, GOTO_ERR(handle, ALPM_ERR_WRONG_ARGS, cleanup));
|
ASSERT(!payload->filepath, GOTO_ERR(handle, ALPM_ERR_WRONG_ARGS, cleanup));
|
||||||
|
payload->request_errors_ok = payload->errors_ok;
|
||||||
} else {
|
} else {
|
||||||
const char *server;
|
const char *server = payload_next_server(payload);
|
||||||
while(payload->servers && should_skip_server(handle, payload->servers->data)) {
|
|
||||||
payload->servers = payload->servers->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
ASSERT(payload->servers, GOTO_ERR(handle, ALPM_ERR_SERVER_NONE, cleanup));
|
ASSERT(server, GOTO_ERR(handle, ALPM_ERR_SERVER_NONE, cleanup));
|
||||||
ASSERT(payload->filepath, GOTO_ERR(handle, ALPM_ERR_WRONG_ARGS, cleanup));
|
ASSERT(payload->filepath, GOTO_ERR(handle, ALPM_ERR_WRONG_ARGS, cleanup));
|
||||||
|
|
||||||
server = payload->servers->data;
|
|
||||||
payload->servers = payload->servers->next;
|
|
||||||
|
|
||||||
len = strlen(server) + strlen(payload->filepath) + 2;
|
len = strlen(server) + strlen(payload->filepath) + 2;
|
||||||
MALLOC(payload->fileurl, len, GOTO_ERR(handle, ALPM_ERR_MEMORY, cleanup));
|
MALLOC(payload->fileurl, len, GOTO_ERR(handle, ALPM_ERR_MEMORY, cleanup));
|
||||||
snprintf(payload->fileurl, len, "%s/%s", server, payload->filepath);
|
snprintf(payload->fileurl, len, "%s/%s", server, payload->filepath);
|
||||||
@@ -934,12 +966,30 @@ static int curl_download_internal(alpm_handle_t *handle,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "curl_download_internal return code is %d\n", err);
|
int ret = err ? -1 : updated ? 0 : 1;
|
||||||
return err ? -1 : updated ? 0 : 1;
|
_alpm_log(handle, ALPM_LOG_DEBUG, "curl_download_internal return code is %d\n", ret);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int payload_download_fetchcb(struct dload_payload *payload,
|
||||||
|
const char *server, const char *localpath)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
char *fileurl;
|
||||||
|
alpm_handle_t *handle = payload->handle;
|
||||||
|
|
||||||
|
size_t len = strlen(server) + strlen(payload->filepath) + 2;
|
||||||
|
MALLOC(fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
|
||||||
|
snprintf(fileurl, len, "%s/%s", server, payload->filepath);
|
||||||
|
|
||||||
|
ret = handle->fetchcb(handle->fetchcb_ctx, fileurl, localpath, payload->force);
|
||||||
|
free(fileurl);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* Returns -1 if an error happened for a required file
|
/* Returns -1 if an error happened for a required file
|
||||||
* Returns 0 if a payload was actually downloaded
|
* Returns 0 if a payload was actually downloaded
|
||||||
* Returns 1 if no files were downloaded and all errors were non-fatal
|
* Returns 1 if no files were downloaded and all errors were non-fatal
|
||||||
@@ -965,16 +1015,11 @@ int _alpm_download(alpm_handle_t *handle,
|
|||||||
if(payload->fileurl) {
|
if(payload->fileurl) {
|
||||||
ret = handle->fetchcb(handle->fetchcb_ctx, payload->fileurl, localpath, payload->force);
|
ret = handle->fetchcb(handle->fetchcb_ctx, payload->fileurl, localpath, payload->force);
|
||||||
} else {
|
} else {
|
||||||
|
for(s = payload->cache_servers; s && ret == -1; s = s->next) {
|
||||||
|
ret = payload_download_fetchcb(payload, s->data, localpath);
|
||||||
|
}
|
||||||
for(s = payload->servers; s && ret == -1; s = s->next) {
|
for(s = payload->servers; s && ret == -1; s = s->next) {
|
||||||
const char *server = s->data;
|
ret = payload_download_fetchcb(payload, s->data, localpath);
|
||||||
char *fileurl;
|
|
||||||
|
|
||||||
size_t len = strlen(server) + strlen(payload->filepath) + 2;
|
|
||||||
MALLOC(fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
|
|
||||||
snprintf(fileurl, len, "%s/%s", server, payload->filepath);
|
|
||||||
|
|
||||||
ret = handle->fetchcb(handle->fetchcb_ctx, fileurl, localpath, payload->force);
|
|
||||||
free(fileurl);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ struct dload_payload {
|
|||||||
*/
|
*/
|
||||||
char *fileurl;
|
char *fileurl;
|
||||||
char *filepath; /* download URL path */
|
char *filepath; /* download URL path */
|
||||||
|
alpm_list_t *cache_servers;
|
||||||
alpm_list_t *servers;
|
alpm_list_t *servers;
|
||||||
long respcode;
|
long respcode;
|
||||||
off_t initial_size;
|
off_t initial_size;
|
||||||
@@ -55,6 +56,7 @@ struct dload_payload {
|
|||||||
char error_buffer[CURL_ERROR_SIZE];
|
char error_buffer[CURL_ERROR_SIZE];
|
||||||
FILE *localf; /* temp download file */
|
FILE *localf; /* temp download file */
|
||||||
int signature; /* specifies if this payload is for a signature file */
|
int signature; /* specifies if this payload is for a signature file */
|
||||||
|
int request_errors_ok; /* per-request errors-ok */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -48,12 +48,28 @@ alpm_handle_t *_alpm_handle_new(void)
|
|||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* free all in-memory resources */
|
||||||
void _alpm_handle_free(alpm_handle_t *handle)
|
void _alpm_handle_free(alpm_handle_t *handle)
|
||||||
{
|
{
|
||||||
|
alpm_list_t *i;
|
||||||
|
alpm_db_t *db;
|
||||||
|
|
||||||
if(handle == NULL) {
|
if(handle == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* close local database */
|
||||||
|
if((db = handle->db_local)) {
|
||||||
|
db->ops->unregister(db);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* unregister all sync dbs */
|
||||||
|
for(i = handle->dbs_sync; i; i = i->next) {
|
||||||
|
db = i->data;
|
||||||
|
db->ops->unregister(db);
|
||||||
|
}
|
||||||
|
alpm_list_free(handle->dbs_sync);
|
||||||
|
|
||||||
/* close logfile */
|
/* close logfile */
|
||||||
if(handle->logstream) {
|
if(handle->logstream) {
|
||||||
fclose(handle->logstream);
|
fclose(handle->logstream);
|
||||||
@@ -68,6 +84,12 @@ void _alpm_handle_free(alpm_handle_t *handle)
|
|||||||
FREELIST(handle->known_keys);
|
FREELIST(handle->known_keys);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBCURL
|
||||||
|
curl_multi_cleanup(handle->curlm);
|
||||||
|
curl_global_cleanup();
|
||||||
|
FREELIST(handle->server_errors);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* free memory */
|
/* free memory */
|
||||||
_alpm_trans_free(handle->trans);
|
_alpm_trans_free(handle->trans);
|
||||||
FREE(handle->root);
|
FREE(handle->root);
|
||||||
|
|||||||
@@ -1,226 +0,0 @@
|
|||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "alpm.h"
|
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
#include "mfmt.h"
|
|
||||||
|
|
||||||
typedef enum field_t {
|
|
||||||
FILENAME,
|
|
||||||
NAME,
|
|
||||||
BASE,
|
|
||||||
DESCRIPTION,
|
|
||||||
VERSION,
|
|
||||||
ORIGIN,
|
|
||||||
REASON,
|
|
||||||
LICENSE,
|
|
||||||
GROUP,
|
|
||||||
|
|
||||||
DEPENDS,
|
|
||||||
OPTDEPENDS,
|
|
||||||
CONFLICTS,
|
|
||||||
PROVIDES,
|
|
||||||
REPLACES,
|
|
||||||
REQUIREDBY,
|
|
||||||
|
|
||||||
DELTAS,
|
|
||||||
FILES,
|
|
||||||
BACKUP,
|
|
||||||
DB,
|
|
||||||
VALIDATION,
|
|
||||||
URL,
|
|
||||||
BUILDDATE,
|
|
||||||
INSTALLDATE,
|
|
||||||
PACKAGER,
|
|
||||||
MD5SUM,
|
|
||||||
SHA256SUM,
|
|
||||||
ARCH,
|
|
||||||
SIZE,
|
|
||||||
ISIZE,
|
|
||||||
BASE64SIG,
|
|
||||||
|
|
||||||
UNKNOWN,
|
|
||||||
} field_t;
|
|
||||||
|
|
||||||
static struct field_map_t {
|
|
||||||
const char *input;
|
|
||||||
field_t field;
|
|
||||||
} field_map[] = {
|
|
||||||
{"filename", FILENAME},
|
|
||||||
{"name", NAME},
|
|
||||||
{"base", BASE},
|
|
||||||
{"description", DESCRIPTION},
|
|
||||||
{"version", VERSION},
|
|
||||||
|
|
||||||
{"license", LICENSE},
|
|
||||||
{"group", GROUP},
|
|
||||||
{"groups", GROUP},
|
|
||||||
|
|
||||||
{"depends", DEPENDS},
|
|
||||||
{"optdepends", OPTDEPENDS},
|
|
||||||
{"conflicts", CONFLICTS},
|
|
||||||
{"provides", PROVIDES},
|
|
||||||
{"replaces", REPLACES},
|
|
||||||
{"requiredby", REQUIREDBY},
|
|
||||||
|
|
||||||
{"url", URL},
|
|
||||||
{"builddate", BUILDDATE},
|
|
||||||
{"installdate", INSTALLDATE},
|
|
||||||
{"packager", PACKAGER},
|
|
||||||
{"md5sum", MD5SUM},
|
|
||||||
{"sha256sum", SHA256SUM},
|
|
||||||
{"arch", ARCH},
|
|
||||||
{"size", SIZE},
|
|
||||||
{"isize", ISIZE},
|
|
||||||
{"base64sig", BASE64SIG},
|
|
||||||
|
|
||||||
{NULL, 0}
|
|
||||||
};
|
|
||||||
|
|
||||||
static char *_alpm_hr_size(off_t bytes, char *dest)
|
|
||||||
{
|
|
||||||
static const char *suff[] = {"B", "K", "M", "G", "T", "P", "E", NULL};
|
|
||||||
float hrsize;
|
|
||||||
int s = 0;
|
|
||||||
while((bytes >= 1000000 || bytes <= -1000000) && suff[s + 1]) {
|
|
||||||
bytes /= 1024;
|
|
||||||
++s;
|
|
||||||
}
|
|
||||||
hrsize = bytes;
|
|
||||||
if((hrsize >= 1000 || hrsize <= -1000) && suff[s + 1]) {
|
|
||||||
hrsize /= 1024;
|
|
||||||
++s;
|
|
||||||
}
|
|
||||||
sprintf(dest, "%.2f %s", hrsize, suff[s]);
|
|
||||||
return dest;
|
|
||||||
}
|
|
||||||
|
|
||||||
static field_t _alpm_info_lookup_field(const char *name) {
|
|
||||||
struct field_map_t *m;
|
|
||||||
for(m = field_map; m->input; m++) {
|
|
||||||
if(strcmp(name, m->input) == 0) { return m->field; }
|
|
||||||
}
|
|
||||||
return UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t _alpm_info_print_str(mfmt_token_callback_t *t, const char *str, FILE *f) {
|
|
||||||
return mfmt_render_str(t, str ? str : "NULL", f);
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t _alpm_info_print_size(mfmt_token_callback_t *t, const off_t s, FILE *f) {
|
|
||||||
if(s) {
|
|
||||||
char hrsize[50];
|
|
||||||
if(t->conversion == 'd') {
|
|
||||||
snprintf(hrsize, 50, "%lld", (long long)s);
|
|
||||||
} else {
|
|
||||||
_alpm_hr_size(s, hrsize);
|
|
||||||
}
|
|
||||||
return mfmt_render_str(t, hrsize, f);
|
|
||||||
} else {
|
|
||||||
return mfmt_render_str(t, "NULL", f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t _alpm_info_print_strlist(mfmt_token_callback_t *t, alpm_list_t *l, FILE *f) {
|
|
||||||
if(l) {
|
|
||||||
size_t len = 0;
|
|
||||||
while(l) {
|
|
||||||
len += mfmt_render_str(t, l->data, f) + 1;
|
|
||||||
fputc('\n', f);
|
|
||||||
l = l->next;
|
|
||||||
}
|
|
||||||
return len;
|
|
||||||
} else {
|
|
||||||
return mfmt_render_str(t, "NULL", f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t _alpm_info_print_deplist(mfmt_token_callback_t *t, alpm_list_t *l, FILE *f) {
|
|
||||||
if(l) {
|
|
||||||
size_t len = 0;
|
|
||||||
while(l) {
|
|
||||||
char *s = alpm_dep_compute_string(l->data);
|
|
||||||
len += mfmt_render_str(t, s, f) + 1;
|
|
||||||
fputc('\n', f);
|
|
||||||
l = l->next;
|
|
||||||
free(s);
|
|
||||||
}
|
|
||||||
return len;
|
|
||||||
} else {
|
|
||||||
return mfmt_render_str(t, "NULL", f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t _alpm_info_print_timestamp(mfmt_token_callback_t *t, const alpm_time_t s, FILE *f) {
|
|
||||||
if(s) {
|
|
||||||
char datestr[50] = "";
|
|
||||||
if(strftime(datestr, 50, " %c", localtime(&s)) == 0) { return 0; }
|
|
||||||
return mfmt_render_str(t, datestr + 1, f);
|
|
||||||
} else {
|
|
||||||
return mfmt_render_str(t, "NULL", f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t _alpm_info_process_token(FILE *f, mfmt_token_callback_t *t, void *ctx, void *arg) {
|
|
||||||
alpm_pkg_t *p = arg;
|
|
||||||
(void)ctx;
|
|
||||||
switch(_alpm_info_lookup_field(t->name)) {
|
|
||||||
case NAME: return _alpm_info_print_str(t, alpm_pkg_get_name(p), f);
|
|
||||||
case DESCRIPTION: return _alpm_info_print_str(t, alpm_pkg_get_desc(p), f);
|
|
||||||
case PACKAGER: return _alpm_info_print_str(t, alpm_pkg_get_packager(p), f);
|
|
||||||
case MD5SUM: return _alpm_info_print_str(t, alpm_pkg_get_md5sum(p), f);
|
|
||||||
case FILENAME: return _alpm_info_print_str(t, alpm_pkg_get_filename(p), f);
|
|
||||||
case BASE: return _alpm_info_print_str(t, alpm_pkg_get_base(p), f);
|
|
||||||
case VERSION: return _alpm_info_print_str(t, alpm_pkg_get_version(p), f);
|
|
||||||
case URL: return _alpm_info_print_str(t, alpm_pkg_get_url(p), f);
|
|
||||||
case SHA256SUM: return _alpm_info_print_str(t, alpm_pkg_get_sha256sum(p), f);
|
|
||||||
case ARCH: return _alpm_info_print_str(t, alpm_pkg_get_arch(p), f);
|
|
||||||
case BASE64SIG: return _alpm_info_print_str(t, alpm_pkg_get_base64_sig(p), f);
|
|
||||||
|
|
||||||
case SIZE: return _alpm_info_print_size(t, alpm_pkg_get_size(p), f);
|
|
||||||
case ISIZE: return _alpm_info_print_size(t, alpm_pkg_get_isize(p), f);
|
|
||||||
|
|
||||||
case BUILDDATE: return _alpm_info_print_timestamp(t, alpm_pkg_get_builddate(p), f);
|
|
||||||
case INSTALLDATE: return _alpm_info_print_timestamp(t, alpm_pkg_get_installdate(p), f);
|
|
||||||
|
|
||||||
case DEPENDS: return _alpm_info_print_deplist(t, alpm_pkg_get_depends(p), f);
|
|
||||||
case OPTDEPENDS: return _alpm_info_print_deplist(t, alpm_pkg_get_optdepends(p), f);
|
|
||||||
case CONFLICTS: return _alpm_info_print_deplist(t, alpm_pkg_get_conflicts(p), f);
|
|
||||||
case PROVIDES: return _alpm_info_print_deplist(t, alpm_pkg_get_provides(p), f);
|
|
||||||
case REPLACES: return _alpm_info_print_deplist(t, alpm_pkg_get_replaces(p), f);
|
|
||||||
case REQUIREDBY: {
|
|
||||||
alpm_list_t *rb = alpm_pkg_compute_requiredby(p);
|
|
||||||
size_t len = _alpm_info_print_strlist(t, rb, f);
|
|
||||||
FREELIST(rb);
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: errno = EINVAL; return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t SYMEXPORT alpm_info_print_pkg(const char *format, alpm_pkg_t *pkg) {
|
|
||||||
alpm_list_t l = {
|
|
||||||
.data = pkg,
|
|
||||||
.next = NULL,
|
|
||||||
};
|
|
||||||
l.prev = &l;
|
|
||||||
return alpm_info_print_pkgs(format, &l);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t SYMEXPORT alpm_info_print_pkgs(const char *format, alpm_list_t *pkgs) {
|
|
||||||
mfmt_t *mfmt = mfmt_parse(format, _alpm_info_process_token, NULL);
|
|
||||||
size_t len = 0;
|
|
||||||
if(mfmt == NULL) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
for(alpm_list_t *i = pkgs; i; i = i->next) {
|
|
||||||
size_t plen = mfmt_printf(mfmt, i->data, stdout);
|
|
||||||
if(plen == 0) { return 0; }
|
|
||||||
len += plen;
|
|
||||||
}
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* vim: set ts=2 sw=2 et: */
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
prefix=@prefix@
|
|
||||||
exec_prefix=@exec_prefix@
|
|
||||||
libdir=@libdir@
|
|
||||||
includedir=@includedir@
|
|
||||||
|
|
||||||
Name: libalpm
|
|
||||||
Description: Arch Linux package management library
|
|
||||||
URL: http://archlinux.org/pacman/
|
|
||||||
Version: @LIB_VERSION@
|
|
||||||
Requires.private: libarchive @pc_crypto@ @pc_libcurl@ @pc_gpgme@
|
|
||||||
Cflags: -I${includedir} @LFS_CFLAGS@
|
|
||||||
Libs: -L${libdir} -lalpm
|
|
||||||
Libs.private: @LIBS@ @pc_gpgme_libs@ @LIBINTL@
|
|
||||||
@@ -28,7 +28,5 @@ libalpm_sources = files('''
|
|||||||
sync.h sync.c
|
sync.h sync.c
|
||||||
trans.h trans.c
|
trans.h trans.c
|
||||||
util.h util.c
|
util.h util.c
|
||||||
info.c
|
|
||||||
mfmt.c mfmt.h
|
|
||||||
version.c
|
version.c
|
||||||
'''.split())
|
'''.split())
|
||||||
|
|||||||
@@ -1,193 +0,0 @@
|
|||||||
#define _GNU_SOURCE
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "mfmt.h"
|
|
||||||
|
|
||||||
char *_mfmt_find_unescaped_char(char *haystack, char needle) {
|
|
||||||
while(1) {
|
|
||||||
haystack = strchrnul(haystack, needle);
|
|
||||||
if(*haystack && *(haystack + 1) == needle) { haystack += 2; continue; }
|
|
||||||
else { break; }
|
|
||||||
}
|
|
||||||
return haystack;
|
|
||||||
}
|
|
||||||
|
|
||||||
void _mfmt_brace_dedup(char *str) {
|
|
||||||
char *c = str, *end = str + strlen(str);
|
|
||||||
while((c = strchr(c, '{'))) {
|
|
||||||
memmove(c, c + 1, end - c);
|
|
||||||
c++;
|
|
||||||
}
|
|
||||||
|
|
||||||
c = str;
|
|
||||||
while((c = strchr(c, '}'))) {
|
|
||||||
memmove(c, c + 1, end - c);
|
|
||||||
c++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mfmt_t *mfmt_parse(const char *tmpl, mfmt_callback_t *cb, void *ctx) {
|
|
||||||
mfmt_t *mfmt;
|
|
||||||
char *c;
|
|
||||||
|
|
||||||
mfmt = calloc(sizeof(mfmt_t), 1);
|
|
||||||
if(mfmt == NULL) { return NULL; }
|
|
||||||
|
|
||||||
mfmt->cb = cb;
|
|
||||||
mfmt->ctx = ctx;
|
|
||||||
|
|
||||||
for(c = (char*) tmpl; c && *c; ) {
|
|
||||||
mfmt->token_count++;
|
|
||||||
if(*c == '{' && *(c + 1) != '{') {
|
|
||||||
/* replacement */
|
|
||||||
if(!*(c = _mfmt_find_unescaped_char(c + 1, '}'))) {
|
|
||||||
errno = EINVAL;
|
|
||||||
free(mfmt);
|
|
||||||
return NULL;
|
|
||||||
} else {
|
|
||||||
c++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* literal */
|
|
||||||
c = _mfmt_find_unescaped_char(c, '{');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if((mfmt->tokens = calloc(sizeof(mfmt_token_t), mfmt->token_count)) == NULL) {
|
|
||||||
free(mfmt);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t i;
|
|
||||||
for(c = (char*) tmpl, i = 0; c && *c; i++) {
|
|
||||||
if(*c == '{' && *(c + 1) != '{') {
|
|
||||||
/* replacement */
|
|
||||||
mfmt_token_callback_t *t = &mfmt->tokens[i].callback;
|
|
||||||
char *end = _mfmt_find_unescaped_char(c + 1, '}');
|
|
||||||
t->type = MFMT_TOKEN_CALLBACK;
|
|
||||||
t->name = strndup(c + 1, end - c - 1);
|
|
||||||
c = end + 1;
|
|
||||||
} else {
|
|
||||||
/* literal */
|
|
||||||
char *end = _mfmt_find_unescaped_char(c, '{');
|
|
||||||
mfmt_token_literal_t *t = &mfmt->tokens[i].literal;
|
|
||||||
t->type = MFMT_TOKEN_LITERAL;
|
|
||||||
t->string = strndup(c, end - c);
|
|
||||||
_mfmt_brace_dedup(t->string);
|
|
||||||
c = end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return mfmt;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t mfmt_printf(mfmt_t *mfmt, void *args, FILE *f) {
|
|
||||||
size_t len = 0;
|
|
||||||
size_t i;
|
|
||||||
for(i = 0; i < mfmt->token_count; i++) {
|
|
||||||
mfmt_token_t *t = &mfmt->tokens[i];
|
|
||||||
switch(t->base.type) {
|
|
||||||
case MFMT_TOKEN_LITERAL:
|
|
||||||
len += fputs(t->literal.string, f);
|
|
||||||
break;
|
|
||||||
case MFMT_TOKEN_CALLBACK:
|
|
||||||
len += mfmt->cb(f, &t->callback, mfmt->ctx, args);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
errno = EINVAL;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t _mfmt_printf_close(mfmt_t *mfmt, void *args, FILE *f) {
|
|
||||||
if(f) {
|
|
||||||
size_t len = mfmt_printf(mfmt, args, f);
|
|
||||||
fclose(f);
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t mfmt_printd(mfmt_t *mfmt, void *args, int fd) {
|
|
||||||
return _mfmt_printf_close(mfmt, args, fdopen(fd, "w"));
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t mfmt_printb(mfmt_t *mfmt, void *args, char *buf, size_t buflen) {
|
|
||||||
return _mfmt_printf_close(mfmt, args, fmemopen(buf, buflen, "w"));
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t mfmt_prints(mfmt_t *mfmt, void *args, char **buf, size_t *buflen) {
|
|
||||||
return _mfmt_printf_close(mfmt, args, open_memstream(buf, buflen));
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t mfmt_fmt(const char *tmpl, mfmt_val_t *args, FILE *f) {
|
|
||||||
mfmt_t *mfmt = mfmt_parse(tmpl, NULL, NULL);
|
|
||||||
size_t len;
|
|
||||||
for(size_t i = 0; i < mfmt->token_count; i++) {
|
|
||||||
mfmt_token_t *t = &mfmt->tokens[i];
|
|
||||||
switch(t->base.type) {
|
|
||||||
case MFMT_TOKEN_LITERAL:
|
|
||||||
len += fputs(t->literal.string, f);
|
|
||||||
break;
|
|
||||||
case MFMT_TOKEN_CALLBACK:
|
|
||||||
/* fprintf(stderr, "token: %s\n", t->callback.name); */
|
|
||||||
if(t->callback.name[0]) {
|
|
||||||
for(mfmt_val_t *v = args; v; v++) {
|
|
||||||
/* fprintf(stderr, "val: %s\n", v->name); */
|
|
||||||
if(strcmp(v->name, t->callback.name) == 0) {
|
|
||||||
len += fputs(v->string, f);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
len += fputs(args->string, f);
|
|
||||||
args++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t mfmt_mfmt(mfmt_t *mfmt, mfmt_val_t *args, FILE *f) {
|
|
||||||
size_t len;
|
|
||||||
for(size_t i = 0; i < mfmt->token_count; i++) {
|
|
||||||
mfmt_token_t *t = &mfmt->tokens[i];
|
|
||||||
switch(t->base.type) {
|
|
||||||
case MFMT_TOKEN_LITERAL:
|
|
||||||
len += fputs(t->literal.string, f);
|
|
||||||
break;
|
|
||||||
case MFMT_TOKEN_CALLBACK:
|
|
||||||
/* fprintf(stderr, "token: %s\n", t->callback.name); */
|
|
||||||
if(t->callback.name[0]) {
|
|
||||||
for(mfmt_val_t *v = args; v; v++) {
|
|
||||||
/* fprintf(stderr, "val: %s\n", v->name); */
|
|
||||||
if(strcmp(v->name, t->callback.name) == 0) {
|
|
||||||
len += fputs(v->string, f);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
len += fputs(args->string, f);
|
|
||||||
args++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t mfmt_render_int(mfmt_token_callback_t *t, const intmax_t i, FILE *f) {
|
|
||||||
(void)t;
|
|
||||||
return fprintf(f, "%jd", i);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t mfmt_render_str(mfmt_token_callback_t *t, const char *str, FILE *f) {
|
|
||||||
(void)t;
|
|
||||||
return fputs(str, f);
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <inttypes.h>
|
|
||||||
|
|
||||||
typedef enum mfmt_token_type_t {
|
|
||||||
MFMT_TOKEN_LITERAL,
|
|
||||||
MFMT_TOKEN_CALLBACK,
|
|
||||||
} mfmt_token_type_t;
|
|
||||||
|
|
||||||
typedef struct mfmt_token_literal_t {
|
|
||||||
mfmt_token_type_t type;
|
|
||||||
char *string;
|
|
||||||
} mfmt_token_literal_t;
|
|
||||||
|
|
||||||
typedef struct mfmt_token_base_t {
|
|
||||||
mfmt_token_type_t type;
|
|
||||||
} mfmt_token_base_t;
|
|
||||||
|
|
||||||
typedef struct mfmt_token_callback_t {
|
|
||||||
mfmt_token_type_t type;
|
|
||||||
|
|
||||||
size_t position;
|
|
||||||
char *name;
|
|
||||||
size_t width;
|
|
||||||
size_t precision;
|
|
||||||
char align;
|
|
||||||
char fill;
|
|
||||||
char conversion;
|
|
||||||
int sign;
|
|
||||||
} mfmt_token_callback_t;
|
|
||||||
|
|
||||||
typedef union mfmt_token_t {
|
|
||||||
mfmt_token_base_t base;
|
|
||||||
mfmt_token_literal_t literal;
|
|
||||||
mfmt_token_callback_t callback;
|
|
||||||
} mfmt_token_t;
|
|
||||||
|
|
||||||
typedef size_t (mfmt_callback_t)(FILE *f, mfmt_token_callback_t *token, void *ctx, void *args);
|
|
||||||
|
|
||||||
typedef struct mfmt_t {
|
|
||||||
mfmt_callback_t *cb;
|
|
||||||
void *ctx;
|
|
||||||
size_t token_count;
|
|
||||||
mfmt_token_t *tokens;
|
|
||||||
} mfmt_t;
|
|
||||||
|
|
||||||
typedef struct mfmt_val_t {
|
|
||||||
const char *name;
|
|
||||||
const char *string;
|
|
||||||
} mfmt_val_t;
|
|
||||||
|
|
||||||
mfmt_t *mfmt_parse(const char *tmpl, mfmt_callback_t *cb, void *ctx);
|
|
||||||
size_t mfmt_printf(mfmt_t *mfmt, void *args, FILE *f);
|
|
||||||
size_t mfmt_printd(mfmt_t *mfmt, void *args, int fd);
|
|
||||||
size_t mfmt_printb(mfmt_t *mfmt, void *args, char *buf, size_t buflen);
|
|
||||||
size_t mfmt_prints(mfmt_t *mfmt, void *args, char **buf, size_t *buflen);
|
|
||||||
void mfmt_free(mfmt_t *mfmt);
|
|
||||||
|
|
||||||
size_t mfmt_render_int(mfmt_token_callback_t *token, intmax_t i, FILE *f);
|
|
||||||
size_t mfmt_render_uint(mfmt_token_callback_t *token, uintmax_t i, FILE *f);
|
|
||||||
size_t mfmt_render_str(mfmt_token_callback_t *token, const char *str, FILE *f);
|
|
||||||
|
|
||||||
size_t mfmt_formatf(const char *tmpl, mfmt_callback_t *cb, void *ctx, FILE *f);
|
|
||||||
size_t mfmt_formatd(const char *tmpl, mfmt_callback_t *cb, void *ctx, int fd);
|
|
||||||
size_t mfmt_formatb(const char *tmpl, mfmt_callback_t *cb, void *ctx, char *buf, size_t buflen);
|
|
||||||
size_t mfmt_formats(const char *tmpl, mfmt_callback_t *cb, void *ctx, char **buf);
|
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -844,3 +845,58 @@ int SYMEXPORT alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check that package metadata meets our requirements */
|
||||||
|
int _alpm_pkg_check_meta(alpm_pkg_t *pkg)
|
||||||
|
{
|
||||||
|
char *c;
|
||||||
|
int error_found = 0;
|
||||||
|
|
||||||
|
#define EPKGMETA(error) do { \
|
||||||
|
error_found = -1; \
|
||||||
|
_alpm_log(pkg->handle, ALPM_LOG_ERROR, error, pkg->name, pkg->version); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
/* sanity check */
|
||||||
|
if(pkg->handle == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* immediate bail if package doesn't have name or version */
|
||||||
|
if(pkg->name == NULL || pkg->name[0] == '\0'
|
||||||
|
|| pkg->version == NULL || pkg->version[0] == '\0') {
|
||||||
|
_alpm_log(pkg->handle, ALPM_LOG_ERROR,
|
||||||
|
_("invalid package metadata (name or version missing)"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(pkg->name[0] == '-' || pkg->name[0] == '.') {
|
||||||
|
EPKGMETA(_("invalid metadata for package %s-%s "
|
||||||
|
"(package name cannot start with '.' or '-')\n"));
|
||||||
|
}
|
||||||
|
if(_alpm_fnmatch(pkg->name, "[![:alnum:]+_.@-]") == 0) {
|
||||||
|
EPKGMETA(_("invalid metadata for package %s-%s "
|
||||||
|
"(package name contains invalid characters)\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* multiple '-' in pkgver can cause local db entries for different packages
|
||||||
|
* to overlap (e.g. foo-1=2-3 and foo=1-2-3 both give foo-1-2-3) */
|
||||||
|
if((c = strchr(pkg->version, '-')) && (strchr(c + 1, '-'))) {
|
||||||
|
EPKGMETA(_("invalid metadata for package %s-%s "
|
||||||
|
"(package version contains invalid characters)\n"));
|
||||||
|
}
|
||||||
|
if(strchr(pkg->version, '/')) {
|
||||||
|
EPKGMETA(_("invalid metadata for package %s-%s "
|
||||||
|
"(package version contains invalid characters)\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* local db entry is <pkgname>-<pkgver> */
|
||||||
|
if(strlen(pkg->name) + strlen(pkg->version) + 1 > NAME_MAX) {
|
||||||
|
EPKGMETA(_("invalid metadata for package %s-%s "
|
||||||
|
"(package name and version too long)\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef EPKGMETA
|
||||||
|
|
||||||
|
return error_found;
|
||||||
|
}
|
||||||
|
|||||||
@@ -165,4 +165,6 @@ int _alpm_pkg_compare_versions(alpm_pkg_t *local_pkg, alpm_pkg_t *pkg);
|
|||||||
alpm_pkg_xdata_t *_alpm_pkg_parse_xdata(const char *string);
|
alpm_pkg_xdata_t *_alpm_pkg_parse_xdata(const char *string);
|
||||||
void _alpm_pkg_xdata_free(alpm_pkg_xdata_t *pd);
|
void _alpm_pkg_xdata_free(alpm_pkg_xdata_t *pd);
|
||||||
|
|
||||||
|
int _alpm_pkg_check_meta(alpm_pkg_t *pkg);
|
||||||
|
|
||||||
#endif /* ALPM_PACKAGE_H */
|
#endif /* ALPM_PACKAGE_H */
|
||||||
|
|||||||
@@ -420,7 +420,9 @@ static void shift_pacsave(alpm_handle_t *handle, const char *file)
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
free(dirname);
|
free(dirname);
|
||||||
closedir(dir);
|
if(dir != NULL) {
|
||||||
|
closedir(dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1044,7 +1044,7 @@ int SYMEXPORT alpm_siglist_cleanup(alpm_siglist_t *siglist)
|
|||||||
static size_t length_check(size_t length, size_t position, size_t a,
|
static size_t length_check(size_t length, size_t position, size_t a,
|
||||||
alpm_handle_t *handle, const char *identifier)
|
alpm_handle_t *handle, const char *identifier)
|
||||||
{
|
{
|
||||||
if( a == 0 || length - position <= a) {
|
if( a == 0 || position > length || length - position <= a) {
|
||||||
_alpm_log(handle, ALPM_LOG_ERROR,
|
_alpm_log(handle, ALPM_LOG_ERROR,
|
||||||
_("%s: signature format error\n"), identifier);
|
_("%s: signature format error\n"), identifier);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -517,21 +517,23 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
|||||||
|
|
||||||
for(i = deps; i; i = i->next) {
|
for(i = deps; i; i = i->next) {
|
||||||
alpm_conflict_t *conflict = i->data;
|
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;
|
alpm_pkg_t *rsync, *sync, *sync1, *sync2;
|
||||||
|
|
||||||
/* have we already removed one of the conflicting targets? */
|
/* have we already removed one of the conflicting targets? */
|
||||||
sync1 = alpm_pkg_find(trans->add, conflict->package1);
|
sync1 = alpm_pkg_find(trans->add, name1);
|
||||||
sync2 = alpm_pkg_find(trans->add, conflict->package2);
|
sync2 = alpm_pkg_find(trans->add, name2);
|
||||||
if(!sync1 || !sync2) {
|
if(!sync1 || !sync2) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "conflicting packages in the sync list: '%s' <-> '%s'\n",
|
_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 */
|
/* 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 *dep1 = alpm_dep_from_string(name1);
|
||||||
alpm_depend_t *dep2 = alpm_dep_from_string(conflict->package2);
|
alpm_depend_t *dep2 = alpm_dep_from_string(name2);
|
||||||
if(_alpm_depcmp(sync1, dep2)) {
|
if(_alpm_depcmp(sync1, dep2)) {
|
||||||
rsync = sync2;
|
rsync = sync2;
|
||||||
sync = sync1;
|
sync = sync1;
|
||||||
@@ -559,8 +561,8 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
|||||||
|
|
||||||
/* Prints warning */
|
/* Prints warning */
|
||||||
_alpm_log(handle, ALPM_LOG_WARNING,
|
_alpm_log(handle, ALPM_LOG_WARNING,
|
||||||
_("removing '%s' from target list because it conflicts with '%s'\n"),
|
_("removing '%s-%s' from target list because it conflicts with '%s-%s'\n"),
|
||||||
rsync->name, sync->name);
|
rsync->name, rsync->version, sync->name, sync->version);
|
||||||
trans->add = alpm_list_remove(trans->add, rsync, _alpm_pkg_cmp, NULL);
|
trans->add = alpm_list_remove(trans->add, rsync, _alpm_pkg_cmp, NULL);
|
||||||
/* rsync is not a transaction target anymore */
|
/* rsync is not a transaction target anymore */
|
||||||
trans->unresolvable = alpm_list_add(trans->unresolvable, rsync);
|
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
|
.conflict = i->data
|
||||||
};
|
};
|
||||||
alpm_conflict_t *conflict = i->data;
|
alpm_conflict_t *conflict = i->data;
|
||||||
|
const char *name1 = conflict->package1->name;
|
||||||
|
const char *name2 = conflict->package2->name;
|
||||||
int found = 0;
|
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 */
|
we ask the user */
|
||||||
if(alpm_pkg_find(trans->remove, conflict->package2)) {
|
if(alpm_pkg_find(trans->remove, name2)) {
|
||||||
found = 1;
|
found = 1;
|
||||||
}
|
}
|
||||||
for(j = trans->add; j && !found; j = j->next) {
|
for(j = trans->add; j && !found; j = j->next) {
|
||||||
alpm_pkg_t *spkg = j->data;
|
alpm_pkg_t *spkg = j->data;
|
||||||
if(alpm_pkg_find(spkg->removes, conflict->package2)) {
|
if(alpm_pkg_find(spkg->removes, name2)) {
|
||||||
found = 1;
|
found = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -598,15 +602,15 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "package '%s' conflicts with '%s'\n",
|
_alpm_log(handle, ALPM_LOG_DEBUG, "package '%s-%s' conflicts with '%s-%s'\n",
|
||||||
conflict->package1, conflict->package2);
|
name1, conflict->package1->version, name2,conflict->package2->version);
|
||||||
|
|
||||||
QUESTION(handle, &question);
|
QUESTION(handle, &question);
|
||||||
if(question.remove) {
|
if(question.remove) {
|
||||||
/* append to the removes list */
|
/* append to the removes list */
|
||||||
alpm_pkg_t *sync = alpm_pkg_find(trans->add, conflict->package1);
|
alpm_pkg_t *sync = alpm_pkg_find(trans->add, name1);
|
||||||
alpm_pkg_t *local = _alpm_db_get_pkgfromcache(handle->db_local, conflict->package2);
|
alpm_pkg_t *local = _alpm_db_get_pkgfromcache(handle->db_local, name2);
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "electing '%s' for removal\n", conflict->package2);
|
_alpm_log(handle, ALPM_LOG_DEBUG, "electing '%s' for removal\n", name2);
|
||||||
sync->removes = alpm_list_add(sync->removes, local);
|
sync->removes = alpm_list_add(sync->removes, local);
|
||||||
} else { /* abort */
|
} else { /* abort */
|
||||||
_alpm_log(handle, ALPM_LOG_ERROR, _("unresolvable package conflicts detected\n"));
|
_alpm_log(handle, ALPM_LOG_ERROR, _("unresolvable package conflicts detected\n"));
|
||||||
@@ -824,6 +828,7 @@ static int download_files(alpm_handle_t *handle)
|
|||||||
FREE(payload->remote_name); FREE(payload);
|
FREE(payload->remote_name); FREE(payload);
|
||||||
GOTO_ERR(handle, ALPM_ERR_MEMORY, finish));
|
GOTO_ERR(handle, ALPM_ERR_MEMORY, finish));
|
||||||
payload->max_size = pkg->size;
|
payload->max_size = pkg->size;
|
||||||
|
payload->cache_servers = pkg->origin_data.db->cache_servers;
|
||||||
payload->servers = pkg->origin_data.db->servers;
|
payload->servers = pkg->origin_data.db->servers;
|
||||||
payload->handle = handle;
|
payload->handle = handle;
|
||||||
payload->allow_resume = 1;
|
payload->allow_resume = 1;
|
||||||
@@ -991,6 +996,13 @@ static int check_validity(alpm_handle_t *handle,
|
|||||||
|
|
||||||
current_bytes += v.pkg->size;
|
current_bytes += v.pkg->size;
|
||||||
v.path = _alpm_filecache_find(handle, v.pkg->filename);
|
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));
|
v.siglevel = alpm_db_get_siglevel(alpm_pkg_get_db(v.pkg));
|
||||||
|
|
||||||
if(_alpm_pkg_validate_internal(handle, v.path, v.pkg,
|
if(_alpm_pkg_validate_internal(handle, v.path, v.pkg,
|
||||||
@@ -1082,6 +1094,12 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data,
|
|||||||
current_bytes += spkg->size;
|
current_bytes += spkg->size;
|
||||||
filepath = _alpm_filecache_find(handle, spkg->filename);
|
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 */
|
/* 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 */
|
/* TODO: alpm_pkg_get_db() will not work on this target anymore */
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG,
|
_alpm_log(handle, ALPM_LOG_DEBUG,
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -654,7 +655,9 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* use fprintf instead of _alpm_log to send output through the parent */
|
/* 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));
|
fprintf(stderr, _("could not change the root directory (%s)\n"), strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -672,6 +675,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
|
|||||||
unsetenv("BASH_ENV");
|
unsetenv("BASH_ENV");
|
||||||
umask(0022);
|
umask(0022);
|
||||||
_alpm_reset_signals();
|
_alpm_reset_signals();
|
||||||
|
_alpm_handle_free(handle);
|
||||||
execv(cmd, argv);
|
execv(cmd, argv);
|
||||||
/* execv only returns if there was an error */
|
/* execv only returns if there was an error */
|
||||||
fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno));
|
fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno));
|
||||||
@@ -842,10 +846,17 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename)
|
|||||||
for(i = handle->cachedirs; i; i = i->next) {
|
for(i = handle->cachedirs; i; i = i->next) {
|
||||||
snprintf(path, PATH_MAX, "%s%s", (char *)i->data,
|
snprintf(path, PATH_MAX, "%s%s", (char *)i->data,
|
||||||
filename);
|
filename);
|
||||||
if(stat(path, &buf) == 0 && S_ISREG(buf.st_mode)) {
|
if(stat(path, &buf) == 0) {
|
||||||
retpath = strdup(path);
|
if(S_ISREG(buf.st_mode)) {
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "found cached pkg: %s\n", retpath);
|
retpath = strdup(path);
|
||||||
return retpath;
|
_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 */
|
/* package wasn't found in any cachedir */
|
||||||
@@ -1352,6 +1363,11 @@ int _alpm_access(alpm_handle_t *handle, const char *dir, const char *file, int a
|
|||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
int flag = 0;
|
||||||
|
#ifdef AT_SYMLINK_NOFOLLOW
|
||||||
|
flag |= AT_SYMLINK_NOFOLLOW;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(dir) {
|
if(dir) {
|
||||||
char *check_path;
|
char *check_path;
|
||||||
|
|
||||||
@@ -1359,11 +1375,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));
|
CALLOC(check_path, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, -1));
|
||||||
snprintf(check_path, len, "%s%s", dir, file);
|
snprintf(check_path, len, "%s%s", dir, file);
|
||||||
|
|
||||||
ret = access(check_path, amode);
|
ret = faccessat(AT_FDCWD, check_path, amode, flag);
|
||||||
free(check_path);
|
free(check_path);
|
||||||
} else {
|
} else {
|
||||||
dir = "";
|
dir = "";
|
||||||
ret = access(file, amode);
|
ret = faccessat(AT_FDCWD, file, amode, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ret != 0) {
|
if(ret != 0) {
|
||||||
|
|||||||
29
meson.build
29
meson.build
@@ -182,7 +182,22 @@ foreach type : [
|
|||||||
endif
|
endif
|
||||||
endforeach
|
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')
|
conf.set('FSSTATSTYPE', 'struct statvfs')
|
||||||
elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')
|
elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')
|
||||||
conf.set('FSSTATSTYPE', 'struct statfs')
|
conf.set('FSSTATSTYPE', 'struct statfs')
|
||||||
@@ -190,6 +205,7 @@ endif
|
|||||||
|
|
||||||
if get_option('debug')
|
if get_option('debug')
|
||||||
extra_cflags = [
|
extra_cflags = [
|
||||||
|
'-pedantic',
|
||||||
'-Wcast-align',
|
'-Wcast-align',
|
||||||
'-Wclobbered',
|
'-Wclobbered',
|
||||||
'-Wempty-body',
|
'-Wempty-body',
|
||||||
@@ -217,6 +233,7 @@ if get_option('debug')
|
|||||||
'-Wuninitialized',
|
'-Wuninitialized',
|
||||||
'-Wunused-but-set-parameter',
|
'-Wunused-but-set-parameter',
|
||||||
'-Wunused-parameter',
|
'-Wunused-parameter',
|
||||||
|
'-Wunused-result',
|
||||||
'-Wwrite-strings',
|
'-Wwrite-strings',
|
||||||
]
|
]
|
||||||
add_project_arguments(cc.get_supported_arguments(extra_cflags), language : 'c')
|
add_project_arguments(cc.get_supported_arguments(extra_cflags), language : 'c')
|
||||||
@@ -343,7 +360,9 @@ pkgconfig.generate(
|
|||||||
name : 'libalpm',
|
name : 'libalpm',
|
||||||
description : 'Arch Linux package management library',
|
description : 'Arch Linux package management library',
|
||||||
version : libalpm_version,
|
version : libalpm_version,
|
||||||
url : 'http://archlinux.org/pacman/')
|
url : 'http://archlinux.org/pacman/',
|
||||||
|
extra_cflags: [ '-D_FILE_OFFSET_BITS=64' ],
|
||||||
|
)
|
||||||
|
|
||||||
pacman_bin = executable(
|
pacman_bin = executable(
|
||||||
'pacman',
|
'pacman',
|
||||||
@@ -401,6 +420,12 @@ configure_file(
|
|||||||
configuration : substs,
|
configuration : substs,
|
||||||
install_dir : SYSCONFDIR)
|
install_dir : SYSCONFDIR)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
input : 'etc/makepkg.conf.d/rust.conf.in',
|
||||||
|
output : 'rust.conf',
|
||||||
|
configuration : substs,
|
||||||
|
install_dir : join_paths(SYSCONFDIR, 'makepkg.conf.d/'))
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
input : 'etc/pacman.conf.in',
|
input : 'etc/pacman.conf.in',
|
||||||
output : 'pacman.conf',
|
output : 'pacman.conf',
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ changelog=
|
|||||||
source=("$pkgbase-$pkgver.tar.gz"
|
source=("$pkgbase-$pkgver.tar.gz"
|
||||||
"$pkgname-$pkgver.patch")
|
"$pkgname-$pkgver.patch")
|
||||||
noextract=()
|
noextract=()
|
||||||
md5sums=()
|
sha256sums=()
|
||||||
validpgpkeys=()
|
validpgpkeys=()
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ options=()
|
|||||||
install=
|
install=
|
||||||
source=('FOLDER::VCS+URL#FRAGMENT')
|
source=('FOLDER::VCS+URL#FRAGMENT')
|
||||||
noextract=()
|
noextract=()
|
||||||
md5sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
# Please refer to the 'USING VCS SOURCES' section of the PKGBUILD man page for
|
# Please refer to the 'USING VCS SOURCES' section of the PKGBUILD man page for
|
||||||
# a description of each element in the source array.
|
# a description of each element in the source array.
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ changelog=
|
|||||||
source=("$pkgname-$pkgver.tar.gz"
|
source=("$pkgname-$pkgver.tar.gz"
|
||||||
"$pkgname-$pkgver.patch")
|
"$pkgname-$pkgver.patch")
|
||||||
noextract=()
|
noextract=()
|
||||||
md5sums=()
|
sha256sums=()
|
||||||
validpgpkeys=()
|
validpgpkeys=()
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
|
|||||||
@@ -553,7 +553,7 @@ _pacman_conf_directive() {
|
|||||||
|
|
||||||
_pacman_conf_commands=(
|
_pacman_conf_commands=(
|
||||||
{-l,--repo-list}'[List configured repositories]:*: :->repo_list'
|
{-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'
|
{-V,--version}'[Display version and exit]:*: :->complete'
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -564,7 +564,7 @@ _pacman_conf_options=(
|
|||||||
|
|
||||||
_pacman_conf_options_common=(
|
_pacman_conf_options_common=(
|
||||||
'*'{-c,--config=}'[Specify an alternate configuration file]: :_files'
|
'*'{-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() {
|
_pacman_conf() {
|
||||||
@@ -586,38 +586,38 @@ _pacman_conf() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_key_shortopts=(
|
_pacman_key_shortopts=(
|
||||||
'-h[show help]'
|
'-h[show help]'
|
||||||
'-a[Add the specified keys (empty for stdin)]: :_files'
|
'-a[Add the specified keys (empty for stdin)]: :_files'
|
||||||
'-d[Remove the Specified keyids]:*: :_keys'
|
'-d[Remove the Specified keyids]:*: :_pacman_key_list'
|
||||||
'-e[Export the specified or all keyids]:*: :_keys'
|
'-e[Export the specified or all keyids]:*: :_pacman_key_list'
|
||||||
'-f[List fingerprint for specified or all keyids]:*: :_keys'
|
'-f[List fingerprint for specified or all keyids]:*: :_pacman_key_list'
|
||||||
'-l[List the specified or all keys]:*: :_keys'
|
'-l[List the specified or all keys]:*: :_pacman_key_list'
|
||||||
'-r[Fetch the specified keyids]:*: :_keys'
|
'-r[Fetch the specified keyids]:*: :_pacman_key_list'
|
||||||
'-u[Update the trustdb of pacman]'
|
'-u[Update the trustdb of pacman]'
|
||||||
'-v[Verify the file specified by the signature]: :_files -g "*.sig"'
|
'-v[Verify the file specified by the signature]: :_files -g "*.sig"'
|
||||||
'-V[Show program version]'
|
'-V[Show program version]'
|
||||||
)
|
)
|
||||||
|
|
||||||
_key_longopts=(
|
_pacman_key_longopts=(
|
||||||
'--help[show help]'
|
'--help[show help]'
|
||||||
'--add[Add the specified keys (empty for stdin)]: :_files'
|
'--add[Add the specified keys (empty for stdin)]: :_files'
|
||||||
'--delete[Remove the Specified keyids]:*: :_keys'
|
'--delete[Remove the Specified keyids]:*: :_pacman_key_list'
|
||||||
'--export[Export the specified or all keyids]:*: :_keys'
|
'--export[Export the specified or all keyids]:*: :_pacman_key_list'
|
||||||
'--finger[List fingerprint for specified or all keyids]:*: :_keys'
|
'--finger[List fingerprint for specified or all keyids]:*: :_pacman_key_list'
|
||||||
'--list-keys[List the specified or all keys]:*: :_keys'
|
'--list-keys[List the specified or all keys]:*: :_pacman_key_list'
|
||||||
'--recv-keys[Fetch the specified keyids]:*: :_keys'
|
'--recv-keys[Fetch the specified keyids]:*: :_pacman_key_list'
|
||||||
'--updatedb[Update the trustdb of pacman]'
|
'--updatedb[Update the trustdb of pacman]'
|
||||||
'--verify[Verify the file specified by the signature]: :_files -g "*.sig"'
|
'--verify[Verify the file specified by the signature]: :_files -g "*.sig"'
|
||||||
'--version[Show program version]'
|
'--version[Show program version]'
|
||||||
'--edit-key[Present a menu for key management task on keyids]:*: :_keys'
|
'--edit-key[Present a menu for key management task on keyids]:*: :_pacman_key_list'
|
||||||
'--import[Imports pubring.gpg from dir(s)]: :_files -g "*.gpg"'
|
'--import[Imports pubring.gpg from dir(s)]: :_files -g "*.gpg"'
|
||||||
'--import-tb[Imports ownertrust values from trustdb.gpg in dir(s)]: :_files -g "*.gpg"'
|
'--import-tb[Imports ownertrust values from trustdb.gpg in dir(s)]: :_files -g "*.gpg"'
|
||||||
'--init[Ensure the keyring is properly initialized]'
|
'--init[Ensure the keyring is properly initialized]'
|
||||||
'--list-sigs[List keys and their signatures]:*: :_keys'
|
'--list-sigs[List keys and their signatures]:*: :_pacman_key_list'
|
||||||
'--lsign-key[Locally sign the specified keyid]:*: :_keys'
|
'--lsign-key[Locally sign the specified keyid]:*: :_pacman_key_list'
|
||||||
'--populate[Reload the default keys from the (given) keyrings in '@keyringdir@']: :_path_files -W @keyringdir@'
|
'--populate[Reload the default keys from the (given) keyrings in '@keyringdir@']: :_path_files -W @keyringdir@'
|
||||||
'--refresh-keys[Update specified or all keys from a keyserver]:*: :_keys'
|
'--refresh-keys[Update specified or all keys from a keyserver]:*: :_pacman_key_list'
|
||||||
)
|
)
|
||||||
|
|
||||||
_pacman_key_options=(
|
_pacman_key_options=(
|
||||||
@@ -631,13 +631,13 @@ _pacman_key() {
|
|||||||
--*)
|
--*)
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_key_options[@]" \
|
"$_pacman_key_options[@]" \
|
||||||
"$_key_longopts[@]"
|
"$_pacman_key_longopts[@]"
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_key_options[@]" \
|
"$_pacman_key_options[@]" \
|
||||||
"$_key_shortopts[@]" \
|
"$_pacman_key_shortopts[@]" \
|
||||||
"$_key_longopts[@]"
|
"$_pacman_key_longopts[@]"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
i=$#
|
i=$#
|
||||||
@@ -648,13 +648,13 @@ _pacman_key() {
|
|||||||
--*)
|
--*)
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_key_options[@]" \
|
"$_pacman_key_options[@]" \
|
||||||
"$_key_longopts[@]"
|
"$_pacman_key_longopts[@]"
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_key_options[@]" \
|
"$_pacman_key_options[@]" \
|
||||||
"$_key_shortopts[@]" \
|
"$_pacman_key_shortopts[@]" \
|
||||||
"$_key_longopts[@]"
|
"$_pacman_key_longopts[@]"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
return 1
|
return 1
|
||||||
@@ -664,7 +664,7 @@ _pacman_key() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_keys() {
|
_pacman_key_list() {
|
||||||
local keylist keys
|
local keylist keys
|
||||||
keylist=$(pacman-key --list-keys 2>/dev/null | awk '
|
keylist=$(pacman-key --list-keys 2>/dev/null | awk '
|
||||||
$1 == "pub" {
|
$1 == "pub" {
|
||||||
@@ -733,7 +733,7 @@ _makepkg_longopts=(
|
|||||||
'--check[Run check() function in the PKGBUILD]'
|
'--check[Run check() function in the PKGBUILD]'
|
||||||
'--config[Use an alternate config file instead of '@sysconfdir@/makepkg.conf']: :_files'
|
'--config[Use an alternate config file instead of '@sysconfdir@/makepkg.conf']: :_files'
|
||||||
'--holdver[Do not update VCS sources]'
|
'--holdver[Do not update VCS sources]'
|
||||||
'--key[Specify key to use for gpg signing instead of the default]: :_keys'
|
'--key[Specify key to use for gpg signing instead of the default]: :_pacman_key_list'
|
||||||
'--noarchive[Do not create package archive]'
|
'--noarchive[Do not create package archive]'
|
||||||
'--nocheck[Do not run the check() function in the PKGBUILD]'
|
'--nocheck[Do not run the check() function in the PKGBUILD]'
|
||||||
'--noprepare[Do not run the prepare() function in the PKGBUILD]'
|
'--noprepare[Do not run the prepare() function in the PKGBUILD]'
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
[[ -n "$LIBMAKEPKG_AUTODEP_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_AUTODEP_SH" ]] && return
|
||||||
LIBMAKEPKG_AUTODEP_SH=1
|
LIBMAKEPKG_AUTODEP_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
declare -a autodep_functions
|
declare -a autodep_functions
|
||||||
|
|
||||||
for lib in "$LIBRARY/autodep/"*.sh; do
|
for lib in "$MAKEPKG_LIBRARY/autodep/"*.sh; do
|
||||||
source "$lib"
|
source "$lib"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
[[ -n "$LIBMAKEPKG_AUTODEP_LIBRARY_DEPENDS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_AUTODEP_LIBRARY_DEPENDS_SH" ]] && return
|
||||||
LIBMAKEPKG_AUTODEP_LIBRARY_DEPENDS_SH=1
|
LIBMAKEPKG_AUTODEP_LIBRARY_DEPENDS_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
autodep_functions+=('library_depends')
|
autodep_functions+=('library_depends')
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
[[ -n "$LIBMAKEPKG_AUTODEP_LIBRARY_PROVIDES_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_AUTODEP_LIBRARY_PROVIDES_SH" ]] && return
|
||||||
LIBMAKEPKG_AUTODEP_LIBRARY_PROVIDES_SH=1
|
LIBMAKEPKG_AUTODEP_LIBRARY_PROVIDES_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
autodep_functions+=('library_provides')
|
autodep_functions+=('library_provides')
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ library_provides() {
|
|||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mapfile -t filenames < <(find "$pkgdir/$dir" -type f | LC_ALL=C sort)
|
mapfile -t filenames < <(find "$pkgdir/$dir" -maxdepth 1 -type f | LC_ALL=C sort)
|
||||||
|
|
||||||
for fn in "${filenames[@]}"; do
|
for fn in "${filenames[@]}"; do
|
||||||
# check we have a shared library
|
# check we have a shared library
|
||||||
@@ -44,7 +44,7 @@ library_provides() {
|
|||||||
local sofile=$(LC_ALL=C readelf -d "$fn" 2>/dev/null | sed -n 's/.*Library soname: \[\(.*\)\].*/\1/p')
|
local sofile=$(LC_ALL=C readelf -d "$fn" 2>/dev/null | sed -n 's/.*Library soname: \[\(.*\)\].*/\1/p')
|
||||||
|
|
||||||
if [[ -z "$sofile" ]]; then
|
if [[ -z "$sofile" ]]; then
|
||||||
# the library is not versioned
|
# the library has no soname
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -22,21 +22,25 @@
|
|||||||
[[ -n "$LIBMAKEPKG_BUILDENV_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_BUILDENV_SH" ]] && return
|
||||||
LIBMAKEPKG_BUILDENV_SH=1
|
LIBMAKEPKG_BUILDENV_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
declare -a buildenv_functions build_options
|
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"
|
source "$lib"
|
||||||
done
|
done
|
||||||
|
|
||||||
readonly -a buildenv_functions build_options
|
readonly -a buildenv_functions buildenv_vars build_options
|
||||||
|
|
||||||
prepare_buildenv() {
|
prepare_buildenv() {
|
||||||
|
# ensure this function runs first
|
||||||
|
buildenv_buildflags
|
||||||
|
|
||||||
for func in ${buildenv_functions[@]}; do
|
for func in ${buildenv_functions[@]}; do
|
||||||
$func
|
$func
|
||||||
done
|
done
|
||||||
|
|
||||||
# ensure all necessary build variables are exported
|
# ensure all necessary build variables are exported
|
||||||
export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS RUSTFLAGS MAKEFLAGS CHOST
|
export ${buildenv_vars[@]}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,15 +21,14 @@
|
|||||||
[[ -n "$LIBMAKEPKG_BUILDENV_BUILDFLAGS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_BUILDENV_BUILDFLAGS_SH" ]] && return
|
||||||
LIBMAKEPKG_BUILDENV_BUILDFLAGS_SH=1
|
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')
|
build_options+=('buildflags')
|
||||||
buildenv_functions+=('buildenv_buildflags')
|
|
||||||
|
|
||||||
buildenv_buildflags() {
|
buildenv_buildflags() {
|
||||||
if check_option "buildflags" "n"; then
|
if check_option "buildflags" "n"; then
|
||||||
unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS LTOFLAGS RUSTFLAGS DEBUG_RUSTFLAGS
|
unset ${buildenv_vars[@]}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_BUILDENV_COMPILER_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_BUILDENV_COMPILER_SH" ]] && return
|
||||||
LIBMAKEPKG_BUILDENV_COMPILER_SH=1
|
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')
|
build_options+=('ccache' 'distcc')
|
||||||
buildenv_functions+=('buildenv_ccache' 'buildenv_distcc')
|
buildenv_functions+=('buildenv_ccache' 'buildenv_distcc')
|
||||||
|
|||||||
@@ -22,19 +22,18 @@
|
|||||||
[[ -n "$LIBMAKEPKG_BUILDENV_DEBUGFLAGS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_BUILDENV_DEBUGFLAGS_SH" ]] && return
|
||||||
LIBMAKEPKG_BUILDENV_DEBUGFLAGS_SH=1
|
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_functions+=('buildenv_debugflags')
|
||||||
|
|
||||||
buildenv_debugflags() {
|
buildenv_debugflags() {
|
||||||
if check_option "debug" "y" && ! check_option "buildflags" "n"; then
|
if check_option "debug" "y" && ! check_option "buildflags" "n"; then
|
||||||
DEBUG_CFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
|
append_once DEBUG_CFLAGS "-ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
|
||||||
DEBUG_CXXFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
|
append_once DEBUG_CXXFLAGS "-ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
|
||||||
DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
|
append_once CFLAGS "$DEBUG_CFLAGS"
|
||||||
CFLAGS+=" $DEBUG_CFLAGS"
|
append_once CXXFLAGS "$DEBUG_CXXFLAGS"
|
||||||
CXXFLAGS+=" $DEBUG_CXXFLAGS"
|
|
||||||
RUSTFLAGS+=" $DEBUG_RUSTFLAGS"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,17 +22,18 @@
|
|||||||
[[ -n "$LIBMAKEPKG_BUILDENV_LTO_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_BUILDENV_LTO_SH" ]] && return
|
||||||
LIBMAKEPKG_BUILDENV_LTO_SH=1
|
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')
|
build_options+=('lto')
|
||||||
buildenv_functions+=('buildenv_lto')
|
buildenv_functions+=('buildenv_lto')
|
||||||
|
|
||||||
buildenv_lto() {
|
buildenv_lto() {
|
||||||
if check_option "lto" "y" && ! check_option "buildflags" "n"; then
|
if check_option "lto" "y" && ! check_option "buildflags" "n"; then
|
||||||
CFLAGS+=" ${LTOFLAGS:--flto}"
|
append_once CFLAGS "${LTOFLAGS:--flto}"
|
||||||
CXXFLAGS+=" ${LTOFLAGS:--flto}"
|
append_once CXXFLAGS "${LTOFLAGS:--flto}"
|
||||||
LDFLAGS+=" ${LTOFLAGS:--flto}"
|
append_once LDFLAGS "${LTOFLAGS:--flto}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_BUILDENV_MAKEFLAGS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_BUILDENV_MAKEFLAGS_SH" ]] && return
|
||||||
LIBMAKEPKG_BUILDENV_MAKEFLAGS_SH=1
|
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')
|
build_options+=('makeflags')
|
||||||
buildenv_functions+=('buildenv_makeflags')
|
buildenv_functions+=('buildenv_makeflags')
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ sources = [
|
|||||||
'debugflags.sh.in',
|
'debugflags.sh.in',
|
||||||
'lto.sh.in',
|
'lto.sh.in',
|
||||||
'makeflags.sh.in',
|
'makeflags.sh.in',
|
||||||
|
'rust.sh.in',
|
||||||
]
|
]
|
||||||
|
|
||||||
foreach src : sources
|
foreach src : sources
|
||||||
|
|||||||
37
scripts/libmakepkg/buildenv/rust.sh.in
Normal file
37
scripts/libmakepkg/buildenv/rust.sh.in
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
#
|
||||||
|
# rust.sh - Specify flags for building a package with rust
|
||||||
|
#
|
||||||
|
# Copyright (c) 2022 Pacman Development Team <pacman-dev@lists.archlinux.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
[[ -n "$LIBMAKEPKG_BUILDENV_RUST_SH" ]] && return
|
||||||
|
LIBMAKEPKG_BUILDENV_RUST_SH=1
|
||||||
|
|
||||||
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
|
source "$MAKEPKG_LIBRARY/util/option.sh"
|
||||||
|
source "$MAKEPKG_LIBRARY/util/util.sh"
|
||||||
|
|
||||||
|
buildenv_vars+=('RUSTFLAGS' 'DEBUG_RUSTFLAGS')
|
||||||
|
buildenv_functions+=('buildenv_rust')
|
||||||
|
|
||||||
|
buildenv_rust() {
|
||||||
|
if check_option "debug" "y" && ! check_option "buildflags" "n"; then
|
||||||
|
append_once DEBUG_RUSTFLAGS "--remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
|
||||||
|
append_once RUSTFLAGS "$DEBUG_RUSTFLAGS"
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_SH=1
|
LIBMAKEPKG_EXECUTABLE_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
declare -a executable_functions
|
declare -a executable_functions
|
||||||
|
|
||||||
for lib in "$LIBRARY/executable/"*.sh; do
|
for lib in "$MAKEPKG_LIBRARY/executable/"*.sh; do
|
||||||
source "$lib"
|
source "$lib"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_CCACHE_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_CCACHE_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_CCACHE_SH=1
|
LIBMAKEPKG_EXECUTABLE_CCACHE_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/option.sh"
|
source "$MAKEPKG_LIBRARY/util/option.sh"
|
||||||
|
|
||||||
executable_functions+=('executable_ccache')
|
executable_functions+=('executable_ccache')
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_CHECKSUM_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_CHECKSUM_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_CHECKSUM_SH=1
|
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')
|
executable_functions+=('executable_checksum')
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_DEBUGEDIT_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_DEBUGEDIT_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_DEBUGEDIT_SH=1
|
LIBMAKEPKG_EXECUTABLE_DEBUGEDIT_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/option.sh"
|
source "$MAKEPKG_LIBRARY/util/option.sh"
|
||||||
|
|
||||||
executable_functions+=('executable_debugedit')
|
executable_functions+=('executable_debugedit')
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_DISTCC_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_DISTCC_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_DISTCC_SH=1
|
LIBMAKEPKG_EXECUTABLE_DISTCC_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/option.sh"
|
source "$MAKEPKG_LIBRARY/util/option.sh"
|
||||||
|
|
||||||
executable_functions+=('executable_distcc')
|
executable_functions+=('executable_distcc')
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_FAKEROOT_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_FAKEROOT_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_FAKEROOT_SH=1
|
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')
|
executable_functions+=('executable_fakeroot')
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_GPG_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_GPG_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_GPG_SH=1
|
LIBMAKEPKG_EXECUTABLE_GPG_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/option.sh"
|
source "$MAKEPKG_LIBRARY/util/option.sh"
|
||||||
|
|
||||||
executable_functions+=('executable_gpg')
|
executable_functions+=('executable_gpg')
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_GZIP_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_GZIP_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_GZIP_SH=1
|
LIBMAKEPKG_EXECUTABLE_GZIP_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/option.sh"
|
source "$MAKEPKG_LIBRARY/util/option.sh"
|
||||||
|
|
||||||
executable_functions+=('executable_gzip')
|
executable_functions+=('executable_gzip')
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_PACMAN_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_PACMAN_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_PACMAN_SH=1
|
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')
|
executable_functions+=('executable_pacman')
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_STRIP_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_STRIP_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_STRIP_SH=1
|
LIBMAKEPKG_EXECUTABLE_STRIP_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/option.sh"
|
source "$MAKEPKG_LIBRARY/util/option.sh"
|
||||||
|
|
||||||
executable_functions+=('executable_strip')
|
executable_functions+=('executable_strip')
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_SUDO_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_SUDO_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_SUDO_SH=1
|
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')
|
executable_functions+=('executable_sudo')
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_EXECUTABLE_VCS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_EXECUTABLE_VCS_SH" ]] && return
|
||||||
LIBMAKEPKG_EXECUTABLE_VCS_SH=1
|
LIBMAKEPKG_EXECUTABLE_VCS_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/error.sh"
|
source "$MAKEPKG_LIBRARY/util/error.sh"
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
|
|
||||||
executable_functions+=('executable_vcs')
|
executable_functions+=('executable_vcs')
|
||||||
|
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
[[ -n "$LIBMAKEPKG_INTEGRITY_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_INTEGRITY_SH" ]] && return
|
||||||
LIBMAKEPKG_INTEGRITY_SH=1
|
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"
|
source "$lib"
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -42,4 +42,7 @@ check_source_integrity() {
|
|||||||
check_checksums "$@"
|
check_checksums "$@"
|
||||||
check_pgpsigs "$@"
|
check_pgpsigs "$@"
|
||||||
fi
|
fi
|
||||||
|
if (( VERIFYFUNC )); then
|
||||||
|
run_verify
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
[[ -n "$LIBMAKEPKG_INTEGRITY_GENERATE_CHECKSUM_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_INTEGRITY_GENERATE_CHECKSUM_SH" ]] && return
|
||||||
LIBMAKEPKG_INTEGRITY_GENERATE_CHECKSUM_SH=1
|
LIBMAKEPKG_INTEGRITY_GENERATE_CHECKSUM_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
source "$LIBRARY/util/schema.sh"
|
source "$MAKEPKG_LIBRARY/util/schema.sh"
|
||||||
|
|
||||||
generate_one_checksum() {
|
generate_one_checksum() {
|
||||||
local integ=$1 arch=$2 sources numsrc indentsz idx
|
local integ=$1 arch=$2 sources numsrc indentsz idx
|
||||||
@@ -54,7 +54,17 @@ generate_one_checksum() {
|
|||||||
|
|
||||||
case $proto in
|
case $proto in
|
||||||
bzr|git|hg|svn)
|
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
|
if [[ ${netfile%%::*} != *.@(sig?(n)|asc) ]]; then
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_INTEGRITY_GENERATE_SIGNATURE_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_INTEGRITY_GENERATE_SIGNATURE_SH" ]] && return
|
||||||
LIBMAKEPKG_INTEGRITY_GENERATE_SIGNATURE_SH=1
|
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() {
|
create_signature() {
|
||||||
local ret=0
|
local ret=0
|
||||||
|
|||||||
@@ -21,11 +21,12 @@
|
|||||||
[[ -n "$LIBMAKEPKG_INTEGRITY_VERIFY_CHECKSUM_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_INTEGRITY_VERIFY_CHECKSUM_SH" ]] && return
|
||||||
LIBMAKEPKG_INTEGRITY_CHECKSUM_SH=1
|
LIBMAKEPKG_INTEGRITY_CHECKSUM_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
source "$LIBRARY/util/schema.sh"
|
source "$MAKEPKG_LIBRARY/util/schema.sh"
|
||||||
|
source "$MAKEPKG_LIBRARY/source.sh"
|
||||||
|
|
||||||
check_checksums() {
|
check_checksums() {
|
||||||
local integ a
|
local integ a
|
||||||
@@ -68,9 +69,9 @@ check_checksums() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
verify_integrity_one() {
|
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
|
printf ' %s ... ' "$file" >&2
|
||||||
|
|
||||||
if [[ $expectedsum = 'SKIP' ]]; then
|
if [[ $expectedsum = 'SKIP' ]]; then
|
||||||
@@ -78,20 +79,18 @@ verify_integrity_one() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! file="$(get_filepath "$file")"; then
|
proto="$(get_protocol "$source_name")"
|
||||||
printf '%s\n' "$(gettext "NOT FOUND")" >&2
|
if declare -f "calc_checksum_${proto}" > /dev/null; then
|
||||||
return 1
|
realsum=$("calc_checksum_${proto}" "$source_name" "$integ") || return 1
|
||||||
|
else
|
||||||
|
realsum=$(calc_checksum_file "$source_name" "$integ") || return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local realsum="$("${integ}sum" "$file")"
|
if [[ ${expectedsum,,} != "$realsum" ]]; then
|
||||||
realsum="${realsum%% *}"
|
|
||||||
if [[ ${expectedsum,,} = "$realsum" ]]; then
|
|
||||||
printf '%s\n' "$(gettext "Passed")" >&2
|
|
||||||
else
|
|
||||||
printf '%s\n' "$(gettext "FAILED")" >&2
|
printf '%s\n' "$(gettext "FAILED")" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
printf '%s\n' "$(gettext "Passed")" >&2
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,16 @@
|
|||||||
[[ -n "$LIBMAKEPKG_INTEGRITY_VERIFY_SIGNATURE_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_INTEGRITY_VERIFY_SIGNATURE_SH" ]] && return
|
||||||
LIBMAKEPKG_INTEGRITY_VERIFY_SIGNATURE_SH=1
|
LIBMAKEPKG_INTEGRITY_VERIFY_SIGNATURE_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
# Filter the contents of a GnuPG statusfile to only contain understood terms to narrow the file's scope and circumvent
|
||||||
|
# the use of terms (e.g. NOTATION_DATA) that may contain unescaped binary data
|
||||||
|
filter_gnupg_statusfile() {
|
||||||
|
grep -E "(.*SIG| TRUST_.*)"
|
||||||
|
}
|
||||||
|
|
||||||
check_pgpsigs() {
|
check_pgpsigs() {
|
||||||
(( SKIPPGPCHECK )) && return 0
|
(( SKIPPGPCHECK )) && return 0
|
||||||
@@ -35,6 +41,7 @@ check_pgpsigs() {
|
|||||||
local netfile proto pubkey success status fingerprint trusted
|
local netfile proto pubkey success status fingerprint trusted
|
||||||
local warnings=0
|
local warnings=0
|
||||||
local errors=0
|
local errors=0
|
||||||
|
local statusfile_raw="$(mktemp)"
|
||||||
local statusfile=$(mktemp)
|
local statusfile=$(mktemp)
|
||||||
local all_sources
|
local all_sources
|
||||||
|
|
||||||
@@ -103,7 +110,7 @@ check_pgpsigs() {
|
|||||||
printf '\n' >&2
|
printf '\n' >&2
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -f "$statusfile"
|
rm -f "$statusfile" "$statusfile_raw"
|
||||||
|
|
||||||
if (( errors )); then
|
if (( errors )); then
|
||||||
error "$(gettext "One or more PGP signatures could not be verified!")"
|
error "$(gettext "One or more PGP signatures could not be verified!")"
|
||||||
@@ -157,7 +164,20 @@ verify_file_signature() {
|
|||||||
"") decompress="cat" ;;
|
"") decompress="cat" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
$decompress < "$sourcefile" | gpg --quiet --batch --status-file "$statusfile" --verify "$file" - 2> /dev/null
|
# verify the signature and write metadata to a status file
|
||||||
|
if ! $decompress < "$sourcefile" | gpg --quiet --batch --status-file "$statusfile_raw" --verify "$file" - 2> /dev/null; then
|
||||||
|
printf '%s\n' "$(gettext "%s is unable to verify the signature.")" "gpg" >&2
|
||||||
|
errors=1
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create a statusfile that contains only understood terms
|
||||||
|
if ! filter_gnupg_statusfile > "$statusfile" < "$statusfile_raw"; then
|
||||||
|
printf '%s\n' "$(gettext "unable to extract signature metadata.")" >&2
|
||||||
|
errors=1
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,18 +209,33 @@ verify_git_signature() {
|
|||||||
|
|
||||||
printf " %s git repo ... " "${dir##*/}" >&2
|
printf " %s git repo ... " "${dir##*/}" >&2
|
||||||
|
|
||||||
git -C "$dir" verify-$fragtype --raw "$fragval" > "$statusfile" 2>&1
|
# verify the signature and write metadata to a status file
|
||||||
if ! grep -qs NEWSIG "$statusfile"; then
|
if ! git -C "$dir" verify-$fragtype --raw "$fragval" > "$statusfile_raw" 2>&1; then
|
||||||
printf '%s\n' "$(gettext "SIGNATURE NOT FOUND")" >&2
|
printf '%s\n' "$(gettext "%s is unable to verify the signature.")" "git" >&2
|
||||||
errors=1
|
errors=1
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# create a statusfile that contains only understood terms
|
||||||
|
if ! filter_gnupg_statusfile > "$statusfile" < "$statusfile_raw"; then
|
||||||
|
printf '%s\n' "$(gettext "unable to extract signature metadata.")" >&2
|
||||||
|
errors=1
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_gpg_statusfile() {
|
parse_gpg_statusfile() {
|
||||||
local type arg1 arg6 arg10
|
local type arg1 arg6 arg10
|
||||||
|
|
||||||
|
# ensure the NEWSIG keyword is part of the metadata
|
||||||
|
if ! grep -qs NEWSIG "$statusfile"; then
|
||||||
|
printf '%s\n' "$(gettext "SIGNATURE NOT FOUND")" >&2
|
||||||
|
errors=1
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
while read -r _ type arg1 _ _ _ _ arg6 _ _ _ arg10 _; do
|
while read -r _ type arg1 _ _ _ _ arg6 _ _ _ arg10 _; do
|
||||||
case "$type" in
|
case "$type" in
|
||||||
GOODSIG)
|
GOODSIG)
|
||||||
|
|||||||
@@ -21,15 +21,15 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_CONFIG_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_CONFIG_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_CONFIG_SH=1
|
LIBMAKEPKG_LINT_CONFIG_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'/usr/share/makepkg'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'/usr/share/makepkg'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/util.sh"
|
source "$MAKEPKG_LIBRARY/util/util.sh"
|
||||||
|
|
||||||
|
|
||||||
declare -a lint_config_functions
|
declare -a lint_config_functions
|
||||||
|
|
||||||
for lib in "$LIBRARY/lint_config/"*.sh; do
|
for lib in "$MAKEPKG_LIBRARY/lint_config/"*.sh; do
|
||||||
source "$lib"
|
source "$lib"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_CONFIG_EXT_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_CONFIG_EXT_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_CONFIG_EXT_SH=1
|
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')
|
lint_config_functions+=('lint_ext')
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_CONFIG_PATHS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_CONFIG_PATHS_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_CONFIG_PATHS_SH=1
|
LIBMAKEPKG_LINT_CONFIG_PATHS_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
lint_config_functions+=('lint_paths')
|
lint_config_functions+=('lint_paths')
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n $LIBMAKEPKG_LINT_CONFIG_SOURCE_DATE_EPOCH_SH ]] && return
|
[[ -n $LIBMAKEPKG_LINT_CONFIG_SOURCE_DATE_EPOCH_SH ]] && return
|
||||||
LIBMAKEPKG_LINT_CONFIG_SOURCE_DATE_EPOCH_SH=1
|
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')
|
lint_config_functions+=('lint_source_date_epoch')
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_CONFIG_VARIABLE_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_CONFIG_VARIABLE_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_CONFIG_VARIABLE_SH=1
|
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')
|
lint_config_functions+=('lint_config_variables')
|
||||||
|
|
||||||
@@ -32,10 +32,10 @@ lint_config_variables() {
|
|||||||
local array=(DLAGENTS VCSCLIENTS BUILDENV OPTIONS INTEGRITY_CHECK MAN_DIRS
|
local array=(DLAGENTS VCSCLIENTS BUILDENV OPTIONS INTEGRITY_CHECK MAN_DIRS
|
||||||
DOC_DIRS PURGE_TARGETS COMPRESSGZ COMPRESSBZ2 COMPRESSXZ
|
DOC_DIRS PURGE_TARGETS COMPRESSGZ COMPRESSBZ2 COMPRESSXZ
|
||||||
COMPRESSLRZ COMPRESSLZO COMPRESSZ)
|
COMPRESSLRZ COMPRESSLZO COMPRESSZ)
|
||||||
local string=(CARCH CHOST CPPFLAGS CFLAGS CXXFLAGS RUSTFLAGS LDFLAGS LTOFLAGS
|
local string=(CARCH CHOST CPPFLAGS CFLAGS CXXFLAGS LDFLAGS LTOFLAGS DEBUG_CFLAGS
|
||||||
DEBUG_CFLAGS DEBUG_CXXFLAGS DEBUG_RUSTFLAGS DISTCC_HOSTS BUILDDIR
|
DEBUG_CXXFLAGS DISTCC_HOSTS BUILDDIR STRIP_BINARIES STRIP_SHARED
|
||||||
STRIP_BINARIES STRIP_SHARED STRIP_STATIC PKGDEST SRCDEST SRCPKGDEST
|
STRIP_STATIC PKGDEST SRCDEST SRCPKGDEST LOGDEST PACKAGER GPGKEY
|
||||||
LOGDEST PACKAGER GPGKEY PKGEXT SRCEXT)
|
PKGEXT SRCEXT)
|
||||||
|
|
||||||
local i keys ret=0
|
local i keys ret=0
|
||||||
|
|
||||||
|
|||||||
@@ -21,15 +21,15 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PACKAGE_SH=1
|
LIBMAKEPKG_LINT_PACKAGE_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/util.sh"
|
source "$MAKEPKG_LIBRARY/util/util.sh"
|
||||||
|
|
||||||
|
|
||||||
declare -a lint_package_functions
|
declare -a lint_package_functions
|
||||||
|
|
||||||
for lib in "$LIBRARY/lint_package/"*.sh; do
|
for lib in "$MAKEPKG_LIBRARY/lint_package/"*.sh; do
|
||||||
source "$lib"
|
source "$lib"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_BUILD_REFERENCES_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_BUILD_REFERENCES_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PACKAGE_BUILD_REFERENCES_SH=1
|
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')
|
lint_package_functions+=('warn_build_references')
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_DOTFILES_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_DOTFILES_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PACKAGE_DOTFILES_SH=1
|
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')
|
lint_package_functions+=('check_dotfiles')
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_FILE_NAMES_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_FILE_NAMES_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PACKAGE_FILE_NAMES_SH=1
|
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')
|
lint_package_functions+=('lint_file_names')
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_MISSING_BACKUP_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PACKAGE_MISSING_BACKUP_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PACKAGE_MISSING_BACKUP_SH=1
|
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')
|
lint_package_functions+=('warn_missing_backup')
|
||||||
|
|||||||
@@ -21,14 +21,14 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_SH=1
|
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
|
declare -a lint_pkgbuild_functions
|
||||||
|
|
||||||
for lib in "$LIBRARY/lint_pkgbuild/"*.sh; do
|
for lib in "$MAKEPKG_LIBRARY/lint_pkgbuild/"*.sh; do
|
||||||
source "$lib"
|
source "$lib"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_ARCH_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_ARCH_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_ARCH_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_ARCH_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_arch')
|
lint_pkgbuild_functions+=('lint_arch')
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_ARCH_SPECIFIC_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_ARCH_SPECIFIC_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_ARCH_SPECIFIC_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_ARCH_SPECIFIC_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
source "$LIBRARY/util/schema.sh"
|
source "$MAKEPKG_LIBRARY/util/schema.sh"
|
||||||
source "$LIBRARY/util/util.sh"
|
source "$MAKEPKG_LIBRARY/util/util.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_arch_specific')
|
lint_pkgbuild_functions+=('lint_arch_specific')
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_BACKUP_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_BACKUP_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_BACKUP_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_BACKUP_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_backup')
|
lint_pkgbuild_functions+=('lint_backup')
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CHANGELOG_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CHANGELOG_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_CHANGELOG_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_CHANGELOG_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
source "$LIBRARY/lint_pkgbuild/util.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/util.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_changelog')
|
lint_pkgbuild_functions+=('lint_changelog')
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_checkdepends')
|
lint_pkgbuild_functions+=('lint_checkdepends')
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_conflicts')
|
lint_pkgbuild_functions+=('lint_conflicts')
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_depends')
|
lint_pkgbuild_functions+=('lint_depends')
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_EPOCH_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_EPOCH_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_EPOCH_SH=1
|
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')
|
lint_pkgbuild_functions+=('lint_epoch')
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_FULLPKGVER_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_FULLPKGVER_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_FULLPKGVER_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_FULLPKGVER_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/lint_pkgbuild/epoch.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/epoch.sh"
|
||||||
source "$LIBRARY/lint_pkgbuild/pkgrel.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgrel.sh"
|
||||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||||
|
|
||||||
|
|
||||||
check_fullpkgver() {
|
check_fullpkgver() {
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_INSTALL_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_INSTALL_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_INSTALL_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_INSTALL_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
source "$LIBRARY/lint_pkgbuild/util.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/util.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_install')
|
lint_pkgbuild_functions+=('lint_install')
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_makedepends')
|
lint_pkgbuild_functions+=('lint_makedepends')
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_optdepends')
|
lint_pkgbuild_functions+=('lint_optdepends')
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_OPTIONS_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_OPTIONS_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_OPTIONS_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_OPTIONS_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_options')
|
lint_pkgbuild_functions+=('lint_options')
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_package_function')
|
lint_pkgbuild_functions+=('lint_package_function')
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
source "$LIBRARY/util/pkgbuild.sh"
|
source "$MAKEPKG_LIBRARY/util/pkgbuild.sh"
|
||||||
source "$LIBRARY/util/schema.sh"
|
source "$MAKEPKG_LIBRARY/util/schema.sh"
|
||||||
source "$LIBRARY/util/util.sh"
|
source "$MAKEPKG_LIBRARY/util/util.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_package_function_variable')
|
lint_pkgbuild_functions+=('lint_package_function_variable')
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGBASE_SH" ]] && return
|
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGBASE_SH" ]] && return
|
||||||
LIBMAKEPKG_LINT_PKGBUILD_PKGBASE_SH=1
|
LIBMAKEPKG_LINT_PKGBUILD_PKGBASE_SH=1
|
||||||
|
|
||||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
|
||||||
|
|
||||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
source "$MAKEPKG_LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||||
source "$LIBRARY/util/message.sh"
|
source "$MAKEPKG_LIBRARY/util/message.sh"
|
||||||
|
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_pkgbase')
|
lint_pkgbuild_functions+=('lint_pkgbase')
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user