mirror of
https://gitlab.archlinux.org/pacman/pacman.git
synced 2025-11-03 17:04:40 +01:00
Compare commits
176 Commits
v5.1.0
...
last-delta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
377d47142f | ||
|
|
298bcf7986 | ||
|
|
e03752e6ad | ||
|
|
0113214db9 | ||
|
|
d197d8ab82 | ||
|
|
adb961a88e | ||
|
|
ba7a41031c | ||
|
|
3c774252ef | ||
|
|
656e851f0a | ||
|
|
4b83bcfcee | ||
|
|
477a66cd0e | ||
|
|
86004227d1 | ||
|
|
db102c67ef | ||
|
|
714a1b4e4e | ||
|
|
04e77591d6 | ||
|
|
11bc315cdb | ||
|
|
14755df06f | ||
|
|
75aae126c4 | ||
|
|
6cf0548128 | ||
|
|
776fbe1cde | ||
|
|
5bd54fa0c6 | ||
|
|
1e040153bc | ||
|
|
9c817b6549 | ||
|
|
ac0e21a6df | ||
|
|
1b9e358f1d | ||
|
|
4d1d857ef0 | ||
|
|
ff8c96fa7d | ||
|
|
c15f7ae606 | ||
|
|
a5090217f9 | ||
|
|
10bcf66db8 | ||
|
|
02598521b1 | ||
|
|
a769fbfd40 | ||
|
|
b76dbb1159 | ||
|
|
ce040514c4 | ||
|
|
5d2f7ee6c3 | ||
|
|
031611ff40 | ||
|
|
10fe71e5f3 | ||
|
|
aa284c97f1 | ||
|
|
f7efa6a93d | ||
|
|
30e3e21e87 | ||
|
|
03d85763e0 | ||
|
|
e9d91a688d | ||
|
|
9b2a90cfb1 | ||
|
|
9b637cc27a | ||
|
|
f9eb2aacb4 | ||
|
|
238fa4af45 | ||
|
|
268b0255fa | ||
|
|
c5c7fc7f4a | ||
|
|
2f15921230 | ||
|
|
7c5958e0eb | ||
|
|
e1fc2f901e | ||
|
|
3a5a0d53bc | ||
|
|
984492b92f | ||
|
|
4778f13188 | ||
|
|
2d403709d9 | ||
|
|
ecac357c1a | ||
|
|
d150b97190 | ||
|
|
33a8ced334 | ||
|
|
6b541404cc | ||
|
|
281cdb2e1c | ||
|
|
b109d7096b | ||
|
|
77b8ca7032 | ||
|
|
d73fed4e13 | ||
|
|
b67ec90520 | ||
|
|
36a5069a59 | ||
|
|
f28ddd9d93 | ||
|
|
9f1b735d76 | ||
|
|
65e09705d3 | ||
|
|
f615f7bd5a | ||
|
|
5fc3056e6a | ||
|
|
e1b9dc6bea | ||
|
|
71f837e45e | ||
|
|
83a16d3041 | ||
|
|
363664e47d | ||
|
|
fbc6d8b428 | ||
|
|
6e819c819a | ||
|
|
b95ba13df1 | ||
|
|
44cfc09511 | ||
|
|
61fe738043 | ||
|
|
3726693612 | ||
|
|
508b4e3ec0 | ||
|
|
0bb04fa16a | ||
|
|
d81b5cc2a5 | ||
|
|
1aaf95089a | ||
|
|
926eb345c2 | ||
|
|
c41222837d | ||
|
|
0dd1492442 | ||
|
|
de915c4f14 | ||
|
|
3dfec574a3 | ||
|
|
635a9c911c | ||
|
|
d230ec6f17 | ||
|
|
51db84750e | ||
|
|
dab45f0808 | ||
|
|
b5d62d2c91 | ||
|
|
3561c872ca | ||
|
|
882e707e40 | ||
|
|
b5191ea140 | ||
|
|
e12d032174 | ||
|
|
ea877c596b | ||
|
|
c887d2cf00 | ||
|
|
ac959bb9c6 | ||
|
|
9886566abb | ||
|
|
2c91d08e62 | ||
|
|
79a528735e | ||
|
|
02255fd97e | ||
|
|
8c9046e604 | ||
|
|
afb9c0140f | ||
|
|
ffde85aadf | ||
|
|
d96d0ffe7c | ||
|
|
7afe51171f | ||
|
|
bae74c8e9e | ||
|
|
cd7b2d6e07 | ||
|
|
192d6166e9 | ||
|
|
b54b33d816 | ||
|
|
3d5a056452 | ||
|
|
961ef1a4c8 | ||
|
|
2bec380e10 | ||
|
|
3318039e3b | ||
|
|
ba2984db3e | ||
|
|
58c76daf5e | ||
|
|
d03409ccde | ||
|
|
62eef5bbdb | ||
|
|
5b2ff51c39 | ||
|
|
16f6aae330 | ||
|
|
48c8f9f2a2 | ||
|
|
0696307a3b | ||
|
|
3370c08a29 | ||
|
|
3e9a62e721 | ||
|
|
9fde55c0c7 | ||
|
|
8b2f3323b8 | ||
|
|
2d8d8af915 | ||
|
|
7d05ffceaf | ||
|
|
e4be26b732 | ||
|
|
4e83abaae5 | ||
|
|
92bc0a4740 | ||
|
|
b0a8f44f10 | ||
|
|
885bbb504a | ||
|
|
9e960d9d5a | ||
|
|
7f1f1355bb | ||
|
|
0937d322ba | ||
|
|
7edbbd9a63 | ||
|
|
f2788244d3 | ||
|
|
0cbb128818 | ||
|
|
fd16da2ed6 | ||
|
|
7e081d2adf | ||
|
|
1a5f308d52 | ||
|
|
2d8a751943 | ||
|
|
13fb2430e8 | ||
|
|
0827aff85e | ||
|
|
316b031b7c | ||
|
|
757e85b21d | ||
|
|
41cbea29b4 | ||
|
|
0adb36346c | ||
|
|
acef70c103 | ||
|
|
8b4be66a30 | ||
|
|
9a8c7154b1 | ||
|
|
4fe9adf418 | ||
|
|
0d6e82d374 | ||
|
|
d750c854bc | ||
|
|
72263e22bd | ||
|
|
a92a36070a | ||
|
|
5cf6f614eb | ||
|
|
793202344b | ||
|
|
e6dbe82c0c | ||
|
|
05a3641c76 | ||
|
|
ab1e92860b | ||
|
|
b37a6063d0 | ||
|
|
f78914cc6e | ||
|
|
de8c5e78bb | ||
|
|
737596f038 | ||
|
|
870d4c8fdd | ||
|
|
c37a06fe1d | ||
|
|
9eb3695a3f | ||
|
|
3a66b93be0 | ||
|
|
930d501947 | ||
|
|
716d776936 |
250
.ycm_extra_conf.py
Normal file
250
.ycm_extra_conf.py
Normal file
@@ -0,0 +1,250 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
#
|
||||
# Based on the template file provided by the 'YCM-Generator' project authored by
|
||||
# Reuben D'Netto.
|
||||
# Jiahui Xie has re-reformatted and expanded the original script in accordance
|
||||
# to the requirements of the PEP 8 style guide and 'systemd' project,
|
||||
# respectively.
|
||||
#
|
||||
# The original license is preserved as it is.
|
||||
#
|
||||
#
|
||||
# This is free and unencumbered software released into the public domain.
|
||||
#
|
||||
# Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
# distribute this software, either in source code form or as a compiled
|
||||
# binary, for any purpose, commercial or non-commercial, and by any
|
||||
# means.
|
||||
#
|
||||
# In jurisdictions that recognize copyright laws, the author or authors
|
||||
# of this software dedicate any and all copyright interest in the
|
||||
# software to the public domain. We make this dedication for the benefit
|
||||
# of the public at large and to the detriment of our heirs and
|
||||
# successors. We intend this dedication to be an overt act of
|
||||
# relinquishment in perpetuity of all present and future rights to this
|
||||
# software under copyright law.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# For more information, please refer to <http://unlicense.org/>
|
||||
|
||||
"""
|
||||
YouCompleteMe configuration file tailored to support the 'meson' build system
|
||||
used by the 'systemd' project.
|
||||
"""
|
||||
|
||||
import glob
|
||||
import os
|
||||
import ycm_core
|
||||
|
||||
|
||||
SOURCE_EXTENSIONS = (".C", ".cpp", ".cxx", ".cc", ".c", ".m", ".mm")
|
||||
HEADER_EXTENSIONS = (".H", ".h", ".hxx", ".hpp", ".hh")
|
||||
|
||||
|
||||
def DirectoryOfThisScript():
|
||||
"""
|
||||
Return the absolute path of the parent directory containing this
|
||||
script.
|
||||
"""
|
||||
return os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def GuessBuildDirectory():
|
||||
"""
|
||||
Guess the build directory using the following heuristics:
|
||||
|
||||
1. Returns the current directory of this script plus 'build'
|
||||
subdirectory in absolute path if this subdirectory exists.
|
||||
|
||||
2. Otherwise, probes whether there exists any directory
|
||||
containing '.ninja_log' file two levels above the current directory;
|
||||
returns this single directory only if there is one candidate.
|
||||
"""
|
||||
result = os.path.join(DirectoryOfThisScript(), "build")
|
||||
|
||||
if os.path.exists(result):
|
||||
return result
|
||||
|
||||
result = glob.glob(os.path.join(DirectoryOfThisScript(),
|
||||
"..", "..", "*", ".ninja_log"))
|
||||
|
||||
if not result:
|
||||
return ""
|
||||
|
||||
if 1 != len(result):
|
||||
return ""
|
||||
|
||||
return os.path.split(result[0])[0]
|
||||
|
||||
|
||||
def TraverseByDepth(root, include_extensions):
|
||||
"""
|
||||
Return a set of child directories of the 'root' containing file
|
||||
extensions specified in 'include_extensions'.
|
||||
|
||||
NOTE:
|
||||
1. The 'root' directory itself is excluded from the result set.
|
||||
2. No subdirectories would be excluded if 'include_extensions' is left
|
||||
to 'None'.
|
||||
3. Each entry in 'include_extensions' must begin with string '.'.
|
||||
"""
|
||||
is_root = True
|
||||
result = set()
|
||||
# Perform a depth first top down traverse of the given directory tree.
|
||||
for root_dir, subdirs, file_list in os.walk(root):
|
||||
if not is_root:
|
||||
# print("Relative Root: ", root_dir)
|
||||
# print(subdirs)
|
||||
if include_extensions:
|
||||
get_ext = os.path.splitext
|
||||
subdir_extensions = {
|
||||
get_ext(f)[-1] for f in file_list if get_ext(f)[-1]
|
||||
}
|
||||
if subdir_extensions & include_extensions:
|
||||
result.add(root_dir)
|
||||
else:
|
||||
result.add(root_dir)
|
||||
else:
|
||||
is_root = False
|
||||
|
||||
return result
|
||||
|
||||
|
||||
_project_src_dir = os.path.join(DirectoryOfThisScript(), "src")
|
||||
_include_dirs_set = TraverseByDepth(_project_src_dir, frozenset({".h"}))
|
||||
flags = [
|
||||
"-x",
|
||||
"c"
|
||||
# The following flags are partially redundant due to the existence of
|
||||
# 'compile_commands.json'.
|
||||
# '-Wall',
|
||||
# '-Wextra',
|
||||
# '-Wfloat-equal',
|
||||
# '-Wpointer-arith',
|
||||
# '-Wshadow',
|
||||
# '-std=gnu99',
|
||||
]
|
||||
|
||||
for include_dir in _include_dirs_set:
|
||||
flags.append("-I" + include_dir)
|
||||
|
||||
# Set this to the absolute path to the folder (NOT the file!) containing the
|
||||
# compile_commands.json file to use that instead of 'flags'. See here for
|
||||
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
|
||||
#
|
||||
# You can get CMake to generate this file for you by adding:
|
||||
# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
|
||||
# to your CMakeLists.txt file.
|
||||
#
|
||||
# Most projects will NOT need to set this to anything; you can just change the
|
||||
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
|
||||
compilation_database_folder = GuessBuildDirectory()
|
||||
|
||||
if os.path.exists(compilation_database_folder):
|
||||
database = ycm_core.CompilationDatabase(compilation_database_folder)
|
||||
else:
|
||||
database = None
|
||||
|
||||
|
||||
def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
|
||||
"""
|
||||
Iterate through 'flags' and replace the relative paths prefixed by
|
||||
'-isystem', '-I', '-iquote', '--sysroot=' with absolute paths
|
||||
start with 'working_directory'.
|
||||
"""
|
||||
if not working_directory:
|
||||
return list(flags)
|
||||
new_flags = []
|
||||
make_next_absolute = False
|
||||
path_flags = ["-isystem", "-I", "-iquote", "--sysroot="]
|
||||
for flag in flags:
|
||||
new_flag = flag
|
||||
|
||||
if make_next_absolute:
|
||||
make_next_absolute = False
|
||||
if not flag.startswith("/"):
|
||||
new_flag = os.path.join(working_directory, flag)
|
||||
|
||||
for path_flag in path_flags:
|
||||
if flag == path_flag:
|
||||
make_next_absolute = True
|
||||
break
|
||||
|
||||
if flag.startswith(path_flag):
|
||||
path = flag[len(path_flag):]
|
||||
new_flag = path_flag + os.path.join(working_directory, path)
|
||||
break
|
||||
|
||||
if new_flag:
|
||||
new_flags.append(new_flag)
|
||||
return new_flags
|
||||
|
||||
|
||||
def IsHeaderFile(filename):
|
||||
"""
|
||||
Check whether 'filename' is considered as a header file.
|
||||
"""
|
||||
extension = os.path.splitext(filename)[1]
|
||||
return extension in HEADER_EXTENSIONS
|
||||
|
||||
|
||||
def GetCompilationInfoForFile(filename):
|
||||
"""
|
||||
Helper function to look up compilation info of 'filename' in the 'database'.
|
||||
"""
|
||||
# The compilation_commands.json file generated by CMake does not have
|
||||
# entries for header files. So we do our best by asking the db for flags for
|
||||
# a corresponding source file, if any. If one exists, the flags for that
|
||||
# file should be good enough.
|
||||
if not database:
|
||||
return None
|
||||
|
||||
if IsHeaderFile(filename):
|
||||
basename = os.path.splitext(filename)[0]
|
||||
for extension in SOURCE_EXTENSIONS:
|
||||
replacement_file = basename + extension
|
||||
if os.path.exists(replacement_file):
|
||||
compilation_info = \
|
||||
database.GetCompilationInfoForFile(replacement_file)
|
||||
if compilation_info.compiler_flags_:
|
||||
return compilation_info
|
||||
return None
|
||||
return database.GetCompilationInfoForFile(filename)
|
||||
|
||||
|
||||
def FlagsForFile(filename, **kwargs):
|
||||
"""
|
||||
Callback function to be invoked by YouCompleteMe in order to get the
|
||||
information necessary to compile 'filename'.
|
||||
|
||||
It returns a dictionary with a single element 'flags'. This element is a
|
||||
list of compiler flags to pass to libclang for the file 'filename'.
|
||||
"""
|
||||
if database:
|
||||
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
|
||||
# python list, but a "list-like" StringVec object
|
||||
compilation_info = GetCompilationInfoForFile(filename)
|
||||
if not compilation_info:
|
||||
return None
|
||||
|
||||
final_flags = MakeRelativePathsInFlagsAbsolute(
|
||||
compilation_info.compiler_flags_,
|
||||
compilation_info.compiler_working_dir_)
|
||||
|
||||
else:
|
||||
relative_to = DirectoryOfThisScript()
|
||||
final_flags = MakeRelativePathsInFlagsAbsolute(flags, relative_to)
|
||||
|
||||
return {
|
||||
"flags": final_flags,
|
||||
"do_cache": True
|
||||
}
|
||||
@@ -9,7 +9,8 @@ ACLOCAL_AMFLAGS = -I m4 --install
|
||||
AM_MAKEFLAGS = --no-print-directory
|
||||
|
||||
# Make sure we test and build manpages when doing distcheck
|
||||
DISTCHECK_CONFIGURE_FLAGS = --enable-doc --disable-git-version
|
||||
DISTCHECK_CONFIGURE_FLAGS = --enable-doc --disable-git-version \
|
||||
bashcompdir='$${prefix}/share/bash-completion/completions'
|
||||
|
||||
# Some files automatically included, so they aren't specified below:
|
||||
# AUTHORS, COPYING, NEWS, README
|
||||
@@ -50,6 +51,12 @@ AM_PY_LOG_FLAGS = \
|
||||
--ldconfig $(LDCONFIG) \
|
||||
--bindir $(top_builddir)/src/pacman \
|
||||
--bindir $(top_builddir)/scripts
|
||||
if !HAVE_LIBGPGME
|
||||
AM_PY_LOG_FLAGS += --without-gpg
|
||||
endif
|
||||
if !HAVE_LIBCURL
|
||||
AM_PY_LOG_FLAGS += --without-curl
|
||||
endif
|
||||
|
||||
# create the pacman DB, cache, makepkg-template and system hook directories upon install
|
||||
install-data-local:
|
||||
|
||||
64
NEWS
64
NEWS
@@ -1,5 +1,39 @@
|
||||
VERSION DESCRIPTION
|
||||
-----------------------------------------------------------------------------
|
||||
5.1.2 - pacman-conf: add missing DisableDownloadTimeout support
|
||||
- Include version when checking optdepend install status
|
||||
during -Qi (FS#60106)
|
||||
- Improve error message for unresolvable urls (FS#48285)
|
||||
- Do not raise SIGINT when a downloaded file exceeds the expected
|
||||
size
|
||||
- Fix previous download interruption status carrying over to new
|
||||
downloads
|
||||
- Reset known signal handlers before running install scripts or
|
||||
hooks (FS#56756)
|
||||
- Properly handle signal interrupts while running install scripts
|
||||
or hooks (FS#60396)
|
||||
- Allow explicitly disabling signature checks when compiled
|
||||
without signature support (FS#60880)
|
||||
- makepkg: fix linting error on environment variables (FS#60681)
|
||||
5.1.1 - Allow full path including root prefix to be passed to
|
||||
--overwrite
|
||||
- Revert deprecation of --root
|
||||
- Document comment syntax restrictions in pacman.conf
|
||||
- makepkg:
|
||||
- handle pre-existing directories when checking for write
|
||||
permissions
|
||||
- reduce restrictions on pkgver in depends listings (FS#58776)
|
||||
- permit versioned optdepends
|
||||
- remove unintended chmod of $BUILDDIR (FS#58790)
|
||||
- fix issue when $startdir was not an absolute path (FS#58865)
|
||||
- fix syntax error when $pkgname is empty
|
||||
- fix --nocolor being passed to pacman (FS#58820)
|
||||
- fix issues with trap handling
|
||||
- fix several issues with debug packages (signing, printing of
|
||||
package names, clearing of global package options, source
|
||||
file inclusion)
|
||||
- fix --help text for --packagelist
|
||||
- pacman-conf: Fix detection of Usage option
|
||||
5.1.0 - Add new --overwrite option and deprecate --force. This accepts a
|
||||
glob pattern with far more control than the widely abused force
|
||||
option which mostly just causes issues (FS#31549)
|
||||
@@ -110,12 +144,30 @@ VERSION DESCRIPTION
|
||||
- vercmp:
|
||||
- remove duplicate, undocumented --usage option
|
||||
- fail when the wrong number of arguments are used (FS#49093)
|
||||
5.0.2 - fix database file checks with -Qkk and non-standard root
|
||||
(FS#48563)
|
||||
- improve optdepend detection for status messages (FS#44957)
|
||||
- make Y/N prompt multi-byte-character aware (FS#47992)
|
||||
- properly detect dependency cycles with --recursive (FS#41031)
|
||||
- improve free disk space calculation (FS#37402)
|
||||
- extract database files with --dbonly (FS#52052)
|
||||
- repo-add:
|
||||
- do not alter the database if only verifying signature
|
||||
(FS#48085)
|
||||
- fix error for directories containing whitespace (FS#50285)
|
||||
- makepkg:
|
||||
- fix building packages with only architecture-specific
|
||||
sources (FS#48340)
|
||||
- ignore PKGBUILD architecture for --printsrcinfo
|
||||
- do not die on non-empty directories under !emptydirs
|
||||
(FS#48515)
|
||||
- preserve checksum type for architecture-specific sources
|
||||
5.0.1 - fix alignment issues with wide character locales (FS#47980)
|
||||
- fix removal of .pacnew files (FS#47993)
|
||||
- fix triggering of Install hooks (FS#47996)
|
||||
- fix handling of stdin scripts called by pacman
|
||||
- hook activity is logged
|
||||
- documentataion updates for alpm-hooks (FS#48080)
|
||||
- documentation updates for alpm-hooks (FS#48080)
|
||||
- makepkg:
|
||||
- increase robustness of variable array checks
|
||||
- makepkg -g does not perform current architecture checks
|
||||
@@ -207,9 +259,9 @@ VERSION DESCRIPTION
|
||||
- Fix removal of static libraries when the shared library
|
||||
uses the absolute path in symbolic links (FS#43395)
|
||||
- Improve Bazaar cloning (FS#43448)
|
||||
- Fix issues with architecture dependant checksum
|
||||
- Fix issues with architecture dependent checksum
|
||||
verification (FS#43192)
|
||||
- Fix .SRCINFO file with architecture dependant fields
|
||||
- Fix .SRCINFO file with architecture dependent fields
|
||||
(FS#43247)
|
||||
- Fix compatibility with older bash versions
|
||||
- Allow git checkouts to be downloaded into directory ending
|
||||
@@ -299,7 +351,7 @@ VERSION DESCRIPTION
|
||||
- checkupdates: rename CHECKUPDATE_DB to CHECKUPDATES_DB
|
||||
- pacdiff: add a "Quit" option, and many other improvements
|
||||
- pacsysclean is removed
|
||||
4.1.2 - validate %FILEPATH% when parsing repos to prevent arbitary
|
||||
4.1.2 - validate %FILEPATH% when parsing repos to prevent arbitrary
|
||||
file overwrites from malicious databases
|
||||
- makepkg:
|
||||
- restrict package name from starting with a dot
|
||||
@@ -764,7 +816,7 @@ VERSION DESCRIPTION
|
||||
- repo-add: use openssl instead of md5sum
|
||||
- simplify doc building process for ease of development
|
||||
- ensure correct handling of syscall interruptions
|
||||
- readd missing newline on -Qi/-Si output (FS#11331)
|
||||
- re-add missing newline on -Qi/-Si output (FS#11331)
|
||||
- fix TotalDownload regression (FS#11339)
|
||||
- makepkg:
|
||||
- replace getopt with an internal function
|
||||
@@ -1210,7 +1262,7 @@ VERSION DESCRIPTION
|
||||
external download utility like wget
|
||||
- added a license field to package meta-data
|
||||
- add url support to -A and -U operations (download packages)
|
||||
- -Ss now searches thru provides fields
|
||||
- -Ss now searches through provides fields
|
||||
- added --dbonly option to -R
|
||||
2.7.6 - added --print-uris option
|
||||
- fixed an http download bug (FS#667)
|
||||
|
||||
33
build-aux/edit-script.sh.in
Normal file
33
build-aux/edit-script.sh.in
Normal file
@@ -0,0 +1,33 @@
|
||||
#!@BASH@
|
||||
|
||||
input=$1
|
||||
output=$2
|
||||
mode=$3
|
||||
|
||||
"@SED@" \
|
||||
-e "s|@rootdir[@]|@ROOTDIR@|g" \
|
||||
-e "s|@localedir[@]|@LOCALEDIR@|g" \
|
||||
-e "s|@sysconfdir[@]|@sysconfdir@|g" \
|
||||
-e "s|@localstatedir[@]|@localstatedir@|g" \
|
||||
-e "s|@libmakepkgdir[@]|@LIBMAKEPKGDIR@|g" \
|
||||
-e "s|@pkgdatadir[@]|@PKGDATADIR@|g" \
|
||||
-e "s|@prefix[@]|@PREFIX@|g" \
|
||||
-e "1s|#!/bin/bash|#!@BASH@|g" \
|
||||
-e "s|@PACKAGE_VERSION[@]|@PACKAGE_VERSION@|g" \
|
||||
-e "s|@PACKAGE_NAME[@]|@PACKAGE_NAME@|g" \
|
||||
-e "s|@BUILDSCRIPT[@]|@BUILDSCRIPT@|g" \
|
||||
-e "s|@TEMPLATE_DIR[@]|@TEMPLATE_DIR@|g" \
|
||||
-e "s|@DEBUGSUFFIX[@]|@DEBUGSUFFIX@|g" \
|
||||
-e "s|@INODECMD[@]|@INODECMD@|g" \
|
||||
-e "s|@OWNERCMD[@]|@OWNERCMD@|g" \
|
||||
-e "s|@MODECMD[@]|@MODECMD@|g" \
|
||||
-e "s|@SEDINPLACEFLAGS[@]|@SEDINPLACEFLAGS@|g" \
|
||||
-e "s|@SEDPATH[@]|@SEDPATH@|g" \
|
||||
-e "s|@DUFLAGS[@]|@DUFLAGS@|g" \
|
||||
-e "s|@DUPATH[@]|@DUPATH@|g" \
|
||||
-e "s|@configure_input[@]|Generated from ${input##*/}; do not edit by hand.|g" \
|
||||
"$input" >"$output"
|
||||
|
||||
if [[ $mode ]]; then
|
||||
chmod "$mode" "$output"
|
||||
fi
|
||||
6
build-aux/meson-install-script.sh
Normal file
6
build-aux/meson-install-script.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
built_script=$1
|
||||
dest_path=$2
|
||||
|
||||
install -Dm755 "$built_script" "$DESTDIR/$dest_path"
|
||||
12
build-aux/meson-make-symlink.sh
Normal file
12
build-aux/meson-make-symlink.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# this is needed mostly because $DESTDIR is provided as a variable,
|
||||
# and we need to create the target directory...
|
||||
|
||||
mkdir -vp "$(dirname "${DESTDIR:-}$2")"
|
||||
if [ "$(dirname $1)" = . ]; then
|
||||
ln -vfs -T "$1" "${DESTDIR:-}$2"
|
||||
else
|
||||
ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
|
||||
fi
|
||||
6
build-aux/script-wrapper.sh.in
Executable file
6
build-aux/script-wrapper.sh.in
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script serves as a trampoline for running scripts which depend on
|
||||
# libmakepkg with the libmakepkg within the build tree.
|
||||
|
||||
LIBRARY=@BUILDDIR@/libmakepkg exec @BASH@ -$- @REAL_PROGPATH@ "$@"
|
||||
296
build-aux/tap-driver.py
Normal file
296
build-aux/tap-driver.py
Normal file
@@ -0,0 +1,296 @@
|
||||
#!/usr/bin/env python3
|
||||
# Adapted from tappy copyright (c) 2016, Matt Layman
|
||||
# MIT license
|
||||
# https://github.com/python-tap/tappy
|
||||
|
||||
import io
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
class Directive(object):
|
||||
"""A representation of a result line directive."""
|
||||
|
||||
skip_pattern = re.compile(
|
||||
r"""^SKIP\S*
|
||||
(?P<whitespace>\s*) # Optional whitespace.
|
||||
(?P<reason>.*) # Slurp up the rest.""",
|
||||
re.IGNORECASE | re.VERBOSE)
|
||||
todo_pattern = re.compile(
|
||||
r"""^TODO\b # The directive name
|
||||
(?P<whitespace>\s*) # Immediately following must be whitespace.
|
||||
(?P<reason>.*) # Slurp up the rest.""",
|
||||
re.IGNORECASE | re.VERBOSE)
|
||||
|
||||
def __init__(self, text):
|
||||
"""Initialize the directive by parsing the text.
|
||||
The text is assumed to be everything after a '#\s*' on a result line.
|
||||
"""
|
||||
self._text = text
|
||||
self._skip = False
|
||||
self._todo = False
|
||||
self._reason = None
|
||||
|
||||
match = self.skip_pattern.match(text)
|
||||
if match:
|
||||
self._skip = True
|
||||
self._reason = match.group('reason')
|
||||
|
||||
match = self.todo_pattern.match(text)
|
||||
if match:
|
||||
if match.group('whitespace'):
|
||||
self._todo = True
|
||||
else:
|
||||
# Catch the case where the directive has no descriptive text.
|
||||
if match.group('reason') == '':
|
||||
self._todo = True
|
||||
self._reason = match.group('reason')
|
||||
|
||||
@property
|
||||
def text(self):
|
||||
"""Get the entire text."""
|
||||
return self._text
|
||||
|
||||
@property
|
||||
def skip(self):
|
||||
"""Check if the directive is a SKIP type."""
|
||||
return self._skip
|
||||
|
||||
@property
|
||||
def todo(self):
|
||||
"""Check if the directive is a TODO type."""
|
||||
return self._todo
|
||||
|
||||
@property
|
||||
def reason(self):
|
||||
"""Get the reason for the directive."""
|
||||
return self._reason
|
||||
|
||||
|
||||
class Parser(object):
|
||||
"""A parser for TAP files and lines."""
|
||||
|
||||
# ok and not ok share most of the same characteristics.
|
||||
result_base = r"""
|
||||
\s* # Optional whitespace.
|
||||
(?P<number>\d*) # Optional test number.
|
||||
\s* # Optional whitespace.
|
||||
(?P<description>[^#]*) # Optional description before #.
|
||||
\#? # Optional directive marker.
|
||||
\s* # Optional whitespace.
|
||||
(?P<directive>.*) # Optional directive text.
|
||||
"""
|
||||
ok = re.compile(r'^ok' + result_base, re.VERBOSE)
|
||||
not_ok = re.compile(r'^not\ ok' + result_base, re.VERBOSE)
|
||||
plan = re.compile(r"""
|
||||
^1..(?P<expected>\d+) # Match the plan details.
|
||||
[^#]* # Consume any non-hash character to confirm only
|
||||
# directives appear with the plan details.
|
||||
\#? # Optional directive marker.
|
||||
\s* # Optional whitespace.
|
||||
(?P<directive>.*) # Optional directive text.
|
||||
""", re.VERBOSE)
|
||||
diagnostic = re.compile(r'^#')
|
||||
bail = re.compile(r"""
|
||||
^Bail\ out!
|
||||
\s* # Optional whitespace.
|
||||
(?P<reason>.*) # Optional reason.
|
||||
""", re.VERBOSE)
|
||||
version = re.compile(r'^TAP version (?P<version>\d+)$')
|
||||
|
||||
TAP_MINIMUM_DECLARED_VERSION = 13
|
||||
|
||||
def parse(self, fh):
|
||||
"""Generate tap.line.Line objects, given a file-like object `fh`.
|
||||
`fh` may be any object that implements both the iterator and
|
||||
context management protocol (i.e. it can be used in both a
|
||||
"with" statement and a "for...in" statement.)
|
||||
Trailing whitespace and newline characters will be automatically
|
||||
stripped from the input lines.
|
||||
"""
|
||||
with fh:
|
||||
for line in fh:
|
||||
yield self.parse_line(line.rstrip())
|
||||
|
||||
def parse_line(self, text):
|
||||
"""Parse a line into whatever TAP category it belongs."""
|
||||
match = self.ok.match(text)
|
||||
if match:
|
||||
return self._parse_result(True, match)
|
||||
|
||||
match = self.not_ok.match(text)
|
||||
if match:
|
||||
return self._parse_result(False, match)
|
||||
|
||||
if self.diagnostic.match(text):
|
||||
return ('diagnostic', text)
|
||||
|
||||
match = self.plan.match(text)
|
||||
if match:
|
||||
return self._parse_plan(match)
|
||||
|
||||
match = self.bail.match(text)
|
||||
if match:
|
||||
return ('bail', match.group('reason'))
|
||||
|
||||
match = self.version.match(text)
|
||||
if match:
|
||||
return self._parse_version(match)
|
||||
|
||||
return ('unknown',)
|
||||
|
||||
def _parse_plan(self, match):
|
||||
"""Parse a matching plan line."""
|
||||
expected_tests = int(match.group('expected'))
|
||||
directive = Directive(match.group('directive'))
|
||||
|
||||
# Only SKIP directives are allowed in the plan.
|
||||
if directive.text and not directive.skip:
|
||||
return ('unknown',)
|
||||
|
||||
return ('plan', expected_tests, directive)
|
||||
|
||||
def _parse_result(self, ok, match):
|
||||
"""Parse a matching result line into a result instance."""
|
||||
return ('result', ok, match.group('number'),
|
||||
match.group('description').strip(),
|
||||
Directive(match.group('directive')))
|
||||
|
||||
def _parse_version(self, match):
|
||||
version = int(match.group('version'))
|
||||
if version < self.TAP_MINIMUM_DECLARED_VERSION:
|
||||
raise ValueError('It is an error to explicitly specify '
|
||||
'any version lower than 13.')
|
||||
return ('version', version)
|
||||
|
||||
|
||||
class Rules(object):
|
||||
|
||||
def __init__(self):
|
||||
self._lines_seen = {'plan': [], 'test': 0, 'failed': 0, 'version': []}
|
||||
self._errors = []
|
||||
|
||||
def check(self, final_line_count):
|
||||
"""Check the status of all provided data and update the suite."""
|
||||
if self._lines_seen['version']:
|
||||
self._process_version_lines()
|
||||
self._process_plan_lines(final_line_count)
|
||||
|
||||
def check_errors(self):
|
||||
if self._lines_seen['failed'] > 0:
|
||||
self._add_error('Tests failed.')
|
||||
if self._errors:
|
||||
for error in self._errors:
|
||||
print(error)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def _process_version_lines(self):
|
||||
"""Process version line rules."""
|
||||
if len(self._lines_seen['version']) > 1:
|
||||
self._add_error('Multiple version lines appeared.')
|
||||
elif self._lines_seen['version'][0] != 1:
|
||||
self._add_error('The version must be on the first line.')
|
||||
|
||||
def _process_plan_lines(self, final_line_count):
|
||||
"""Process plan line rules."""
|
||||
if not self._lines_seen['plan']:
|
||||
self._add_error('Missing a plan.')
|
||||
return
|
||||
|
||||
if len(self._lines_seen['plan']) > 1:
|
||||
self._add_error('Only one plan line is permitted per file.')
|
||||
return
|
||||
|
||||
expected_tests, at_line = self._lines_seen['plan'][0]
|
||||
if not self._plan_on_valid_line(at_line, final_line_count):
|
||||
self._add_error(
|
||||
'A plan must appear at the beginning or end of the file.')
|
||||
return
|
||||
|
||||
if expected_tests != self._lines_seen['test']:
|
||||
self._add_error(
|
||||
'Expected {expected_count} tests '
|
||||
'but only {seen_count} ran.'.format(
|
||||
expected_count=expected_tests,
|
||||
seen_count=self._lines_seen['test']))
|
||||
|
||||
def _plan_on_valid_line(self, at_line, final_line_count):
|
||||
"""Check if a plan is on a valid line."""
|
||||
# Put the common cases first.
|
||||
if at_line == 1 or at_line == final_line_count:
|
||||
return True
|
||||
|
||||
# The plan may only appear on line 2 if the version is at line 1.
|
||||
after_version = (
|
||||
self._lines_seen['version'] and
|
||||
self._lines_seen['version'][0] == 1 and
|
||||
at_line == 2)
|
||||
if after_version:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def handle_bail(self, reason):
|
||||
"""Handle a bail line."""
|
||||
self._add_error('Bailed: {reason}').format(reason=reason)
|
||||
|
||||
def handle_skipping_plan(self):
|
||||
"""Handle a plan that contains a SKIP directive."""
|
||||
sys.exit(77)
|
||||
|
||||
def saw_plan(self, expected_tests, at_line):
|
||||
"""Record when a plan line was seen."""
|
||||
self._lines_seen['plan'].append((expected_tests, at_line))
|
||||
|
||||
def saw_test(self, ok):
|
||||
"""Record when a test line was seen."""
|
||||
self._lines_seen['test'] += 1
|
||||
if not ok:
|
||||
self._lines_seen['failed'] += 1
|
||||
|
||||
def saw_version_at(self, line_counter):
|
||||
"""Record when a version line was seen."""
|
||||
self._lines_seen['version'].append(line_counter)
|
||||
|
||||
def _add_error(self, message):
|
||||
self._errors += [message]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = Parser()
|
||||
rules = Rules()
|
||||
|
||||
try:
|
||||
out = subprocess.check_output(sys.argv[1:], universal_newlines=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
sys.stdout.write(e.output)
|
||||
raise e
|
||||
|
||||
line_generator = parser.parse(io.StringIO(out))
|
||||
line_counter = 0
|
||||
for line in line_generator:
|
||||
line_counter += 1
|
||||
|
||||
if line[0] == 'unknown':
|
||||
continue
|
||||
|
||||
if line[0] == 'result':
|
||||
rules.saw_test(line[1])
|
||||
print('{okay} {num} {description} {directive}'.format(
|
||||
okay=('' if line[1] else 'not ') + 'ok', num=line[2],
|
||||
description=line[3], directive=line[4].text))
|
||||
elif line[0] == 'plan':
|
||||
if line[2].skip:
|
||||
rules.handle_skipping_plan()
|
||||
rules.saw_plan(line[1], line_counter)
|
||||
elif line[0] == 'bail':
|
||||
rules.handle_bail(line[1])
|
||||
elif line[0] == 'version':
|
||||
rules.saw_version_at(line_counter)
|
||||
elif line[0] == 'diagnostic':
|
||||
print(line[1])
|
||||
|
||||
rules.check(line_counter)
|
||||
sys.exit(rules.check_errors())
|
||||
@@ -1,652 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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, 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/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
scriptversion=2011-12-27.17; # UTC
|
||||
|
||||
# Make unconditional expansion of undefined variables an error. This
|
||||
# helps a lot in preventing typo-related bugs.
|
||||
set -u
|
||||
|
||||
me=tap-driver.sh
|
||||
|
||||
fatal ()
|
||||
{
|
||||
echo "$me: fatal: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
usage_error ()
|
||||
{
|
||||
echo "$me: $*" >&2
|
||||
print_usage >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
print_usage ()
|
||||
{
|
||||
cat <<END
|
||||
Usage:
|
||||
tap-driver.sh --test-name=NAME --log-file=PATH --trs-file=PATH
|
||||
[--expect-failure={yes|no}] [--color-tests={yes|no}]
|
||||
[--enable-hard-errors={yes|no}] [--ignore-exit]
|
||||
[--diagnostic-string=STRING] [--merge|--no-merge]
|
||||
[--comments|--no-comments] [--] TEST-COMMAND
|
||||
The \`--test-name', \`--log-file' and \`--trs-file' options are mandatory.
|
||||
END
|
||||
}
|
||||
|
||||
# TODO: better error handling in option parsing (in particular, ensure
|
||||
# TODO: $log_file, $trs_file and $test_name are defined).
|
||||
test_name= # Used for reporting.
|
||||
log_file= # Where to save the result and output of the test script.
|
||||
trs_file= # Where to save the metadata of the test run.
|
||||
expect_failure=0
|
||||
color_tests=0
|
||||
merge=0
|
||||
ignore_exit=0
|
||||
comments=0
|
||||
diag_string='#'
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--help) print_usage; exit $?;;
|
||||
--version) echo "$me $scriptversion"; exit $?;;
|
||||
--test-name) test_name=$2; shift;;
|
||||
--log-file) log_file=$2; shift;;
|
||||
--trs-file) trs_file=$2; shift;;
|
||||
--color-tests) color_tests=$2; shift;;
|
||||
--expect-failure) expect_failure=$2; shift;;
|
||||
--enable-hard-errors) shift;; # No-op.
|
||||
--merge) merge=1;;
|
||||
--no-merge) merge=0;;
|
||||
--ignore-exit) ignore_exit=1;;
|
||||
--comments) comments=1;;
|
||||
--no-comments) comments=0;;
|
||||
--diagnostic-string) diag_string=$2; shift;;
|
||||
--) shift; break;;
|
||||
-*) usage_error "invalid option: '$1'";;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
test $# -gt 0 || usage_error "missing test command"
|
||||
|
||||
case $expect_failure in
|
||||
yes) expect_failure=1;;
|
||||
*) expect_failure=0;;
|
||||
esac
|
||||
|
||||
if test $color_tests = yes; then
|
||||
init_colors='
|
||||
color_map["red"]="[0;31m" # Red.
|
||||
color_map["grn"]="[0;32m" # Green.
|
||||
color_map["lgn"]="[1;32m" # Light green.
|
||||
color_map["blu"]="[1;34m" # Blue.
|
||||
color_map["mgn"]="[0;35m" # Magenta.
|
||||
color_map["std"]="[m" # No color.
|
||||
color_for_result["ERROR"] = "mgn"
|
||||
color_for_result["PASS"] = "grn"
|
||||
color_for_result["XPASS"] = "red"
|
||||
color_for_result["FAIL"] = "red"
|
||||
color_for_result["XFAIL"] = "lgn"
|
||||
color_for_result["SKIP"] = "blu"'
|
||||
else
|
||||
init_colors=''
|
||||
fi
|
||||
|
||||
# :; is there to work around a bug in bash 3.2 (and earlier) which
|
||||
# does not always set '$?' properly on redirection failure.
|
||||
# See the Autoconf manual for more details.
|
||||
:;{
|
||||
(
|
||||
# Ignore common signals (in this subshell only!), to avoid potential
|
||||
# problems with Korn shells. Some Korn shells are known to propagate
|
||||
# to themselves signals that have killed a child process they were
|
||||
# waiting for; this is done at least for SIGINT (and usually only for
|
||||
# it, in truth). Without the `trap' below, such a behaviour could
|
||||
# cause a premature exit in the current subshell, e.g., in case the
|
||||
# test command it runs gets terminated by a SIGINT. Thus, the awk
|
||||
# script we are piping into would never seen the exit status it
|
||||
# expects on its last input line (which is displayed below by the
|
||||
# last `echo $?' statement), and would thus die reporting an internal
|
||||
# error.
|
||||
# For more information, see the Autoconf manual and the threads:
|
||||
# <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
|
||||
# <http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/004121.html>
|
||||
trap : 1 3 2 13 15
|
||||
if test $merge -gt 0; then
|
||||
exec 2>&1
|
||||
else
|
||||
exec 2>&3
|
||||
fi
|
||||
"$@"
|
||||
echo $?
|
||||
) | LC_ALL=C ${AM_TAP_AWK-awk} \
|
||||
-v me="$me" \
|
||||
-v test_script_name="$test_name" \
|
||||
-v log_file="$log_file" \
|
||||
-v trs_file="$trs_file" \
|
||||
-v expect_failure="$expect_failure" \
|
||||
-v merge="$merge" \
|
||||
-v ignore_exit="$ignore_exit" \
|
||||
-v comments="$comments" \
|
||||
-v diag_string="$diag_string" \
|
||||
'
|
||||
# FIXME: the usages of "cat >&3" below could be optimized when using
|
||||
# FIXME: GNU awk, and/on on systems that supports /dev/fd/.
|
||||
|
||||
# Implementation note: in what follows, `result_obj` will be an
|
||||
# associative array that (partly) simulates a TAP result object
|
||||
# from the `TAP::Parser` perl module.
|
||||
|
||||
## ----------- ##
|
||||
## FUNCTIONS ##
|
||||
## ----------- ##
|
||||
|
||||
function fatal(msg)
|
||||
{
|
||||
print me ": " msg | "cat >&2"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function abort(where)
|
||||
{
|
||||
fatal("internal error " where)
|
||||
}
|
||||
|
||||
# Convert a boolean to a "yes"/"no" string.
|
||||
function yn(bool)
|
||||
{
|
||||
return bool ? "yes" : "no";
|
||||
}
|
||||
|
||||
function add_test_result(result)
|
||||
{
|
||||
if (!test_results_index)
|
||||
test_results_index = 0
|
||||
test_results_list[test_results_index] = result
|
||||
test_results_index += 1
|
||||
test_results_seen[result] = 1;
|
||||
}
|
||||
|
||||
# Whether the test script should be re-run by "make recheck".
|
||||
function must_recheck()
|
||||
{
|
||||
for (k in test_results_seen)
|
||||
if (k != "XFAIL" && k != "PASS" && k != "SKIP")
|
||||
return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
# Whether the content of the log file associated to this test should
|
||||
# be copied into the "global" test-suite.log.
|
||||
function copy_in_global_log()
|
||||
{
|
||||
for (k in test_results_seen)
|
||||
if (k != "PASS")
|
||||
return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
# FIXME: this can certainly be improved ...
|
||||
function get_global_test_result()
|
||||
{
|
||||
if ("ERROR" in test_results_seen)
|
||||
return "ERROR"
|
||||
if ("FAIL" in test_results_seen || "XPASS" in test_results_seen)
|
||||
return "FAIL"
|
||||
all_skipped = 1
|
||||
for (k in test_results_seen)
|
||||
if (k != "SKIP")
|
||||
all_skipped = 0
|
||||
if (all_skipped)
|
||||
return "SKIP"
|
||||
return "PASS";
|
||||
}
|
||||
|
||||
function stringify_result_obj(result_obj)
|
||||
{
|
||||
if (result_obj["is_unplanned"] || result_obj["number"] != testno)
|
||||
return "ERROR"
|
||||
|
||||
if (plan_seen == LATE_PLAN)
|
||||
return "ERROR"
|
||||
|
||||
if (result_obj["directive"] == "TODO")
|
||||
return result_obj["is_ok"] ? "XPASS" : "XFAIL"
|
||||
|
||||
if (result_obj["directive"] == "SKIP")
|
||||
return result_obj["is_ok"] ? "SKIP" : COOKED_FAIL;
|
||||
|
||||
if (length(result_obj["directive"]))
|
||||
abort("in function stringify_result_obj()")
|
||||
|
||||
return result_obj["is_ok"] ? COOKED_PASS : COOKED_FAIL
|
||||
}
|
||||
|
||||
function decorate_result(result)
|
||||
{
|
||||
color_name = color_for_result[result]
|
||||
if (color_name)
|
||||
return color_map[color_name] "" result "" color_map["std"]
|
||||
# If we are not using colorized output, or if we do not know how
|
||||
# to colorize the given result, we should return it unchanged.
|
||||
return result
|
||||
}
|
||||
|
||||
function report(result, details)
|
||||
{
|
||||
if (result ~ /^(X?(PASS|FAIL)|SKIP|ERROR)/)
|
||||
{
|
||||
msg = ": " test_script_name
|
||||
add_test_result(result)
|
||||
}
|
||||
else if (result == "#")
|
||||
{
|
||||
msg = " " test_script_name ":"
|
||||
}
|
||||
else
|
||||
{
|
||||
abort("in function report()")
|
||||
}
|
||||
if (length(details))
|
||||
msg = msg " " details
|
||||
# Output on console might be colorized.
|
||||
print decorate_result(result) msg
|
||||
# Log the result in the log file too, to help debugging (this is
|
||||
# especially true when said result is a TAP error or "Bail out!").
|
||||
print result msg | "cat >&3";
|
||||
}
|
||||
|
||||
function testsuite_error(error_message)
|
||||
{
|
||||
report("ERROR", "- " error_message)
|
||||
}
|
||||
|
||||
function handle_tap_result()
|
||||
{
|
||||
details = result_obj["number"];
|
||||
if (length(result_obj["description"]))
|
||||
details = details " " result_obj["description"]
|
||||
|
||||
if (plan_seen == LATE_PLAN)
|
||||
{
|
||||
details = details " # AFTER LATE PLAN";
|
||||
}
|
||||
else if (result_obj["is_unplanned"])
|
||||
{
|
||||
details = details " # UNPLANNED";
|
||||
}
|
||||
else if (result_obj["number"] != testno)
|
||||
{
|
||||
details = sprintf("%s # OUT-OF-ORDER (expecting %d)",
|
||||
details, testno);
|
||||
}
|
||||
else if (result_obj["directive"])
|
||||
{
|
||||
details = details " # " result_obj["directive"];
|
||||
if (length(result_obj["explanation"]))
|
||||
details = details " " result_obj["explanation"]
|
||||
}
|
||||
|
||||
report(stringify_result_obj(result_obj), details)
|
||||
}
|
||||
|
||||
# `skip_reason` should be empty whenever planned > 0.
|
||||
function handle_tap_plan(planned, skip_reason)
|
||||
{
|
||||
planned += 0 # Avoid getting confused if, say, `planned` is "00"
|
||||
if (length(skip_reason) && planned > 0)
|
||||
abort("in function handle_tap_plan()")
|
||||
if (plan_seen)
|
||||
{
|
||||
# Error, only one plan per stream is acceptable.
|
||||
testsuite_error("multiple test plans")
|
||||
return;
|
||||
}
|
||||
planned_tests = planned
|
||||
# The TAP plan can come before or after *all* the TAP results; we speak
|
||||
# respectively of an "early" or a "late" plan. If we see the plan line
|
||||
# after at least one TAP result has been seen, assume we have a late
|
||||
# plan; in this case, any further test result seen after the plan will
|
||||
# be flagged as an error.
|
||||
plan_seen = (testno >= 1 ? LATE_PLAN : EARLY_PLAN)
|
||||
# If testno > 0, we have an error ("too many tests run") that will be
|
||||
# automatically dealt with later, so do not worry about it here. If
|
||||
# $plan_seen is true, we have an error due to a repeated plan, and that
|
||||
# has already been dealt with above. Otherwise, we have a valid "plan
|
||||
# with SKIP" specification, and should report it as a particular kind
|
||||
# of SKIP result.
|
||||
if (planned == 0 && testno == 0)
|
||||
{
|
||||
if (length(skip_reason))
|
||||
skip_reason = "- " skip_reason;
|
||||
report("SKIP", skip_reason);
|
||||
}
|
||||
}
|
||||
|
||||
function extract_tap_comment(line)
|
||||
{
|
||||
if (index(line, diag_string) == 1)
|
||||
{
|
||||
# Strip leading `diag_string` from `line`.
|
||||
line = substr(line, length(diag_string) + 1)
|
||||
# And strip any leading and trailing whitespace left.
|
||||
sub("^[ \t]*", "", line)
|
||||
sub("[ \t]*$", "", line)
|
||||
# Return what is left (if any).
|
||||
return line;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
# When this function is called, we know that line is a TAP result line,
|
||||
# so that it matches the (perl) RE "^(not )?ok\b".
|
||||
function setup_result_obj(line)
|
||||
{
|
||||
# Get the result, and remove it from the line.
|
||||
result_obj["is_ok"] = (substr(line, 1, 2) == "ok" ? 1 : 0)
|
||||
sub("^(not )?ok[ \t]*", "", line)
|
||||
|
||||
# If the result has an explicit number, get it and strip it; otherwise,
|
||||
# automatically assing the next progresive number to it.
|
||||
if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/)
|
||||
{
|
||||
match(line, "^[0-9]+")
|
||||
# The final `+ 0` is to normalize numbers with leading zeros.
|
||||
result_obj["number"] = substr(line, 1, RLENGTH) + 0
|
||||
line = substr(line, RLENGTH + 1)
|
||||
}
|
||||
else
|
||||
{
|
||||
result_obj["number"] = testno
|
||||
}
|
||||
|
||||
if (plan_seen == LATE_PLAN)
|
||||
# No further test results are acceptable after a "late" TAP plan
|
||||
# has been seen.
|
||||
result_obj["is_unplanned"] = 1
|
||||
else if (plan_seen && testno > planned_tests)
|
||||
result_obj["is_unplanned"] = 1
|
||||
else
|
||||
result_obj["is_unplanned"] = 0
|
||||
|
||||
# Strip trailing and leading whitespace.
|
||||
sub("^[ \t]*", "", line)
|
||||
sub("[ \t]*$", "", line)
|
||||
|
||||
# This will have to be corrected if we have a "TODO"/"SKIP" directive.
|
||||
result_obj["description"] = line
|
||||
result_obj["directive"] = ""
|
||||
result_obj["explanation"] = ""
|
||||
|
||||
if (index(line, "#") == 0)
|
||||
return # No possible directive, nothing more to do.
|
||||
|
||||
# Directives are case-insensitive.
|
||||
rx = "[ \t]*#[ \t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \t]*"
|
||||
|
||||
# See whether we have the directive, and if yes, where.
|
||||
pos = match(line, rx "$")
|
||||
if (!pos)
|
||||
pos = match(line, rx "[^a-zA-Z0-9_]")
|
||||
|
||||
# If there was no TAP directive, we have nothing more to do.
|
||||
if (!pos)
|
||||
return
|
||||
|
||||
# Let`s now see if the TAP directive has been escaped. For example:
|
||||
# escaped: ok \# SKIP
|
||||
# not escaped: ok \\# SKIP
|
||||
# escaped: ok \\\\\# SKIP
|
||||
# not escaped: ok \ # SKIP
|
||||
if (substr(line, pos, 1) == "#")
|
||||
{
|
||||
bslash_count = 0
|
||||
for (i = pos; i > 1 && substr(line, i - 1, 1) == "\\"; i--)
|
||||
bslash_count += 1
|
||||
if (bslash_count % 2)
|
||||
return # Directive was escaped.
|
||||
}
|
||||
|
||||
# Strip the directive and its explanation (if any) from the test
|
||||
# description.
|
||||
result_obj["description"] = substr(line, 1, pos - 1)
|
||||
# Now remove the test description from the line, that has been dealt
|
||||
# with already.
|
||||
line = substr(line, pos)
|
||||
# Strip the directive, and save its value (normalized to upper case).
|
||||
sub("^[ \t]*#[ \t]*", "", line)
|
||||
result_obj["directive"] = toupper(substr(line, 1, 4))
|
||||
line = substr(line, 5)
|
||||
# Now get the explanation for the directive (if any), with leading
|
||||
# and trailing whitespace removed.
|
||||
sub("^[ \t]*", "", line)
|
||||
sub("[ \t]*$", "", line)
|
||||
result_obj["explanation"] = line
|
||||
}
|
||||
|
||||
function get_test_exit_message(status)
|
||||
{
|
||||
if (status == 0)
|
||||
return ""
|
||||
if (status !~ /^[1-9][0-9]*$/)
|
||||
abort("getting exit status")
|
||||
if (status < 127)
|
||||
exit_details = ""
|
||||
else if (status == 127)
|
||||
exit_details = " (command not found?)"
|
||||
else if (status >= 128 && status <= 255)
|
||||
exit_details = sprintf(" (terminated by signal %d?)", status - 128)
|
||||
else if (status > 256 && status <= 384)
|
||||
# We used to report an "abnormal termination" here, but some Korn
|
||||
# shells, when a child process die due to signal number n, can leave
|
||||
# in $? an exit status of 256+n instead of the more standard 128+n.
|
||||
# Apparently, both behaviours are allowed by POSIX (2008), so be
|
||||
# prepared to handle them both. See also Austing Group report ID
|
||||
# 0000051 <http://www.austingroupbugs.net/view.php?id=51>
|
||||
exit_details = sprintf(" (terminated by signal %d?)", status - 256)
|
||||
else
|
||||
# Never seen in practice.
|
||||
exit_details = " (abnormal termination)"
|
||||
return sprintf("exited with status %d%s", status, exit_details)
|
||||
}
|
||||
|
||||
function write_test_results()
|
||||
{
|
||||
print ":global-test-result: " get_global_test_result() > trs_file
|
||||
print ":recheck: " yn(must_recheck()) > trs_file
|
||||
print ":copy-in-global-log: " yn(copy_in_global_log()) > trs_file
|
||||
for (i = 0; i < test_results_index; i += 1)
|
||||
print ":test-result: " test_results_list[i] > trs_file
|
||||
close(trs_file);
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
|
||||
## ------- ##
|
||||
## SETUP ##
|
||||
## ------- ##
|
||||
|
||||
'"$init_colors"'
|
||||
|
||||
# Properly initialized once the TAP plan is seen.
|
||||
planned_tests = 0
|
||||
|
||||
COOKED_PASS = expect_failure ? "XPASS": "PASS";
|
||||
COOKED_FAIL = expect_failure ? "XFAIL": "FAIL";
|
||||
|
||||
# Enumeration-like constants to remember which kind of plan (if any)
|
||||
# has been seen. It is important that NO_PLAN evaluates "false" as
|
||||
# a boolean.
|
||||
NO_PLAN = 0
|
||||
EARLY_PLAN = 1
|
||||
LATE_PLAN = 2
|
||||
|
||||
testno = 0 # Number of test results seen so far.
|
||||
bailed_out = 0 # Whether a "Bail out!" directive has been seen.
|
||||
|
||||
# Whether the TAP plan has been seen or not, and if yes, which kind
|
||||
# it is ("early" is seen before any test result, "late" otherwise).
|
||||
plan_seen = NO_PLAN
|
||||
|
||||
## --------- ##
|
||||
## PARSING ##
|
||||
## --------- ##
|
||||
|
||||
is_first_read = 1
|
||||
|
||||
while (1)
|
||||
{
|
||||
# Involutions required so that we are able to read the exit status
|
||||
# from the last input line.
|
||||
st = getline
|
||||
if (st < 0) # I/O error.
|
||||
fatal("I/O error while reading from input stream")
|
||||
else if (st == 0) # End-of-input
|
||||
{
|
||||
if (is_first_read)
|
||||
abort("in input loop: only one input line")
|
||||
break
|
||||
}
|
||||
if (is_first_read)
|
||||
{
|
||||
is_first_read = 0
|
||||
nextline = $0
|
||||
continue
|
||||
}
|
||||
else
|
||||
{
|
||||
curline = nextline
|
||||
nextline = $0
|
||||
$0 = curline
|
||||
}
|
||||
# Copy any input line verbatim into the log file.
|
||||
print | "cat >&3"
|
||||
# Parsing of TAP input should stop after a "Bail out!" directive.
|
||||
if (bailed_out)
|
||||
continue
|
||||
|
||||
# TAP test result.
|
||||
if ($0 ~ /^(not )?ok$/ || $0 ~ /^(not )?ok[^a-zA-Z0-9_]/)
|
||||
{
|
||||
testno += 1
|
||||
setup_result_obj($0)
|
||||
handle_tap_result()
|
||||
}
|
||||
# TAP plan (normal or "SKIP" without explanation).
|
||||
else if ($0 ~ /^1\.\.[0-9]+[ \t]*$/)
|
||||
{
|
||||
# The next two lines will put the number of planned tests in $0.
|
||||
sub("^1\\.\\.", "")
|
||||
sub("[^0-9]*$", "")
|
||||
handle_tap_plan($0, "")
|
||||
continue
|
||||
}
|
||||
# TAP "SKIP" plan, with an explanation.
|
||||
else if ($0 ~ /^1\.\.0+[ \t]*#/)
|
||||
{
|
||||
# The next lines will put the skip explanation in $0, stripping
|
||||
# any leading and trailing whitespace. This is a little more
|
||||
# tricky in truth, since we want to also strip a potential leading
|
||||
# "SKIP" string from the message.
|
||||
sub("^[^#]*#[ \t]*(SKIP[: \t][ \t]*)?", "")
|
||||
sub("[ \t]*$", "");
|
||||
handle_tap_plan(0, $0)
|
||||
}
|
||||
# "Bail out!" magic.
|
||||
# Older versions of prove and TAP::Harness (e.g., 3.17) did not
|
||||
# recognize a "Bail out!" directive when preceded by leading
|
||||
# whitespace, but more modern versions (e.g., 3.23) do. So we
|
||||
# emulate the latter, "more modern" behaviour.
|
||||
else if ($0 ~ /^[ \t]*Bail out!/)
|
||||
{
|
||||
bailed_out = 1
|
||||
# Get the bailout message (if any), with leading and trailing
|
||||
# whitespace stripped. The message remains stored in `$0`.
|
||||
sub("^[ \t]*Bail out![ \t]*", "");
|
||||
sub("[ \t]*$", "");
|
||||
# Format the error message for the
|
||||
bailout_message = "Bail out!"
|
||||
if (length($0))
|
||||
bailout_message = bailout_message " " $0
|
||||
testsuite_error(bailout_message)
|
||||
}
|
||||
# Maybe we have too look for dianogtic comments too.
|
||||
else if (comments != 0)
|
||||
{
|
||||
comment = extract_tap_comment($0);
|
||||
if (length(comment))
|
||||
report("#", comment);
|
||||
}
|
||||
}
|
||||
|
||||
## -------- ##
|
||||
## FINISH ##
|
||||
## -------- ##
|
||||
|
||||
# A "Bail out!" directive should cause us to ignore any following TAP
|
||||
# error, as well as a non-zero exit status from the TAP producer.
|
||||
if (!bailed_out)
|
||||
{
|
||||
if (!plan_seen)
|
||||
{
|
||||
testsuite_error("missing test plan")
|
||||
}
|
||||
else if (planned_tests != testno)
|
||||
{
|
||||
bad_amount = testno > planned_tests ? "many" : "few"
|
||||
testsuite_error(sprintf("too %s tests run (expected %d, got %d)",
|
||||
bad_amount, planned_tests, testno))
|
||||
}
|
||||
if (!ignore_exit)
|
||||
{
|
||||
# Fetch exit status from the last line.
|
||||
exit_message = get_test_exit_message(nextline)
|
||||
if (exit_message)
|
||||
testsuite_error(exit_message)
|
||||
}
|
||||
}
|
||||
|
||||
write_test_results()
|
||||
|
||||
exit 0
|
||||
|
||||
} # End of "BEGIN" block.
|
||||
'
|
||||
|
||||
# TODO: document that we consume the file descriptor 3 :-(
|
||||
} 3>"$log_file"
|
||||
|
||||
test $? -eq 0 || fatal "I/O or internal error"
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
39
build-aux/update-po
Executable file
39
build-aux/update-po
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
find_build_directory() {
|
||||
local build_dirs=(*/.ninja_log)
|
||||
|
||||
if [[ ! -e ${build_dirs[0]} ]]; then
|
||||
echo "error: No build directory found. Have you run 'meson build' yet?" >&2
|
||||
return 1
|
||||
elif (( ${#build_dirs[*]} > 1 )); then
|
||||
echo "error: Multiple build directories found. Unable to proceed." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
printf '%s\n' "${build_dirs[0]%/*}"
|
||||
}
|
||||
|
||||
|
||||
filter_targets_by_name() {
|
||||
if command -v jq &>/dev/null; then
|
||||
jq --arg re "$1" -r 'map(.name)[] | select(match($re))'
|
||||
else
|
||||
json_pp | awk -v filter="$1" -F'[:"]' \
|
||||
'$2 == "name" && $(NF - 1) ~ filter { print $(NF - 1) }'
|
||||
fi
|
||||
}
|
||||
|
||||
# Make things simple and require that we're in the build root rather than
|
||||
# trying to chase down the location of this script and the relative build dir.
|
||||
if [[ ! -d .git ]]; then
|
||||
echo "This script must be run from the root of the repository" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_dir=$(find_build_directory) || exit 1
|
||||
|
||||
mapfile -t targets < \
|
||||
<(meson introspect "$build_dir" --targets | filter_targets_by_name "-update-po$")
|
||||
|
||||
ninja -C "$build_dir" "${targets[@]}"
|
||||
23
configure.ac
23
configure.ac
@@ -42,12 +42,12 @@ AC_PREREQ(2.64)
|
||||
# pacman_version_micro += 1
|
||||
|
||||
m4_define([lib_current], [11])
|
||||
m4_define([lib_revision], [0])
|
||||
m4_define([lib_revision], [1])
|
||||
m4_define([lib_age], [0])
|
||||
|
||||
m4_define([pacman_version_major], [5])
|
||||
m4_define([pacman_version_minor], [1])
|
||||
m4_define([pacman_version_micro], [0])
|
||||
m4_define([pacman_version_micro], [1])
|
||||
m4_define([pacman_version],
|
||||
[pacman_version_major.pacman_version_minor.pacman_version_micro])
|
||||
|
||||
@@ -72,7 +72,7 @@ if test "x$CFLAGS" = "x"; then
|
||||
CFLAGS=""
|
||||
fi
|
||||
|
||||
# Set subsitution values for version stuff in Makefiles and anywhere else,
|
||||
# Set substitution values for version stuff in Makefiles and anywhere else,
|
||||
# and put LIB_VERSION in config.h
|
||||
AC_SUBST(LIB_VERSION)
|
||||
AC_SUBST(LIB_VERSION_INFO)
|
||||
@@ -101,7 +101,7 @@ AC_ARG_WITH(buildscript,
|
||||
# Help line for buildscript filename
|
||||
AC_ARG_WITH(makepkg-template-dir,
|
||||
AS_HELP_STRING([--with-makepkg-template-dir=name], [set the template dir used by makepkg-template]),
|
||||
[TEMPLATE_DIR=$withval], [TEMPLATE_DIR=/usr/share/makepkg-template])
|
||||
[TEMPLATE_DIR=$withval], [TEMPLATE_DIR=${datarootdir}/makepkg-template])
|
||||
|
||||
# Help line for debug package suffix
|
||||
AC_ARG_WITH(debug-suffix,
|
||||
@@ -179,7 +179,7 @@ AC_SUBST(LFS_CFLAGS)
|
||||
AC_PROG_AWK
|
||||
AC_PROG_CC_C99
|
||||
AC_PROG_INSTALL
|
||||
AC_CHECK_PROGS([PYTHON], [python2.7 python2 python], [false])
|
||||
AC_CHECK_PROGS([PYTHON], [python3 python], [false])
|
||||
AC_PATH_PROGS([BASH_SHELL], [bash bash4], [false])
|
||||
|
||||
# check for perl 5.10.1 (needed by makepkg-template)
|
||||
@@ -193,18 +193,18 @@ AC_DEFUN([AX_PROG_PERL_VERSION],
|
||||
AX_PROG_PERL_VERSION([5.10.1], [], [AC_MSG_ERROR([perl is too old])])
|
||||
|
||||
AS_IF([test "x$BASH_SHELL" = "xfalse"],
|
||||
AC_MSG_WARN([*** bash >= 4.1.0 is required for pacman scripts]),
|
||||
AC_MSG_WARN([*** bash >= 4.4.0 is required for pacman scripts]),
|
||||
[bash_version_major=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[0]]}"'`
|
||||
bash_version_minor=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[1]]}"'`
|
||||
ok=yes
|
||||
if test "$bash_version_major" -lt 4; then
|
||||
ok=no
|
||||
fi
|
||||
if test "$bash_version_major" -eq 4 && test "$bash_version_minor" -lt 1; then
|
||||
if test "$bash_version_major" -eq 4 && test "$bash_version_minor" -lt 4; then
|
||||
ok=no
|
||||
fi
|
||||
if test "$ok" = "no"; then
|
||||
AC_MSG_ERROR([*** bash >= 4.1.0 is required for pacman scripts])
|
||||
AC_MSG_ERROR([*** bash >= 4.4.0 is required for pacman scripts])
|
||||
fi
|
||||
unset bash_version_major bash_version_minor ok])
|
||||
|
||||
@@ -215,6 +215,9 @@ AM_GNU_GETTEXT_VERSION(0.13.1)
|
||||
AC_CHECK_LIB([m], [fabs], ,
|
||||
AC_MSG_ERROR([libm is needed to compile pacman!]))
|
||||
|
||||
PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], ,
|
||||
bashcompdir="${datarootdir}/bash-completion/completions")
|
||||
|
||||
# Check for libarchive
|
||||
PKG_CHECK_MODULES(LIBARCHIVE, [libarchive >= 3.0.0], ,
|
||||
AC_MSG_ERROR([*** libarchive >= 3.0.0 is needed to compile pacman!]))
|
||||
@@ -326,8 +329,6 @@ PATH_MAX_DEFINED
|
||||
AC_FUNC_FORK
|
||||
AC_FUNC_GETMNTENT
|
||||
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
|
||||
AC_FUNC_MKTIME
|
||||
AC_FUNC_STRCOLL
|
||||
AC_CHECK_FUNCS([dup2 getcwd getmntinfo gettimeofday memmove memset \
|
||||
mkdir realpath regcomp rmdir setenv setlocale strcasecmp \
|
||||
strchr strcspn strdup strerror strndup strnlen strrchr \
|
||||
@@ -442,6 +443,7 @@ if test "x$debug" = "xyes" ; then
|
||||
# Check for -fstack-protector availability
|
||||
GCC_STACK_PROTECT_LIB
|
||||
GCC_STACK_PROTECT_CC
|
||||
GCC_STACK_CLASH_PROTECTION
|
||||
GCC_FORTIFY_SOURCE_CC
|
||||
WARNING_CFLAGS="-g -Wall -Werror"
|
||||
else
|
||||
@@ -460,6 +462,7 @@ if test "x$warningflags" = "xyes" ; then
|
||||
CFLAGS_ADD([-Wformat-nonliteral], [WARNING_CFLAGS])
|
||||
CFLAGS_ADD([-Wformat-security], [WARNING_CFLAGS])
|
||||
CFLAGS_ADD([-Wignored-qualifiers], [WARNING_CFLAGS])
|
||||
CFLAGS_ADD([-Wimplicit-fallthrough], [WARNING_CFLAGS])
|
||||
CFLAGS_ADD([-Winit-self], [WARNING_CFLAGS])
|
||||
CFLAGS_ADD([-Wlogical-op], [WARNING_CFLAGS])
|
||||
CFLAGS_ADD([-Wmissing-declarations], [WARNING_CFLAGS])
|
||||
|
||||
1
doc/.gitignore
vendored
1
doc/.gitignore
vendored
@@ -6,3 +6,4 @@ asciidoc.js
|
||||
*.xml
|
||||
man3
|
||||
website.tar.gz
|
||||
Doxyfile
|
||||
|
||||
@@ -8,7 +8,7 @@ PROJECT_NAME = libalpm
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_BRIEF = "Arch Linux Package Manager Library"
|
||||
PROJECT_LOGO =
|
||||
OUTPUT_DIRECTORY = ./
|
||||
OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
@@ -3,7 +3,7 @@
|
||||
# files listed in EXTRA_DIST no matter what. However, we only add them to
|
||||
# man_MANS if --enable-asciidoc and/or --enable-doxygen are used.
|
||||
|
||||
ASCIIDOC_MANS = \
|
||||
MANPAGES = \
|
||||
alpm-hooks.5 \
|
||||
pacman.8 \
|
||||
makepkg.8 \
|
||||
@@ -16,23 +16,12 @@ ASCIIDOC_MANS = \
|
||||
makepkg.conf.5 \
|
||||
pacman.conf.5 \
|
||||
libalpm.3 \
|
||||
BUILDINFO.5
|
||||
BUILDINFO.5 \
|
||||
pacman-conf.8
|
||||
|
||||
DOXYGEN_MANS = $(wildcard man3/*.3)
|
||||
|
||||
HTML_MANPAGES = \
|
||||
alpm-hooks.5.html \
|
||||
pacman.8.html \
|
||||
makepkg.8.html \
|
||||
makepkg-template.1.html \
|
||||
repo-add.8.html \
|
||||
vercmp.8.html \
|
||||
pkgdelta.8.html \
|
||||
pacman-key.8.html \
|
||||
PKGBUILD.5.html \
|
||||
makepkg.conf.5.html \
|
||||
pacman.conf.5.html \
|
||||
libalpm.3.html
|
||||
HTML_MANPAGES = $(addsuffix .html,$(MANPAGES))
|
||||
|
||||
HTML_OTHER = \
|
||||
index.html \
|
||||
@@ -65,12 +54,11 @@ EXTRA_DIST = \
|
||||
index.asciidoc \
|
||||
submitting-patches.asciidoc \
|
||||
translation-help.asciidoc \
|
||||
Doxyfile \
|
||||
$(ASCIIDOC_MANS) \
|
||||
$(MANPAGES) \
|
||||
$(DOXYGEN_MANS)
|
||||
|
||||
# Files that should be removed, but which Automake does not know.
|
||||
MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS) $(HTML_DOCS) repo-remove.8 website.tar.gz
|
||||
MOSTLYCLEANFILES = *.xml $(MANPAGES) $(HTML_DOCS) repo-remove.8 website.tar.gz
|
||||
|
||||
# Ensure manpages are fresh when building a dist tarball
|
||||
dist-hook:
|
||||
@@ -85,17 +73,21 @@ REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
|
||||
endif
|
||||
|
||||
man_MANS =
|
||||
dist_man_MANS = $(ASCIIDOC_MANS)
|
||||
dist_man_MANS = $(MANPAGES)
|
||||
|
||||
if USE_DOXYGEN
|
||||
man_MANS += $(DOXYGEN_MANS)
|
||||
|
||||
all-local: doxygen.in
|
||||
|
||||
doxygen.in:
|
||||
Doxyfile: Doxyfile.in
|
||||
sed 's,@OUTPUT_DIRECTORY@,./,' Doxyfile.in >Doxyfile
|
||||
|
||||
doxygen.in: Doxyfile
|
||||
$(DOXYGEN) $(srcdir)/Doxyfile
|
||||
endif
|
||||
|
||||
man: $(MANPAGES)
|
||||
html: $(HTML_DOCS)
|
||||
|
||||
website: website.tar.gz
|
||||
@@ -121,7 +113,8 @@ ASCIIDOC_OPTS = \
|
||||
-a pkgdatadir=$(pkgdatadir) \
|
||||
-a localstatedir=$(localstatedir) \
|
||||
-a sysconfdir=$(sysconfdir) \
|
||||
-a datarootdir=$(datarootdir)
|
||||
-a datarootdir=$(datarootdir) \
|
||||
-a rootdir=$(ROOTDIR)
|
||||
|
||||
A2X_OPTS = \
|
||||
--no-xmllint \
|
||||
@@ -129,11 +122,12 @@ A2X_OPTS = \
|
||||
-f manpage \
|
||||
--xsltproc-opts='-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0'
|
||||
|
||||
# These rules are due to the includes and files of the asciidoc text
|
||||
$(ASCIIDOC_MANS): asciidoc.conf footer.asciidoc Makefile.am
|
||||
# Generate manpages
|
||||
%: %.asciidoc asciidoc.conf footer.asciidoc Makefile.am
|
||||
$(AM_V_GEN)a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS) --out-file=./$@.xml" $(srcdir)/$@.asciidoc
|
||||
|
||||
%.html: %.asciidoc
|
||||
# Generate HTML pages
|
||||
%.html: %.asciidoc asciidoc.conf footer.asciidoc Makefile.am
|
||||
$(AM_V_GEN)asciidoc $(ASCIIDOC_OPTS) -o - $*.asciidoc | \
|
||||
sed -e 's/\r$$//' > $@
|
||||
|
||||
@@ -142,27 +136,15 @@ HACKING.html: ../HACKING
|
||||
sed -e 's/\r$$//' > $@
|
||||
|
||||
# Customizations for certain HTML docs
|
||||
$(HTML_MANPAGES): asciidoc.conf footer.asciidoc Makefile.am
|
||||
$(HTML_OTHER): asciidoc.conf Makefile.am
|
||||
%.html: ASCIIDOC_OPTS += -a linkcss -a toc -a icons -a max-width=960px -a stylesheet=asciidoc-override.css
|
||||
%.8.html: ASCIIDOC_OPTS += -d manpage
|
||||
%.5.html: ASCIIDOC_OPTS += -d manpage
|
||||
%.3.html: ASCIIDOC_OPTS += -d manpage
|
||||
|
||||
# Dependency rules
|
||||
alpm-hooks.5 alpm-hooks.5.html: alpm-hooks.5.asciidoc
|
||||
pacman.8 pacman.8.html: pacman.8.asciidoc
|
||||
makepkg.8 makepkg.8.html: makepkg.8.asciidoc
|
||||
makepkg-template.1 makepkg-template.1.html: makepkg-template.1.asciidoc
|
||||
repo-add.8 repo-add.8.html: repo-add.8.asciidoc
|
||||
vercmp.8 vercmp.8.html: vercmp.8.asciidoc
|
||||
pkgdelta.8 pkgdelta.8.html: pkgdelta.8.asciidoc
|
||||
pacman-key.8 pacman-key.8.html: pacman-key.8.asciidoc
|
||||
# Custom dependency rules
|
||||
PKGBUILD.5 PKGBUILD.5.html: PKGBUILD.5.asciidoc PKGBUILD-example.txt
|
||||
makepkg.conf.5 makepkg.conf.5.html: makepkg.conf.5.asciidoc
|
||||
pacman.conf.5 pacman.conf.5.html: pacman.conf.5.asciidoc
|
||||
libalpm.3 libalpm.3.html: libalpm.3.asciidoc
|
||||
# this one is just a symlink
|
||||
|
||||
# Manpages as symlinks
|
||||
repo-remove.8: repo-add.8
|
||||
$(RM) repo-remove.8
|
||||
$(LN_S) repo-add.8 repo-remove.8
|
||||
|
||||
@@ -18,9 +18,9 @@ PKGBUILD is written, the actual package is built using makepkg and installed
|
||||
with pacman.
|
||||
|
||||
NOTE: An example PKGBUILD, useful for reference, is located in '{pkgdatadir}'
|
||||
along with other example files such as a ChangeLog and an install
|
||||
script. You can copy the provided PKGBUILD.proto file to a new package build
|
||||
directory and make customizations to suit your needs.
|
||||
along with other example files such as an install script. You can copy the
|
||||
provided PKGBUILD.proto file to a new package build directory and make
|
||||
customizations to suit your needs.
|
||||
|
||||
|
||||
Options and Directives
|
||||
@@ -56,11 +56,13 @@ new `pkgver`. This is most useful when used with sources from version control
|
||||
systems (see below).
|
||||
|
||||
*pkgrel*::
|
||||
This is the release number specific to the Arch Linux release. This
|
||||
This is the release number specific to the distribution. This
|
||||
allows package maintainers to make updates to the package's configure
|
||||
flags, for example. This is typically set to '1' for each new upstream
|
||||
software release and incremented for intermediate PKGBUILD updates. The
|
||||
variable is not allowed to contain hyphens.
|
||||
variable is a positive integer, with an optional subrelease level
|
||||
specified by adding another positive integer separated by a period
|
||||
(i.e. in the form x.y).
|
||||
|
||||
*epoch*::
|
||||
Used to force the package to be seen as newer than any previous versions
|
||||
@@ -152,7 +154,7 @@ contain whitespace characters.
|
||||
be skipped. To easily generate md5sums, run ``makepkg -g >> PKGBUILD''.
|
||||
If desired, move the md5sums line to an appropriate location.
|
||||
|
||||
*sha1sums, sha256sums, sha384sums, sha512sums (arrays)*::
|
||||
*sha1sums, sha224sums, sha256sums, sha384sums, sha512sums, b2sums (arrays)*::
|
||||
Alternative integrity checks that makepkg supports; these all behave
|
||||
similar to the md5sums option described above. To enable use and generation
|
||||
of these checksums, be sure to set up the `INTEGRITY_CHECK` option in
|
||||
@@ -212,8 +214,9 @@ underscore and the architecture name e.g., 'checkdepends_x86_64=()'.
|
||||
An array of packages (and accompanying reasons) that are not essential for
|
||||
base functionality, but may be necessary to make full use of the contents
|
||||
of this package. optdepends are currently for informational purposes only
|
||||
and are not utilized by pacman during dependency resolution. The format
|
||||
for specifying optdepends is:
|
||||
and are not utilized by pacman during dependency resolution. Packages in
|
||||
this list follow the same format as depends, with an optional description
|
||||
appended. The format for specifying optdepends descriptions is:
|
||||
|
||||
optdepends=('python: for library bindings')
|
||||
+
|
||||
|
||||
@@ -30,9 +30,13 @@ DESCRIPTION
|
||||
libalpm provides the ability to specify hooks to run before or after
|
||||
transactions based on the packages and/or files being modified. Hooks consist
|
||||
of a single '[Action]' section describing the action to be run and one or more
|
||||
'[Trigger]' section describing which transactions it should be run for. Hook
|
||||
'[Trigger]' section describing which transactions it should be run for.
|
||||
|
||||
Hooks are read from files located in the system hook directory
|
||||
+{datarootdir}/libalpm/hooks+, and additional custom directories specified in
|
||||
linkman:pacman.conf[5] (the default is +{sysconfdir}/pacman.d/hooks+). The
|
||||
file names are required to have the suffix ".hook". Hooks are run in
|
||||
alphabetical order of their file name.
|
||||
alphabetical order of their file name, where the ordering ignores the suffix.
|
||||
|
||||
TRIGGERS
|
||||
--------
|
||||
|
||||
@@ -43,9 +43,11 @@ There are several man pages available for the programs, utilities, and
|
||||
configuration files dealing with pacman.
|
||||
|
||||
* linkman:alpm-hooks[5]
|
||||
* linkman:BUILDINFO[5]
|
||||
* linkman:PKGBUILD[5]
|
||||
* linkman:libalpm[3]
|
||||
* linkman:makepkg[8]
|
||||
* linkman:makepkg-template[1]
|
||||
* linkman:makepkg.conf[5]
|
||||
* linkman:pacman[8]
|
||||
* linkman:pacman-key[8]
|
||||
@@ -57,11 +59,11 @@ configuration files dealing with pacman.
|
||||
Changelog
|
||||
~~~~~~~~~
|
||||
For a good idea of what is going on in pacman development, take a look at the
|
||||
link:https://projects.archlinux.org/pacman.git/[Git summary page] for the
|
||||
link:https://git.archlinux.org/pacman.git/[Git summary page] for the
|
||||
project.
|
||||
|
||||
See the most recent
|
||||
link:https://projects.archlinux.org/pacman.git/tree/NEWS[NEWS]
|
||||
link:https://git.archlinux.org/pacman.git/tree/NEWS[NEWS]
|
||||
file for a not-as-frequently-updated list of changes. However, this should
|
||||
contain the biggest changes in a format more concise than the commit log.
|
||||
|
||||
@@ -75,7 +77,10 @@ Releases
|
||||
[frame="topbot",grid="none",options="header,autowidth"]
|
||||
!======
|
||||
!Version !Date
|
||||
!5.1.0 !2017-05-28
|
||||
!5.1.2 !2018-12-25
|
||||
!5.1.1 !2018-07-27
|
||||
!5.1.0 !2018-05-28
|
||||
!5.0.2 !2017-06-03
|
||||
!5.0.1 !2016-02-23
|
||||
!5.0.0 !2016-01-30
|
||||
!4.2.1 !2015-02-20
|
||||
@@ -198,8 +203,8 @@ Development
|
||||
Mailing List
|
||||
~~~~~~~~~~~~
|
||||
There is a mailing list devoted to pacman development, hosted by Arch Linux.
|
||||
link:https://mailman.archlinux.org/mailman/listinfo/pacman-dev/[Subscribe] or
|
||||
link:https://mailman.archlinux.org/pipermail/pacman-dev/[view the archives].
|
||||
link:https://lists.archlinux.org/listinfo/pacman-dev/[Subscribe] or
|
||||
link:https://lists.archlinux.org/pipermail/pacman-dev/[view the archives].
|
||||
|
||||
Source Code
|
||||
~~~~~~~~~~~
|
||||
@@ -210,11 +215,11 @@ these trees).
|
||||
|
||||
The current development tree can be fetched with the following command:
|
||||
|
||||
git clone git://projects.archlinux.org/pacman.git pacman
|
||||
git clone git://git.archlinux.org/pacman.git pacman
|
||||
|
||||
which will fetch the full development history into a directory named pacman.
|
||||
You can browse the source as well using
|
||||
link:https://projects.archlinux.org/pacman.git/[cgit]. HTTP/HTTPS URLs are also
|
||||
link:https://git.archlinux.org/pacman.git/[cgit]. HTTP/HTTPS URLs are also
|
||||
available for cloning purposes; these URLs are listed at the above page.
|
||||
|
||||
If you are interested in hacking on pacman, it is highly recommended you join
|
||||
@@ -233,15 +238,13 @@ Although the package manager itself is quite simple, many scripts have been
|
||||
developed that help automate building and installing packages. These are used
|
||||
extensively in link:https://www.archlinux.org/[Arch Linux]. Most of these utilities
|
||||
are available in the Arch Linux projects
|
||||
link:https://projects.archlinux.org/[code browser].
|
||||
link:https://git.archlinux.org/[code browser].
|
||||
|
||||
Utilities available:
|
||||
|
||||
* link:https://projects.archlinux.org/abs.git/[abs] - ABS (Arch Build System), scripts to download & use the Arch Linux PKGBUILD tree
|
||||
* link:https://projects.archlinux.org/dbscripts.git/[dbscripts] - scripts used by Arch Linux to manage the main package repositories
|
||||
* link:https://projects.archlinux.org/devtools.git/[devtools] - tools to assist in packaging and dependency checking
|
||||
* link:https://projects.archlinux.org/namcap.git/[namcap] - a package analysis utility written in python
|
||||
* link:https://projects.archlinux.org/srcpac.git/[srcpac] - a bash build-from-source pacman wrapper
|
||||
* link:https://git.archlinux.org/dbscripts.git/[dbscripts] - scripts used by Arch Linux to manage the main package repositories
|
||||
* link:https://git.archlinux.org/devtools.git/[devtools] - tools to assist in packaging and dependency checking
|
||||
* link:https://git.archlinux.org/namcap.git/[namcap] - a package analysis utility written in python
|
||||
|
||||
Bugs
|
||||
----
|
||||
|
||||
@@ -183,7 +183,7 @@ Options
|
||||
**INTEGRITY_CHECK=(**check1 ...**)**::
|
||||
File integrity checks to use. Multiple checks may be specified; this
|
||||
affects both generation and checking. The current valid options are:
|
||||
`md5`, `sha1`, `sha256`, `sha384`, and `sha512`.
|
||||
`md5`, `sha1`, `sha224`, `sha256`, `sha384`, `sha512`, and `b2`.
|
||||
|
||||
**STRIP_BINARIES=**"--strip-all"::
|
||||
Options to be used when stripping binaries. See linkman:strip[1]
|
||||
@@ -249,16 +249,19 @@ Options
|
||||
**COMPRESSGZ=**"(gzip -c -f -n)"::
|
||||
**COMPRESSBZ2=**"(bzip2 -c -f)"::
|
||||
**COMPRESSXZ=**"(xz -c -z -)"::
|
||||
**COMPRESSZST=**"(zstd -c -z -)"::
|
||||
**COMPRESSLZO**"(lzop -q)"::
|
||||
**COMPRESSLRZ=**"(lrzip -q)"::
|
||||
**COMPRESSLZ4=**"(lz4 -q)"::
|
||||
**COMPRESSZ=**"(compress -c -f)"::
|
||||
**COMPRESSLZ=**"(lzip -c -f)"::
|
||||
Sets the command and options used when compressing compiled or source
|
||||
packages in the named format.
|
||||
|
||||
**PKGEXT=**".pkg.tar.gz", **SRCEXT=**".src.tar.gz"::
|
||||
Sets the compression used when making compiled or source packages.
|
||||
Valid suffixes are `.tar`, `.tar.gz`, `.tar.bz2`, `.tar.xz`,
|
||||
`.tar.lzo`, `.tar.lrz`, and `.tar.Z`.
|
||||
Valid suffixes are `.tar`, `.tar.gz`, `.tar.bz2`, `.tar.xz`, `.tar.zst`,
|
||||
`.tar.lzo`, `.tar.lrz`, `.tar.lz4`, `.tar.lz` and `.tar.Z`.
|
||||
Do not touch these unless you know what you are doing.
|
||||
|
||||
|
||||
|
||||
149
doc/meson.build
Normal file
149
doc/meson.build
Normal file
@@ -0,0 +1,149 @@
|
||||
manpages = [
|
||||
{ 'name': 'alpm-hooks.5' },
|
||||
{ 'name': 'pacman.8' },
|
||||
{ 'name': 'makepkg.8' },
|
||||
{ 'name': 'makepkg-template.1' },
|
||||
{ 'name': 'repo-add.8' },
|
||||
{ 'name': 'vercmp.8' },
|
||||
{ 'name': 'pkgdelta.8' },
|
||||
{ 'name': 'pacman-key.8' },
|
||||
{ 'name': 'PKGBUILD.5', 'extra_depends' : [ 'PKGBUILD-example.txt' ] },
|
||||
{ 'name': 'makepkg.conf.5' },
|
||||
{ 'name': 'pacman.conf.5' },
|
||||
{ 'name': 'libalpm.3' },
|
||||
{ 'name': 'BUILDINFO.5' },
|
||||
{ 'name': 'pacman-conf.8' },
|
||||
]
|
||||
|
||||
sitepages = [
|
||||
{ 'name': 'submitting-patches' },
|
||||
{ 'name': 'translation-help' },
|
||||
{ 'name': 'HACKING', 'source': '../HACKING' },
|
||||
{ 'name': 'index' },
|
||||
]
|
||||
|
||||
asciidoc_conf = join_paths(meson.current_source_dir(), 'asciidoc.conf')
|
||||
|
||||
asciidoc_opts = [
|
||||
'-f', asciidoc_conf,
|
||||
'-a', 'pacman_version="@0@"'.format(PACKAGE_VERSION),
|
||||
'-a', 'pacman_date=@0@'.format(run_command('date', '+%Y-%m-%d').stdout().strip()),
|
||||
'-a', 'pkgdatadir=@0@'.format(PKGDATADIR),
|
||||
'-a', 'localstatedir=@0@'.format(LOCALSTATEDIR),
|
||||
'-a', 'sysconfdir=@0@'.format(SYSCONFDIR),
|
||||
'-a', 'datarootdir=@0@'.format(DATAROOTDIR),
|
||||
'-a', 'rootdir=@0@'.format(ROOTDIR),
|
||||
]
|
||||
|
||||
html_targets = []
|
||||
html_files = []
|
||||
|
||||
foreach page : manpages
|
||||
manpage = page['name']
|
||||
htmlpage = '@0@.html'.format(manpage)
|
||||
input = '@0@.asciidoc'.format(manpage)
|
||||
|
||||
section = page['name'].split('.')[-1]
|
||||
|
||||
mandirn = join_paths(MANDIR, 'man' + section)
|
||||
|
||||
custom_target(
|
||||
manpage,
|
||||
command : [
|
||||
A2X,
|
||||
'--no-xmllint',
|
||||
'-d', 'manpage',
|
||||
'-f', 'manpage',
|
||||
'--xsltproc-opts', '-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0',
|
||||
'-D', '@OUTDIR@',
|
||||
'--asciidoc-opts', ' '.join(asciidoc_opts),
|
||||
'@INPUT@',
|
||||
],
|
||||
input : input,
|
||||
output : [manpage],
|
||||
depend_files : [
|
||||
asciidoc_conf,
|
||||
] + page.get('extra_depends', []),
|
||||
install : true,
|
||||
install_dir : mandirn,
|
||||
)
|
||||
endforeach
|
||||
|
||||
foreach page: manpages + sitepages
|
||||
manpage = page['name']
|
||||
htmlpage = '@0@.html'.format(manpage)
|
||||
input = page.get('source', '@0@.asciidoc'.format(manpage))
|
||||
|
||||
html = custom_target(
|
||||
htmlpage,
|
||||
command : [
|
||||
ASCIIDOC,
|
||||
] + asciidoc_opts + [
|
||||
'-a', 'linkcss',
|
||||
'-a', 'toc',
|
||||
'-a', 'icons',
|
||||
'-a', 'max-width=960px',
|
||||
'-a', 'stylesheet=asciidoc-override.css',
|
||||
'-o', '@OUTPUT@',
|
||||
'@INPUT@',
|
||||
],
|
||||
input : input,
|
||||
output : [htmlpage],
|
||||
depend_files : [
|
||||
asciidoc_conf,
|
||||
'asciidoc-override.css',
|
||||
] + page.get('extra_depends', []),
|
||||
build_by_default : false,
|
||||
install : false,
|
||||
)
|
||||
html_targets += [html]
|
||||
html_files += [htmlpage]
|
||||
endforeach
|
||||
|
||||
run_target('html',
|
||||
command : ['/bin/true'],
|
||||
depends : html_targets)
|
||||
|
||||
custom_target(
|
||||
'website.tar.gz',
|
||||
command : [
|
||||
'bsdtar', 'czf', '@OUTPUT@',
|
||||
'-C', meson.current_build_dir(),
|
||||
] + html_files + [
|
||||
'-C', meson.current_source_dir(),
|
||||
'asciidoc-override.css',
|
||||
'-C', '/etc/asciidoc/stylesheets/',
|
||||
'asciidoc.css',
|
||||
'-C', '/etc/asciidoc/javascripts/',
|
||||
'asciidoc.js',
|
||||
'-C', '/etc/asciidoc/',
|
||||
'images',
|
||||
],
|
||||
output : ['website.tar.gz'],
|
||||
build_by_default : false,
|
||||
depends : html_targets,
|
||||
)
|
||||
|
||||
meson.add_install_script(MESON_MAKE_SYMLINK,
|
||||
'repo-add.8',
|
||||
join_paths(MANDIR, 'man8/repo-remove.8'))
|
||||
|
||||
doxygen = find_program('doxygen', required : get_option('doxygen'))
|
||||
if doxygen.found() and not get_option('doxygen').disabled()
|
||||
doxyconf = configuration_data()
|
||||
doxyconf.set('OUTPUT_DIRECTORY', meson.current_build_dir())
|
||||
doxyfile = configure_file(
|
||||
input : 'Doxyfile.in',
|
||||
output : 'Doxyfile',
|
||||
configuration : doxyconf,
|
||||
install : false)
|
||||
|
||||
custom_target(
|
||||
'doxygen',
|
||||
input : doxyfile,
|
||||
output : ['man3'],
|
||||
command : [doxygen, doxyfile],
|
||||
build_by_default : true,
|
||||
install : true,
|
||||
install_dir : MANDIR)
|
||||
endif
|
||||
67
doc/pacman-conf.8.asciidoc
Normal file
67
doc/pacman-conf.8.asciidoc
Normal file
@@ -0,0 +1,67 @@
|
||||
pacman-conf(8)
|
||||
==============
|
||||
|
||||
Name
|
||||
----
|
||||
pacman-conf - query pacman's configuration file
|
||||
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
'pacman-conf' [options] [<directive> ...]
|
||||
|
||||
'pacman-conf' (--repo-list|--help|--version)
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
'pacman-conf' is a utility for parsing the 'pacman' configuration file
|
||||
and returning script-friendly output. It is designed to properly handle
|
||||
non-trivial configuration features such as variable interpolation and
|
||||
the use of the Include directive, and guarantees that it will return the
|
||||
same configuration values which 'pacman' itself would use.
|
||||
|
||||
'pacman-conf' will output the fully-resolved contents of the
|
||||
configuration file by default, or, if provided with the name of a
|
||||
configuration directive, output the contents of the given directive alone.
|
||||
|
||||
|
||||
Options
|
||||
-------
|
||||
*-c, \--config* <path>::
|
||||
Specify an alternate configuration file.
|
||||
|
||||
*-R, \--rootdir* <path>::
|
||||
Specify an alternate installation root (default is `/`).
|
||||
|
||||
*-r, \--repo* <remote>::
|
||||
Query options for a specific repository.
|
||||
|
||||
*-v, \--verbose*::
|
||||
Always shown directive names.
|
||||
|
||||
*-l, \--repo-list*::
|
||||
List configured repositories.
|
||||
|
||||
*-h, \--help*::
|
||||
Output syntax and command line options.
|
||||
|
||||
*-V, \--version*::
|
||||
Display version and exit.
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
pacman-conf -r core Usage::
|
||||
Show the value of the Usage configuration option for core repository.
|
||||
|
||||
pacman-conf HoldPkg::
|
||||
Show the value of the HoldPkg configuration option.
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
linkman:pacman.conf[5]
|
||||
|
||||
include::footer.asciidoc[]
|
||||
@@ -97,7 +97,13 @@ Operations
|
||||
Displays the program version.
|
||||
|
||||
*-v, \--verify*::
|
||||
Verify the file(s) specified by the signature(s).
|
||||
Assume that the first argument is a signature and verify it. If a second
|
||||
argument is provided, it is the file to be verified.
|
||||
+
|
||||
With only one argument given, assume that the signature is a detached
|
||||
signature, and look for a matching data file to verify by stripping the file
|
||||
extension. If no matching data file is found, fall back on GnuPG semantics and
|
||||
attempt to verify a file with an embedded signature.
|
||||
|
||||
|
||||
Options
|
||||
|
||||
@@ -130,6 +130,16 @@ Options
|
||||
*NOTE*: If specified, this is an absolute path, and the root path is
|
||||
not automatically prepended.
|
||||
|
||||
*-r, \--root* <path>::
|
||||
Specify an alternative installation root (default is +{rootdir}+). This should
|
||||
not be used as a way to install software into `/usr/local` instead of
|
||||
`/usr`.
|
||||
*NOTE*: If database path or log file are not specified on either the
|
||||
command line or in linkman:pacman.conf[5], their default location will
|
||||
be inside this root path.
|
||||
*NOTE*: This option is not suitable for performing operations on a mounted
|
||||
guest system. See '\--sysroot' instead.
|
||||
|
||||
*-v, \--verbose*::
|
||||
Output paths such as as the Root, Conf File, DB Path, Cache Dirs, etc.
|
||||
|
||||
@@ -504,7 +514,7 @@ designated to be backed up. During an upgrade, three MD5 hashes are used for
|
||||
each backup file to determine the required action: one for the original file
|
||||
installed, one for the new file that is about to be installed, and one for the
|
||||
actual file existing on the file system. After comparing these three hashes, the
|
||||
follow scenarios can result:
|
||||
following scenarios can result:
|
||||
|
||||
original=X, current=X, new=X::
|
||||
All three files are the same, so overwrites are not an issue. Install the
|
||||
|
||||
@@ -19,6 +19,9 @@ Each section defines a package repository that pacman can use when searching
|
||||
for packages in '\--sync' mode. The exception to this is the options section,
|
||||
which defines global options.
|
||||
|
||||
Comments are only supported by beginning a line with the hash (#) symbol.
|
||||
Comments cannot begin in the middle of a line.
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
@@ -173,7 +176,7 @@ Options
|
||||
operation on a local file. Uses the value from SigLevel as the default.
|
||||
|
||||
*RemoteFileSigLevel =* ...::
|
||||
Set the signature verification level for installing packages using the "-U"
|
||||
Set the signature verification level for installing packages using the "-U"
|
||||
operation on a remote file URL. Uses the value from SigLevel as the default.
|
||||
|
||||
*UseSyslog*::
|
||||
|
||||
@@ -20,7 +20,7 @@ started with GIT if you have not worked with it before.
|
||||
|
||||
The pacman code can be fetched using the following command:
|
||||
|
||||
git clone git://projects.archlinux.org/pacman.git
|
||||
git clone git://git.archlinux.org/pacman.git
|
||||
|
||||
|
||||
Creating your patch
|
||||
@@ -39,7 +39,7 @@ address if you're afraid of spam.
|
||||
|
||||
* Describe your patch.
|
||||
|
||||
It helps if you describe the overview and goals of the patch in the git commit
|
||||
It helps if you describe the overview and goals of the patch in the git commit
|
||||
log. This allows others to see what you intended so as to compare it to what
|
||||
was actually done, and allows better feedback.
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ Pacman - Translating
|
||||
This document is here to guide you in helping translate pacman messages,
|
||||
libalpm messages, and the manual pages for the entire pacman package.
|
||||
|
||||
We are currently using http://www.transifex.com/[Transifex] as the translation
|
||||
We are currently using https://www.transifex.com/[Transifex] as the translation
|
||||
platform for pacman and libalpm. You will need to sign up for an account there
|
||||
and then register with a translation team on the
|
||||
http://www.transifex.com/projects/p/archlinux-pacman/[pacman project page].
|
||||
https://www.transifex.com/projects/p/archlinux-pacman/[pacman project page].
|
||||
|
||||
NOTE: This may be old information due to our switch to Transifex, but the
|
||||
gettext website is a very useful guide to read before embarking on translation
|
||||
@@ -31,7 +31,7 @@ either be hand-edited, or modified with a tool such as poedit, gtranslator or
|
||||
kbabel. Using a translation tool tends to make the job easier.
|
||||
|
||||
Please read up on Transifex usage using the
|
||||
http://docs.transifex.com/[Transifex Help] if you are not familiar.
|
||||
https://docs.transifex.com/[Transifex Help] if you are not familiar.
|
||||
|
||||
Transifex provides a command-line client to help with translations. Here is
|
||||
an example set of commands if you have a source code checkout and are not
|
||||
@@ -78,7 +78,7 @@ Incremental Updates
|
||||
If you have more advanced needs you will have to get a copy of the pacman
|
||||
repository.
|
||||
|
||||
git clone git://projects.archlinux.org/pacman.git pacman
|
||||
git clone git://git.archlinux.org/pacman.git pacman
|
||||
|
||||
Next, you will need to run `./autogen.sh` and `./configure` in the base
|
||||
directory to generate the correct Makefiles. At this point, all necessary
|
||||
|
||||
@@ -87,7 +87,7 @@ BUILDENV=(!distcc color !ccache check !sign)
|
||||
#
|
||||
OPTIONS=(strip docs libtool staticlibs emptydirs zipman purge !debug)
|
||||
|
||||
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
|
||||
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
|
||||
INTEGRITY_CHECK=(md5)
|
||||
#-- Options to be used when stripping binaries. See `man strip' for details.
|
||||
STRIP_BINARIES="@STRIP_BINARIES@"
|
||||
@@ -130,9 +130,12 @@ DBGSRCDIR="/usr/src/debug"
|
||||
COMPRESSGZ=(gzip -c -f -n)
|
||||
COMPRESSBZ2=(bzip2 -c -f)
|
||||
COMPRESSXZ=(xz -c -z -)
|
||||
COMPRESSZST=(zstd -c -z -q -)
|
||||
COMPRESSLRZ=(lrzip -q)
|
||||
COMPRESSLZO=(lzop -q)
|
||||
COMPRESSZ=(compress -c -f)
|
||||
COMPRESSLZ4=(lz4 -q)
|
||||
COMPRESSLZ=(lzip -c -f)
|
||||
|
||||
#########################################################################
|
||||
# EXTENSION DEFAULTS
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#GPGDir = @sysconfdir@/pacman.d/gnupg/
|
||||
#HookDir = @sysconfdir@/pacman.d/hooks/
|
||||
HoldPkg = pacman glibc
|
||||
#XferCommand = /usr/bin/curl -C - -f %u > %o
|
||||
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
|
||||
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
||||
#CleanMethod = KeepInstalled
|
||||
#UseDelta = 0.7
|
||||
|
||||
@@ -53,6 +53,7 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
|
||||
const char *pkgname, *pkgver;
|
||||
alpm_trans_t *trans;
|
||||
alpm_pkg_t *local;
|
||||
alpm_pkg_t *dup;
|
||||
|
||||
/* Sanity checks */
|
||||
CHECK_HANDLE(handle, return -1);
|
||||
@@ -70,12 +71,16 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
|
||||
|
||||
_alpm_log(handle, ALPM_LOG_DEBUG, "adding package '%s'\n", pkgname);
|
||||
|
||||
if(alpm_pkg_find(trans->add, pkgname)) {
|
||||
if((dup = alpm_pkg_find(trans->add, pkgname))) {
|
||||
if(dup == pkg) {
|
||||
_alpm_log(handle, ALPM_LOG_DEBUG, "skipping duplicate target: %s\n", pkgname);
|
||||
return 0;
|
||||
}
|
||||
/* error for separate packages with the same name */
|
||||
RET_ERR(handle, ALPM_ERR_TRANS_DUP_TARGET, -1);
|
||||
}
|
||||
|
||||
local = _alpm_db_get_pkgfromcache(handle->db_local, pkgname);
|
||||
if(local) {
|
||||
if((local = _alpm_db_get_pkgfromcache(handle->db_local, pkgname))) {
|
||||
const char *localpkgname = local->name;
|
||||
const char *localpkgver = local->version;
|
||||
int cmp = _alpm_pkg_compare_versions(pkg, local);
|
||||
@@ -427,7 +432,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
|
||||
ASSERT(trans != NULL, return -1);
|
||||
|
||||
/* see if this is an upgrade. if so, remove the old package first */
|
||||
if((oldpkg = newpkg->oldpkg)) {
|
||||
if(_alpm_db_get_pkgfromcache(db, newpkg->name) && (oldpkg = newpkg->oldpkg)) {
|
||||
int cmp = _alpm_pkg_compare_versions(newpkg, oldpkg);
|
||||
if(cmp < 0) {
|
||||
log_msg = "downgrading";
|
||||
|
||||
@@ -118,7 +118,9 @@ typedef enum _alpm_errno_t {
|
||||
ALPM_ERR_LIBARCHIVE,
|
||||
ALPM_ERR_LIBCURL,
|
||||
ALPM_ERR_EXTERNAL_DOWNLOAD,
|
||||
ALPM_ERR_GPGME
|
||||
ALPM_ERR_GPGME,
|
||||
/* Missing compile-time features */
|
||||
ALPM_ERR_MISSING_CAPABILITY_SIGNATURES
|
||||
} alpm_errno_t;
|
||||
|
||||
/** Returns the current error code from the handle. */
|
||||
@@ -1044,7 +1046,7 @@ alpm_list_t *alpm_db_get_groupcache(alpm_db_t *db);
|
||||
*/
|
||||
alpm_list_t *alpm_db_search(alpm_db_t *db, const alpm_list_t *needles);
|
||||
|
||||
typedef enum _alpm_db_usage_ {
|
||||
typedef enum _alpm_db_usage_t {
|
||||
ALPM_DB_USAGE_SYNC = 1,
|
||||
ALPM_DB_USAGE_SEARCH = (1 << 1),
|
||||
ALPM_DB_USAGE_INSTALL = (1 << 2),
|
||||
@@ -1450,7 +1452,7 @@ alpm_list_t *alpm_find_group_pkgs(alpm_list_t *dbs, const char *name);
|
||||
* Sync
|
||||
*/
|
||||
|
||||
alpm_pkg_t *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync);
|
||||
alpm_pkg_t *alpm_sync_get_new_version(alpm_pkg_t *pkg, alpm_list_t *dbs_sync);
|
||||
|
||||
/** @addtogroup alpm_api_trans Transaction Functions
|
||||
* Functions to manipulate libalpm transactions
|
||||
@@ -1461,8 +1463,7 @@ alpm_pkg_t *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync);
|
||||
typedef enum _alpm_transflag_t {
|
||||
/** Ignore dependency checks. */
|
||||
ALPM_TRANS_FLAG_NODEPS = 1,
|
||||
/** Ignore file conflicts and overwrite files. */
|
||||
ALPM_TRANS_FLAG_FORCE = (1 << 1),
|
||||
/* (1 << 1) flag can go here */
|
||||
/** Delete files even if they are tagged as backup. */
|
||||
ALPM_TRANS_FLAG_NOSAVE = (1 << 2),
|
||||
/** Ignore version numbers when checking dependencies. */
|
||||
|
||||
@@ -153,6 +153,18 @@ static alpm_list_t *_cache_get_optdepends(alpm_pkg_t *pkg)
|
||||
return pkg->optdepends;
|
||||
}
|
||||
|
||||
static alpm_list_t *_cache_get_makedepends(alpm_pkg_t *pkg)
|
||||
{
|
||||
LAZY_LOAD(INFRQ_DESC);
|
||||
return pkg->makedepends;
|
||||
}
|
||||
|
||||
static alpm_list_t *_cache_get_checkdepends(alpm_pkg_t *pkg)
|
||||
{
|
||||
LAZY_LOAD(INFRQ_DESC);
|
||||
return pkg->checkdepends;
|
||||
}
|
||||
|
||||
static alpm_list_t *_cache_get_conflicts(alpm_pkg_t *pkg)
|
||||
{
|
||||
LAZY_LOAD(INFRQ_DESC);
|
||||
@@ -303,36 +315,38 @@ static int _cache_force_load(alpm_pkg_t *pkg)
|
||||
* logic.
|
||||
*/
|
||||
static struct pkg_operations local_pkg_ops = {
|
||||
.get_base = _cache_get_base,
|
||||
.get_desc = _cache_get_desc,
|
||||
.get_url = _cache_get_url,
|
||||
.get_builddate = _cache_get_builddate,
|
||||
.get_base = _cache_get_base,
|
||||
.get_desc = _cache_get_desc,
|
||||
.get_url = _cache_get_url,
|
||||
.get_builddate = _cache_get_builddate,
|
||||
.get_installdate = _cache_get_installdate,
|
||||
.get_packager = _cache_get_packager,
|
||||
.get_arch = _cache_get_arch,
|
||||
.get_isize = _cache_get_isize,
|
||||
.get_reason = _cache_get_reason,
|
||||
.get_validation = _cache_get_validation,
|
||||
.has_scriptlet = _cache_has_scriptlet,
|
||||
.get_licenses = _cache_get_licenses,
|
||||
.get_groups = _cache_get_groups,
|
||||
.get_depends = _cache_get_depends,
|
||||
.get_optdepends = _cache_get_optdepends,
|
||||
.get_conflicts = _cache_get_conflicts,
|
||||
.get_provides = _cache_get_provides,
|
||||
.get_replaces = _cache_get_replaces,
|
||||
.get_files = _cache_get_files,
|
||||
.get_backup = _cache_get_backup,
|
||||
.get_packager = _cache_get_packager,
|
||||
.get_arch = _cache_get_arch,
|
||||
.get_isize = _cache_get_isize,
|
||||
.get_reason = _cache_get_reason,
|
||||
.get_validation = _cache_get_validation,
|
||||
.has_scriptlet = _cache_has_scriptlet,
|
||||
.get_licenses = _cache_get_licenses,
|
||||
.get_groups = _cache_get_groups,
|
||||
.get_depends = _cache_get_depends,
|
||||
.get_optdepends = _cache_get_optdepends,
|
||||
.get_makedepends = _cache_get_makedepends,
|
||||
.get_checkdepends = _cache_get_checkdepends,
|
||||
.get_conflicts = _cache_get_conflicts,
|
||||
.get_provides = _cache_get_provides,
|
||||
.get_replaces = _cache_get_replaces,
|
||||
.get_files = _cache_get_files,
|
||||
.get_backup = _cache_get_backup,
|
||||
|
||||
.changelog_open = _cache_changelog_open,
|
||||
.changelog_read = _cache_changelog_read,
|
||||
.changelog_open = _cache_changelog_open,
|
||||
.changelog_read = _cache_changelog_read,
|
||||
.changelog_close = _cache_changelog_close,
|
||||
|
||||
.mtree_open = _cache_mtree_open,
|
||||
.mtree_next = _cache_mtree_next,
|
||||
.mtree_close = _cache_mtree_close,
|
||||
.mtree_open = _cache_mtree_open,
|
||||
.mtree_next = _cache_mtree_next,
|
||||
.mtree_close = _cache_mtree_close,
|
||||
|
||||
.force_load = _cache_force_load,
|
||||
.force_load = _cache_force_load,
|
||||
};
|
||||
|
||||
static int checkdbdir(alpm_db_t *db)
|
||||
@@ -773,6 +787,10 @@ static int local_db_read(alpm_pkg_t *info, int inforeq)
|
||||
READ_AND_SPLITDEP(info->depends);
|
||||
} else if(strcmp(line, "%OPTDEPENDS%") == 0) {
|
||||
READ_AND_SPLITDEP(info->optdepends);
|
||||
} else if(strcmp(line, "%MAKEDEPENDS%") == 0) {
|
||||
READ_AND_SPLITDEP(info->makedepends);
|
||||
} else if(strcmp(line, "%CHECKDEPENDS%") == 0) {
|
||||
READ_AND_SPLITDEP(info->checkdepends);
|
||||
} else if(strcmp(line, "%CONFLICTS%") == 0) {
|
||||
READ_AND_SPLITDEP(info->conflicts);
|
||||
} else if(strcmp(line, "%PROVIDES%") == 0) {
|
||||
|
||||
@@ -700,17 +700,9 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
|
||||
} else if(strcmp(line, "%OPTDEPENDS%") == 0) {
|
||||
READ_AND_SPLITDEP(pkg->optdepends);
|
||||
} else if(strcmp(line, "%MAKEDEPENDS%") == 0) {
|
||||
/* currently unused */
|
||||
while(1) {
|
||||
READ_NEXT();
|
||||
if(strlen(line) == 0) break;
|
||||
}
|
||||
READ_AND_SPLITDEP(pkg->makedepends);
|
||||
} else if(strcmp(line, "%CHECKDEPENDS%") == 0) {
|
||||
/* currently unused */
|
||||
while(1) {
|
||||
READ_NEXT();
|
||||
if(strlen(line) == 0) break;
|
||||
}
|
||||
READ_AND_SPLITDEP(pkg->checkdepends);
|
||||
} else if(strcmp(line, "%CONFLICTS%") == 0) {
|
||||
READ_AND_SPLITDEP(pkg->conflicts);
|
||||
} else if(strcmp(line, "%PROVIDES%") == 0) {
|
||||
@@ -787,8 +779,8 @@ alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
|
||||
_alpm_log(handle, ALPM_LOG_DEBUG, "registering sync database '%s'\n", treename);
|
||||
|
||||
#ifndef HAVE_LIBGPGME
|
||||
if(level != ALPM_SIG_USE_DEFAULT) {
|
||||
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, NULL);
|
||||
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
||||
RET_ERR(handle, ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -399,10 +399,10 @@ static alpm_pkg_t *_alpm_find_file_owner(alpm_handle_t *handle, const char *path
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int _alpm_can_overwrite_file(alpm_handle_t *handle, const char *path)
|
||||
static int _alpm_can_overwrite_file(alpm_handle_t *handle, const char *path, const char *rootedpath)
|
||||
{
|
||||
return handle->trans->flags & ALPM_TRANS_FLAG_FORCE
|
||||
|| _alpm_fnmatch_patterns(handle->overwrite_files, path) == 0;
|
||||
return _alpm_fnmatch_patterns(handle->overwrite_files, path) == 0
|
||||
|| _alpm_fnmatch_patterns(handle->overwrite_files, rootedpath) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -468,7 +468,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
|
||||
/* can skip file-file conflicts when forced *
|
||||
* checking presence in p2_files detects dir-file or file-dir
|
||||
* conflicts as the path from p1 is returned */
|
||||
if(_alpm_can_overwrite_file(handle, filename)
|
||||
if(_alpm_can_overwrite_file(handle, filename, path)
|
||||
&& alpm_filelist_contains(p2_files, filename)) {
|
||||
_alpm_log(handle, ALPM_LOG_DEBUG,
|
||||
"%s exists in both '%s' and '%s'\n", filename,
|
||||
@@ -675,7 +675,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
|
||||
|
||||
/* skip file-file conflicts when being forced */
|
||||
if(!S_ISDIR(lsbuf.st_mode)
|
||||
&& _alpm_can_overwrite_file(handle, filestr)) {
|
||||
&& _alpm_can_overwrite_file(handle, filestr, path)) {
|
||||
_alpm_log(handle, ALPM_LOG_DEBUG,
|
||||
"conflict with file on filesystem being forced\n");
|
||||
resolved_conflict = 1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* download.c
|
||||
* dload.c
|
||||
*
|
||||
* Copyright (c) 2006-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
@@ -259,6 +259,7 @@ static void curl_set_handle_opts(struct dload_payload *payload,
|
||||
curl_easy_setopt(curl, CURLOPT_URL, payload->fileurl);
|
||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error_buffer);
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10L);
|
||||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 10L);
|
||||
curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
@@ -431,6 +432,7 @@ static int curl_download_internal(struct dload_payload *payload,
|
||||
/* Ignore any SIGPIPE signals. With libcurl, these shouldn't be happening,
|
||||
* but better safe than sorry. Store the old signal handler first. */
|
||||
mask_signal(SIGPIPE, SIG_IGN, &orig_sig_pipe);
|
||||
dload_interrupted = 0;
|
||||
mask_signal(SIGINT, &inthandler, &orig_sig_int);
|
||||
|
||||
/* perform transfer */
|
||||
@@ -473,6 +475,13 @@ static int curl_download_internal(struct dload_payload *payload,
|
||||
payload->remote_name, hostname);
|
||||
}
|
||||
goto cleanup;
|
||||
case CURLE_COULDNT_RESOLVE_HOST:
|
||||
payload->unlink_on_fail = 1;
|
||||
handle->pm_errno = ALPM_ERR_SERVER_BAD_URL;
|
||||
_alpm_log(handle, ALPM_LOG_ERROR,
|
||||
_("failed retrieving file '%s' from %s : %s\n"),
|
||||
payload->remote_name, hostname, error_buffer);
|
||||
goto cleanup;
|
||||
default:
|
||||
/* delete zero length downloads */
|
||||
if(fstat(fileno(localf), &st) == 0 && st.st_size == 0) {
|
||||
@@ -526,7 +535,8 @@ static int curl_download_internal(struct dload_payload *payload,
|
||||
if(payload->content_disp_name) {
|
||||
/* content-disposition header has a better name for our file */
|
||||
free(payload->destfile_name);
|
||||
payload->destfile_name = get_fullpath(localpath, payload->content_disp_name, "");
|
||||
payload->destfile_name = get_fullpath(localpath,
|
||||
get_filename(payload->content_disp_name), "");
|
||||
} else {
|
||||
const char *effective_filename = strrchr(effective_url, '/');
|
||||
if(effective_filename && strlen(effective_filename) > 2) {
|
||||
@@ -578,7 +588,7 @@ cleanup:
|
||||
unmask_signal(SIGINT, &orig_sig_int);
|
||||
unmask_signal(SIGPIPE, &orig_sig_pipe);
|
||||
/* if we were interrupted, trip the old handler */
|
||||
if(dload_interrupted) {
|
||||
if(dload_interrupted == ABORT_SIGINT) {
|
||||
raise(SIGINT);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,6 +159,9 @@ const char SYMEXPORT *alpm_strerror(alpm_errno_t err)
|
||||
return _("gpgme error");
|
||||
case ALPM_ERR_EXTERNAL_DOWNLOAD:
|
||||
return _("error invoking external downloader");
|
||||
/* Missing compile-time features */
|
||||
case ALPM_ERR_MISSING_CAPABILITY_SIGNATURES:
|
||||
return _("compiled without signature support");
|
||||
/* Unknown error! */
|
||||
default:
|
||||
return _("unexpected error");
|
||||
|
||||
@@ -803,11 +803,14 @@ int SYMEXPORT alpm_option_set_default_siglevel(alpm_handle_t *handle,
|
||||
int level)
|
||||
{
|
||||
CHECK_HANDLE(handle, return -1);
|
||||
if(level == ALPM_SIG_USE_DEFAULT) {
|
||||
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
|
||||
}
|
||||
#ifdef HAVE_LIBGPGME
|
||||
handle->siglevel = level;
|
||||
#else
|
||||
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
||||
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
|
||||
if(level != 0) {
|
||||
RET_ERR(handle, ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, -1);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
@@ -827,7 +830,7 @@ int SYMEXPORT alpm_option_set_local_file_siglevel(alpm_handle_t *handle,
|
||||
handle->localfilesiglevel = level;
|
||||
#else
|
||||
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
||||
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
|
||||
RET_ERR(handle, ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, -1);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
@@ -851,7 +854,7 @@ int SYMEXPORT alpm_option_set_remote_file_siglevel(alpm_handle_t *handle,
|
||||
handle->remotefilesiglevel = level;
|
||||
#else
|
||||
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
||||
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
|
||||
RET_ERR(handle, ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, -1);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
@@ -873,6 +876,8 @@ int SYMEXPORT alpm_option_set_disable_dl_timeout(alpm_handle_t *handle,
|
||||
CHECK_HANDLE(handle, return -1);
|
||||
#ifdef HAVE_LIBCURL
|
||||
handle->disable_dl_timeout = disable_dl_timeout;
|
||||
#else
|
||||
(void)disable_dl_timeout; /* silence unused variable warnings */
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -551,7 +551,16 @@ static int _alpm_hook_triggered(alpm_handle_t *handle, struct _alpm_hook_t *hook
|
||||
|
||||
static int _alpm_hook_cmp(struct _alpm_hook_t *h1, struct _alpm_hook_t *h2)
|
||||
{
|
||||
return strcmp(h1->name, h2->name);
|
||||
size_t suflen = strlen(ALPM_HOOK_SUFFIX), l1, l2;
|
||||
int ret;
|
||||
l1 = strlen(h1->name) - suflen;
|
||||
l2 = strlen(h2->name) - suflen;
|
||||
/* exclude the suffixes from comparison */
|
||||
ret = strncmp(h1->name, h2->name, l1 <= l2 ? l1 : l2);
|
||||
if(ret == 0 && l1 != l2) {
|
||||
return l1 < l2 ? -1 : 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static alpm_list_t *find_hook(alpm_list_t *haystack, const void *needle)
|
||||
@@ -634,8 +643,7 @@ int _alpm_hook_run(alpm_handle_t *handle, alpm_hook_when_t when)
|
||||
alpm_event_hook_t event = { .when = when };
|
||||
alpm_event_hook_run_t hook_event;
|
||||
alpm_list_t *i, *hooks = NULL, *hooks_triggered = NULL;
|
||||
const char *suffix = ".hook";
|
||||
size_t suflen = strlen(suffix), triggered = 0;
|
||||
size_t suflen = strlen(ALPM_HOOK_SUFFIX), triggered = 0;
|
||||
int ret = 0;
|
||||
|
||||
for(i = alpm_list_last(handle->hookdirs); i; i = alpm_list_previous(i)) {
|
||||
@@ -681,7 +689,7 @@ int _alpm_hook_run(alpm_handle_t *handle, alpm_hook_when_t when)
|
||||
memcpy(path + dirlen, entry->d_name, name_len + 1);
|
||||
|
||||
if(name_len < suflen
|
||||
|| strcmp(entry->d_name + name_len - suflen, suffix) != 0) {
|
||||
|| strcmp(entry->d_name + name_len - suflen, ALPM_HOOK_SUFFIX) != 0) {
|
||||
_alpm_log(handle, ALPM_LOG_DEBUG, "skipping non-hook file %s\n", path);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include "alpm.h"
|
||||
|
||||
#define ALPM_HOOK_SUFFIX ".hook"
|
||||
|
||||
int _alpm_hook_run(alpm_handle_t *handle, alpm_hook_when_t when);
|
||||
|
||||
#endif /* ALPM_HOOK_H */
|
||||
|
||||
33
lib/libalpm/meson.build
Normal file
33
lib/libalpm/meson.build
Normal file
@@ -0,0 +1,33 @@
|
||||
libalpm_sources = files('''
|
||||
add.h add.c
|
||||
alpm.h alpm.c
|
||||
alpm_list.h alpm_list.c
|
||||
backup.h backup.c
|
||||
base64.h base64.c
|
||||
be_local.c
|
||||
be_package.c
|
||||
be_sync.c
|
||||
conflict.h conflict.c
|
||||
db.h db.c
|
||||
delta.h delta.c
|
||||
deps.h deps.c
|
||||
diskspace.h diskspace.c
|
||||
dload.h dload.c
|
||||
error.c
|
||||
filelist.h filelist.c
|
||||
graph.h graph.c
|
||||
group.h group.c
|
||||
handle.h handle.c
|
||||
hook.h hook.c
|
||||
libarchive-compat.h
|
||||
log.h log.c
|
||||
package.h package.c
|
||||
pkghash.h pkghash.c
|
||||
rawstr.c
|
||||
remove.h remove.c
|
||||
signing.c signing.h
|
||||
sync.h sync.c
|
||||
trans.h trans.c
|
||||
util.h util.c
|
||||
version.c
|
||||
'''.split())
|
||||
@@ -38,7 +38,7 @@
|
||||
/** Package operations struct. This struct contains function pointers to
|
||||
* all methods used to access data in a package to allow for things such
|
||||
* as lazy package initialization (such as used by the file backend). Each
|
||||
* backend is free to define a stuct containing pointers to a specific
|
||||
* backend is free to define a struct containing pointers to a specific
|
||||
* implementation of these methods. Some backends may find using the
|
||||
* defined default_pkg_ops struct to work just fine for their needs.
|
||||
*/
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
# jakobw <jakob.wadsager@gmail.com>, 2012
|
||||
# Joe Hansen <joedalton2@yahoo.dk>, 2011,2013
|
||||
# scootergrisen, 2017
|
||||
# scootergrisen, 2017
|
||||
# scootergrisen, 2017-2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Arch Linux Pacman package manager\n"
|
||||
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
|
||||
"POT-Creation-Date: 2018-05-15 10:34+1000\n"
|
||||
"PO-Revision-Date: 2018-05-15 01:05+0000\n"
|
||||
"Last-Translator: Allan McRae <allan@archlinux.org>\n"
|
||||
"PO-Revision-Date: 2018-06-07 09:48+0000\n"
|
||||
"Last-Translator: scootergrisen\n"
|
||||
"Language-Team: Danish (http://www.transifex.com/toofishes/archlinux-pacman/"
|
||||
"language/da/)\n"
|
||||
"Language: da\n"
|
||||
@@ -247,7 +247,7 @@ msgstr "kunne ikke fortolke pakkebeskrivelsesfil '%s' fra db '%s'\n"
|
||||
#: lib/libalpm/be_sync.c:524
|
||||
#, c-format
|
||||
msgid "could not read db '%s' (%s)\n"
|
||||
msgstr ""
|
||||
msgstr "kunne ikke læse db '%s' (%s)\n"
|
||||
|
||||
#: lib/libalpm/be_sync.c:558 lib/libalpm/be_sync.c:563
|
||||
#, c-format
|
||||
@@ -669,69 +669,69 @@ msgstr "kunne ikke fjerne låsningsfil %s\n"
|
||||
#: lib/libalpm/hook.c:107
|
||||
#, c-format
|
||||
msgid "Missing trigger targets in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Manglende udløsermål i krog: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:113
|
||||
#, c-format
|
||||
msgid "Missing trigger type in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Manglende udløsertype i krog: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:119
|
||||
#, c-format
|
||||
msgid "Missing trigger operation in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Manglende udløserhanlding i krog: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:146
|
||||
#, c-format
|
||||
msgid "Missing Exec option in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Manglende Exec-tilvalg i krog: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:152
|
||||
#, c-format
|
||||
msgid "Missing When option in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Manglende When-tilvalg i krog: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:155
|
||||
#, c-format
|
||||
msgid "AbortOnFail set for PostTransaction hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "AbortOnFail sat for PostTransaction-hook: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:273
|
||||
#, c-format
|
||||
msgid "error while reading hook %s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "fejl ved læsning af hook %s: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:275 lib/libalpm/hook.c:315 lib/libalpm/hook.c:357
|
||||
#, c-format
|
||||
msgid "hook %s line %d: invalid option %s\n"
|
||||
msgstr ""
|
||||
msgstr "hook %s linje %d: ugyldigt tilvalg %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:285
|
||||
#, c-format
|
||||
msgid "hook %s line %d: invalid section %s\n"
|
||||
msgstr ""
|
||||
msgstr "hook %s linje %d: ugyldigt afsnit %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:297 lib/libalpm/hook.c:308 lib/libalpm/hook.c:327
|
||||
#: lib/libalpm/hook.c:350
|
||||
#, c-format
|
||||
msgid "hook %s line %d: invalid value %s\n"
|
||||
msgstr ""
|
||||
msgstr "hook %s linje %d: ugyldig værdi %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:301 lib/libalpm/hook.c:320 lib/libalpm/hook.c:331
|
||||
#: lib/libalpm/hook.c:345
|
||||
#, c-format
|
||||
msgid "hook %s line %d: overwriting previous definition of %s\n"
|
||||
msgstr ""
|
||||
msgstr "hook %s linje %d: overskriver forrige definition af %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:352
|
||||
#, c-format
|
||||
msgid "hook %s line %d: unable to set option (%s)\n"
|
||||
msgstr ""
|
||||
msgstr "hook %s linje %d: kan ikke sætte tilvalg (%s)\n"
|
||||
|
||||
#: lib/libalpm/hook.c:613
|
||||
#, c-format
|
||||
msgid "unable to run hook %s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "kan ikke køre hook %s: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:648 lib/libalpm/hook.c:660 lib/libalpm/remove.c:385
|
||||
#, c-format
|
||||
@@ -741,7 +741,7 @@ msgstr "kunne ikke åbne mappe: %s: %s\n"
|
||||
#: lib/libalpm/hook.c:676
|
||||
#, c-format
|
||||
msgid "could not open file: %s%s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "kunne ikke åbne fil: %s%s: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:696 lib/libalpm/util.c:259
|
||||
#, c-format
|
||||
@@ -751,7 +751,7 @@ msgstr "kunne ikke køre (stat) fil %s: %s\n"
|
||||
#: lib/libalpm/hook.c:722
|
||||
#, c-format
|
||||
msgid "could not read directory: %s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "kunne ikke læse mappe: %s: %s\n"
|
||||
|
||||
#: lib/libalpm/package.c:586
|
||||
#, c-format
|
||||
@@ -776,7 +776,7 @@ msgstr "kan ikke fjerne fil »%s«:%s\n"
|
||||
#: lib/libalpm/remove.c:410 lib/libalpm/remove.c:419
|
||||
#, c-format
|
||||
msgid "could not backup %s due to PATH_MAX overflow\n"
|
||||
msgstr ""
|
||||
msgstr "kunne ikke sikkerhedskopiere %s på grund af PATH_MAX-overløb\n"
|
||||
|
||||
#: lib/libalpm/remove.c:561
|
||||
#, c-format
|
||||
@@ -796,32 +796,33 @@ msgstr "kunne ikke fjerne punkt '%s' fra cache\n"
|
||||
#: lib/libalpm/signing.c:171
|
||||
#, c-format
|
||||
msgid "Public keyring not found; have you run '%s'?\n"
|
||||
msgstr ""
|
||||
msgstr "Offentlig nøglering ikke fundet. Har du kørt '%s'?\n"
|
||||
|
||||
#: lib/libalpm/signing.c:207 lib/libalpm/signing.c:705
|
||||
#, c-format
|
||||
msgid "GPGME error: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Fejl ved GPGME: %s\n"
|
||||
|
||||
#: lib/libalpm/signing.c:402
|
||||
#, c-format
|
||||
msgid "keyring is not writable\n"
|
||||
msgstr ""
|
||||
msgstr "der kan ikke skrives til nøglering\n"
|
||||
|
||||
#: lib/libalpm/signing.c:460
|
||||
#, c-format
|
||||
msgid "key \"%s\" could not be imported\n"
|
||||
msgstr ""
|
||||
msgstr "nøglen \"%s\" kunne ikke importeres\n"
|
||||
|
||||
#: lib/libalpm/signing.c:466
|
||||
#, c-format
|
||||
msgid "key %s, \"%s\" found on keyserver, keyring is not writable\n"
|
||||
msgstr ""
|
||||
"nøglen %s, \"%s\" fundet på nøgleserver, der kan ikke skrives til nøglering\n"
|
||||
|
||||
#: lib/libalpm/signing.c:471
|
||||
#, c-format
|
||||
msgid "key \"%s\" could not be looked up remotely\n"
|
||||
msgstr ""
|
||||
msgstr "nøglen \"%s\" kunne ikke fjernopslås\n"
|
||||
|
||||
#: lib/libalpm/signing.c:859 lib/libalpm/sync.c:1181
|
||||
#, c-format
|
||||
@@ -831,49 +832,49 @@ msgstr "%s: mangler krævet signatur\n"
|
||||
#: lib/libalpm/signing.c:874
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is marginal trust\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signatur fra \"%s\" er marginelt betroet\n"
|
||||
|
||||
#: lib/libalpm/signing.c:882
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is unknown trust\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signatur fra \"%s\" er ukendt betroet\n"
|
||||
|
||||
#: lib/libalpm/signing.c:889
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" should never be trusted\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signatur fra \"%s\" skal aldrig betroes\n"
|
||||
|
||||
#: lib/libalpm/signing.c:901
|
||||
#, c-format
|
||||
msgid "%s: key \"%s\" is unknown\n"
|
||||
msgstr ""
|
||||
msgstr "%s: nøgelen \"%s\" er ukendt\n"
|
||||
|
||||
#: lib/libalpm/signing.c:910
|
||||
#, c-format
|
||||
msgid "%s: key \"%s\" is disabled\n"
|
||||
msgstr ""
|
||||
msgstr "%s: nøglen \"%s\" er deaktiveret\n"
|
||||
|
||||
#: lib/libalpm/signing.c:914
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is expired\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signatur fra \"%s\" er udløbet\n"
|
||||
|
||||
#: lib/libalpm/signing.c:918
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is invalid\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signatur fra \"%s\" er ugyldig\n"
|
||||
|
||||
#: lib/libalpm/signing.c:995 lib/libalpm/signing.c:1063
|
||||
#: lib/libalpm/signing.c:1142
|
||||
#, c-format
|
||||
msgid "%s: signature format error\n"
|
||||
msgstr ""
|
||||
msgstr "%s: fejl i signaturformat\n"
|
||||
|
||||
#: lib/libalpm/signing.c:1095 lib/libalpm/signing.c:1128
|
||||
#: lib/libalpm/signing.c:1136
|
||||
#, c-format
|
||||
msgid "%s: unsupported signature format\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signaturformat understøttes ikke\n"
|
||||
|
||||
#: lib/libalpm/sync.c:98
|
||||
#, c-format
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# Translators:
|
||||
# Dan McGee <dpmcgee@gmail.com>, 2011
|
||||
# Frank Theile, 2018
|
||||
# Frank Theile, 2018
|
||||
# Jakob Gahde <j5lx@fmail.co.uk>, 2014-2015
|
||||
# mar77i <inactive+mar77i@transifex.com>, 2013
|
||||
# mar77i <inactive+mar77i@transifex.com>, 2013
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
# Pablo Lezaeta Reyes [pˈaβ̞lo lˌe̞θaˈeta rˈejɛ] <prflr88@gmail.com>, 2017
|
||||
# Pablo Lezaeta Reyes [pˈaβ̞lo lˌe̞θaˈeta rˈejɛ] <prflr88@gmail.com>, 2013-2016
|
||||
# Pablo Lezaeta Reyes [pˈaβ̞lo lˌe̞θaˈeta rˈejɛ] <prflr88@gmail.com>, 2017
|
||||
# Pedro Román <roizheim@gmail.com>, 2013-2014,2016-2017
|
||||
# Pedro Román <roizheim@gmail.com>, 2013-2014,2016-2018
|
||||
# picodotdev <pico.dev@gmail.com>, 2016
|
||||
# Swyter <Swyterzone@gmail.com>, 2015,2017-2018
|
||||
msgid ""
|
||||
@@ -22,8 +22,8 @@ msgstr ""
|
||||
"Project-Id-Version: Arch Linux Pacman package manager\n"
|
||||
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
|
||||
"POT-Creation-Date: 2018-05-15 10:34+1000\n"
|
||||
"PO-Revision-Date: 2018-05-15 01:34+0000\n"
|
||||
"Last-Translator: Swyter <Swyterzone@gmail.com>\n"
|
||||
"PO-Revision-Date: 2018-06-22 07:25+0000\n"
|
||||
"Last-Translator: Pedro Román <roizheim@gmail.com>\n"
|
||||
"Language-Team: Spanish (http://www.transifex.com/toofishes/archlinux-pacman/"
|
||||
"language/es/)\n"
|
||||
"Language: es\n"
|
||||
@@ -45,7 +45,7 @@ msgstr "%s-%s está actualizado -- reinstalándolo\n"
|
||||
#: lib/libalpm/add.c:95
|
||||
#, c-format
|
||||
msgid "downgrading package %s (%s => %s)\n"
|
||||
msgstr "revertiendo a una versión anterior del paquete %s (%s => %s)\n"
|
||||
msgstr "revertiendo el paquete %s a una versión anterior (%s => %s)\n"
|
||||
|
||||
#: lib/libalpm/add.c:124
|
||||
#, c-format
|
||||
@@ -101,7 +101,9 @@ msgstr ""
|
||||
#: lib/libalpm/add.c:287
|
||||
#, c-format
|
||||
msgid "extract: not overwriting dir with file %s\n"
|
||||
msgstr "extracto: no se puede sobrescribir el directorio con el archivo %s\n"
|
||||
msgstr ""
|
||||
"sobre la extracción: no se puede sobrescribir el directorio con el archivo "
|
||||
"%s\n"
|
||||
|
||||
#: lib/libalpm/add.c:315
|
||||
#, c-format
|
||||
@@ -210,7 +212,7 @@ msgstr "error al leer el paquete %s: %s\n"
|
||||
#: lib/libalpm/be_package.c:493 lib/libalpm/be_package.c:517
|
||||
#, c-format
|
||||
msgid "error while reading mtree of package %s: %s\n"
|
||||
msgstr "error al leer mtree del paquete %s: %s\n"
|
||||
msgstr "error al leer «mtree» del paquete %s: %s\n"
|
||||
|
||||
#: lib/libalpm/be_package.c:603
|
||||
#, c-format
|
||||
@@ -240,7 +242,7 @@ msgstr "faltan los metadatos del paquete en %s\n"
|
||||
#: lib/libalpm/be_package.c:748
|
||||
#, c-format
|
||||
msgid "failed to read signature file: %s\n"
|
||||
msgstr "no se pudo leer correctamente el archivo de firma: %s\n"
|
||||
msgstr "no se pudo leer correctamente el archivo de firmas: %s\n"
|
||||
|
||||
#: lib/libalpm/be_package.c:769 lib/libalpm/sync.c:1113
|
||||
#, c-format
|
||||
@@ -250,7 +252,7 @@ msgstr "la clave necesaria no está presente en el depósito\n"
|
||||
#: lib/libalpm/be_sync.c:62
|
||||
#, c-format
|
||||
msgid "removing invalid file: %s\n"
|
||||
msgstr "eliminando archivo no válido: %s\n"
|
||||
msgstr "quitando archivo no válido: %s\n"
|
||||
|
||||
#: lib/libalpm/be_sync.c:517
|
||||
#, c-format
|
||||
@@ -291,7 +293,7 @@ msgstr "la ruta de la base de datos no está definida\n"
|
||||
#: lib/libalpm/deps.c:184
|
||||
#, c-format
|
||||
msgid "dependency cycle detected:\n"
|
||||
msgstr "bucle de dependencias detectado:\n"
|
||||
msgstr "se ha detectado un bucle de dependencias:\n"
|
||||
|
||||
#: lib/libalpm/deps.c:187
|
||||
#, c-format
|
||||
@@ -342,8 +344,8 @@ msgstr "no se pudo determinar el punto de montaje para el archivo %s\n"
|
||||
#, c-format
|
||||
msgid "Partition %s too full: %jd blocks needed, %ju blocks free\n"
|
||||
msgstr ""
|
||||
"La partición %s está llena: se necesitan %jd bloques, hay %ju bloques "
|
||||
"libres\n"
|
||||
"La partición %s está demasiado llena: se necesitan %jd bloques, hay %ju "
|
||||
"bloques libres\n"
|
||||
|
||||
#: lib/libalpm/diskspace.c:379 lib/libalpm/diskspace.c:433
|
||||
#, c-format
|
||||
@@ -391,8 +393,8 @@ msgstr "no se pudo obtener el archivo «%s» desde %s: %s\n"
|
||||
#, c-format
|
||||
msgid "failed retrieving file '%s' from %s : expected download size exceeded\n"
|
||||
msgstr ""
|
||||
"no se pudo obtener el archivo «%s» desde %s : el tamaño de descarga supera "
|
||||
"lo esperado\n"
|
||||
"no se pudo obtener el archivo «%s» desde %s : el tamaño de la descarga "
|
||||
"supera lo esperado\n"
|
||||
|
||||
#: lib/libalpm/dload.c:520
|
||||
#, c-format
|
||||
@@ -427,7 +429,7 @@ msgstr "no se pudo encontrar o leer el archivo"
|
||||
#: lib/libalpm/error.c:48
|
||||
#, c-format
|
||||
msgid "could not find or read directory"
|
||||
msgstr "no se pudo encontrar (o leer) el directorio"
|
||||
msgstr "no se pudo encontrar o leer el directorio"
|
||||
|
||||
#: lib/libalpm/error.c:50
|
||||
#, c-format
|
||||
@@ -492,7 +494,7 @@ msgstr "base de datos no válida o dañada (firma PGP)"
|
||||
#: lib/libalpm/error.c:76
|
||||
#, c-format
|
||||
msgid "database is incorrect version"
|
||||
msgstr "la base de datos es de una versión incorrecta"
|
||||
msgstr "la versión de la base de datos es incorrecta"
|
||||
|
||||
#: lib/libalpm/error.c:78
|
||||
#, c-format
|
||||
@@ -527,7 +529,7 @@ msgstr "la operación no está iniciada"
|
||||
#: lib/libalpm/error.c:92
|
||||
#, c-format
|
||||
msgid "duplicate target"
|
||||
msgstr "objetivo duplicado"
|
||||
msgstr "paquete duplicado"
|
||||
|
||||
#: lib/libalpm/error.c:96
|
||||
#, c-format
|
||||
@@ -693,17 +695,17 @@ msgstr "no se pudo quitar el archivo de bloqueo %s\n"
|
||||
#: lib/libalpm/hook.c:107
|
||||
#, c-format
|
||||
msgid "Missing trigger targets in hook: %s\n"
|
||||
msgstr "Faltan objetivos del «trigger» en el «hook»: %s\n"
|
||||
msgstr "Paquetes de ejecución que faltan en el «hook»: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:113
|
||||
#, c-format
|
||||
msgid "Missing trigger type in hook: %s\n"
|
||||
msgstr "Falta el tipo del «trigger» en el «hook»: %s\n"
|
||||
msgstr "Tipo de ejecución que falta en el «hook»: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:119
|
||||
#, c-format
|
||||
msgid "Missing trigger operation in hook: %s\n"
|
||||
msgstr "Falta la operación del «trigger» en el «hook»: %s\n"
|
||||
msgstr "Operación de ejecución que falta en el «hook»: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:146
|
||||
#, c-format
|
||||
@@ -718,7 +720,7 @@ msgstr "Falta la opción «When» en el «hook»: %s\n"
|
||||
#: lib/libalpm/hook.c:155
|
||||
#, c-format
|
||||
msgid "AbortOnFail set for PostTransaction hook: %s\n"
|
||||
msgstr "El «hook» PostTransaction se ha establecido como AbortOnFail: %s\n"
|
||||
msgstr "«AbortOnFail» establecido para el «hook» de posinstalación: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:273
|
||||
#, c-format
|
||||
@@ -786,12 +788,12 @@ msgstr ""
|
||||
#: lib/libalpm/remove.c:118
|
||||
#, c-format
|
||||
msgid "could not find %s in database -- skipping\n"
|
||||
msgstr "no se pudo encontrar %s en la base de datos -- ignorándolo\n"
|
||||
msgstr "no se pudo encontrar %s en la base de datos -- omitiéndolo\n"
|
||||
|
||||
#: lib/libalpm/remove.c:153
|
||||
#, c-format
|
||||
msgid "removing %s from target list\n"
|
||||
msgstr "quitando %s de la lista de objetivos\n"
|
||||
msgstr "quitando %s de la lista de paquetes\n"
|
||||
|
||||
#: lib/libalpm/remove.c:345
|
||||
#, c-format
|
||||
@@ -824,7 +826,8 @@ msgstr "no se pudo quitar la entrada «%s» de la caché\n"
|
||||
#, c-format
|
||||
msgid "Public keyring not found; have you run '%s'?\n"
|
||||
msgstr ""
|
||||
"No se ha encontrado el llavero de claves público; ¿ya se ha ejecutado «%s»?\n"
|
||||
"No se ha encontrado el depósito público de claves; ¿ya se ha ejecutado "
|
||||
"«%s»?\n"
|
||||
|
||||
#: lib/libalpm/signing.c:207 lib/libalpm/signing.c:705
|
||||
#, c-format
|
||||
@@ -834,7 +837,7 @@ msgstr "Error de GPGME: %s\n"
|
||||
#: lib/libalpm/signing.c:402
|
||||
#, c-format
|
||||
msgid "keyring is not writable\n"
|
||||
msgstr "no se puede escribir en el llavero de claves\n"
|
||||
msgstr "no se puede escribir en el depósito de claves\n"
|
||||
|
||||
#: lib/libalpm/signing.c:460
|
||||
#, c-format
|
||||
@@ -946,7 +949,7 @@ msgstr "se han detectado paquetes con conflictos sin resolver\n"
|
||||
#, c-format
|
||||
msgid "removing '%s' from target list because it conflicts with '%s'\n"
|
||||
msgstr ""
|
||||
"quitando «%s» de la lista de objetivos debido a que tiene conflictos con "
|
||||
"quitando «%s» de la lista de paquetes debido a que tiene conflictos con "
|
||||
"«%s»\n"
|
||||
|
||||
#: lib/libalpm/sync.c:1019
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
# Antoine Lubineau <antoine@lubignon.info>, 2012
|
||||
# Antoine Lubineau <antoine@lubignon.info>, 2012-2014,2018
|
||||
# Cedric Girard <girard.cedric@gmail.com>, 2014
|
||||
# Charles Monzat <superboa@hotmail.fr>, 2015-2018
|
||||
# Charles Monzat <superboa@hotmail.fr>, 2018
|
||||
# Charles Monzat <superboa@hotmail.fr>, 2018
|
||||
# Charles Monzat <c.monzat@laposte.net>, 2015-2018
|
||||
# Charles Monzat <c.monzat@laposte.net>, 2018
|
||||
# Charles Monzat <c.monzat@laposte.net>, 2018
|
||||
# Dan McGee <dpmcgee@gmail.com>, 2011
|
||||
# jiehong <ma.jiehong@gmail.com>, 2011-2012
|
||||
# shining <chantry.xavier@gmail.com>, 2011
|
||||
@@ -21,7 +21,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
|
||||
"POT-Creation-Date: 2018-05-15 10:34+1000\n"
|
||||
"PO-Revision-Date: 2018-05-20 14:11+0000\n"
|
||||
"Last-Translator: Charles Monzat <superboa@hotmail.fr>\n"
|
||||
"Last-Translator: Charles Monzat <c.monzat@laposte.net>\n"
|
||||
"Language-Team: French (http://www.transifex.com/toofishes/archlinux-pacman/"
|
||||
"language/fr/)\n"
|
||||
"Language: fr\n"
|
||||
|
||||
15
lib/libalpm/po/meson.build
Normal file
15
lib/libalpm/po/meson.build
Normal file
@@ -0,0 +1,15 @@
|
||||
i18n.gettext(
|
||||
'libalpm',
|
||||
args : [
|
||||
'--directory=@0@'.format(meson.current_source_dir()),
|
||||
'--msgid-bugs-address=http://bugs.archlinux.org/index.php?project=3',
|
||||
'--copyright-holder="Pacman Development Team <pacman-dev@archlinux.org>"',
|
||||
'--language', 'c',
|
||||
|
||||
'--keyword=_',
|
||||
'--flag=_:1:c-format',
|
||||
|
||||
'--keyword=_n:1,2',
|
||||
'--flag=_n:1:c-format',
|
||||
'--flag=_n:2:c-format',
|
||||
])
|
||||
@@ -12,8 +12,8 @@ msgstr ""
|
||||
"Project-Id-Version: Arch Linux Pacman package manager\n"
|
||||
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
|
||||
"POT-Creation-Date: 2018-05-15 10:34+1000\n"
|
||||
"PO-Revision-Date: 2018-05-15 01:05+0000\n"
|
||||
"Last-Translator: Allan McRae <allan@archlinux.org>\n"
|
||||
"PO-Revision-Date: 2018-06-04 12:26+0000\n"
|
||||
"Last-Translator: Alexander F Rødseth <rodseth@gmail.com>\n"
|
||||
"Language-Team: Norwegian Bokmål (http://www.transifex.com/toofishes/"
|
||||
"archlinux-pacman/language/nb/)\n"
|
||||
"Language: nb\n"
|
||||
@@ -243,7 +243,7 @@ msgstr "kunne ikke tolke filen med pakkebeskrivelse '%s' fra databasen '%s'\n"
|
||||
#: lib/libalpm/be_sync.c:524
|
||||
#, c-format
|
||||
msgid "could not read db '%s' (%s)\n"
|
||||
msgstr ""
|
||||
msgstr "kan ikke lese database '%s' (%s)\n"
|
||||
|
||||
#: lib/libalpm/be_sync.c:558 lib/libalpm/be_sync.c:563
|
||||
#, c-format
|
||||
@@ -523,7 +523,7 @@ msgstr "forsøkte å utføre transaksjon med ulåst database"
|
||||
#: lib/libalpm/error.c:104
|
||||
#, c-format
|
||||
msgid "failed to run transaction hooks"
|
||||
msgstr "feil under utførsel av overføringskommandoer"
|
||||
msgstr "feil under utførsel av transaksjonshekte"
|
||||
|
||||
#: lib/libalpm/error.c:107
|
||||
#, c-format
|
||||
@@ -663,69 +663,69 @@ msgstr "kunne ikke fjerne låsefil %s\n"
|
||||
#: lib/libalpm/hook.c:107
|
||||
#, c-format
|
||||
msgid "Missing trigger targets in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Mangler utløsermål i hekte: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:113
|
||||
#, c-format
|
||||
msgid "Missing trigger type in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Mangler utløsertype i hekte: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:119
|
||||
#, c-format
|
||||
msgid "Missing trigger operation in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Mangler utløseroperasjon i hekte: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:146
|
||||
#, c-format
|
||||
msgid "Missing Exec option in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Mangler tilvalget \"Exec\" i hekte: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:152
|
||||
#, c-format
|
||||
msgid "Missing When option in hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "Mangler tilvalget \"When\" i hekte: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:155
|
||||
#, c-format
|
||||
msgid "AbortOnFail set for PostTransaction hook: %s\n"
|
||||
msgstr ""
|
||||
msgstr "\"AbortOnFail\" er satt for kommandoene som kjører etter hekten: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:273
|
||||
#, c-format
|
||||
msgid "error while reading hook %s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "feil ved lesing av hekte %s: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:275 lib/libalpm/hook.c:315 lib/libalpm/hook.c:357
|
||||
#, c-format
|
||||
msgid "hook %s line %d: invalid option %s\n"
|
||||
msgstr ""
|
||||
msgstr "hekte %s linje %d: ugyldig valg %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:285
|
||||
#, c-format
|
||||
msgid "hook %s line %d: invalid section %s\n"
|
||||
msgstr ""
|
||||
msgstr "hekte %s linje %d: ugyldig seksjon %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:297 lib/libalpm/hook.c:308 lib/libalpm/hook.c:327
|
||||
#: lib/libalpm/hook.c:350
|
||||
#, c-format
|
||||
msgid "hook %s line %d: invalid value %s\n"
|
||||
msgstr ""
|
||||
msgstr "hekte %s linje %d: ugyldig verdi %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:301 lib/libalpm/hook.c:320 lib/libalpm/hook.c:331
|
||||
#: lib/libalpm/hook.c:345
|
||||
#, c-format
|
||||
msgid "hook %s line %d: overwriting previous definition of %s\n"
|
||||
msgstr ""
|
||||
msgstr "hekte %s linje %d: overskriver tidligere definisjoner av %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:352
|
||||
#, c-format
|
||||
msgid "hook %s line %d: unable to set option (%s)\n"
|
||||
msgstr ""
|
||||
msgstr "hekte %s linje %d: kan ikke bruke tilvalget (%s)\n"
|
||||
|
||||
#: lib/libalpm/hook.c:613
|
||||
#, c-format
|
||||
msgid "unable to run hook %s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "kan ikke kjøre hekte %s: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:648 lib/libalpm/hook.c:660 lib/libalpm/remove.c:385
|
||||
#, c-format
|
||||
@@ -735,7 +735,7 @@ msgstr "kunne ikke åpne mappen: %s: %s\n"
|
||||
#: lib/libalpm/hook.c:676
|
||||
#, c-format
|
||||
msgid "could not open file: %s%s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "kan ikke åpne fil: %s%s: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:696 lib/libalpm/util.c:259
|
||||
#, c-format
|
||||
@@ -745,7 +745,7 @@ msgstr "kunne ikke inspisere fil: %s: %s\n"
|
||||
#: lib/libalpm/hook.c:722
|
||||
#, c-format
|
||||
msgid "could not read directory: %s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "kan ikke åpne mappe: %s: %s\n"
|
||||
|
||||
#: lib/libalpm/package.c:586
|
||||
#, c-format
|
||||
@@ -770,7 +770,7 @@ msgstr "kunne ikke fjerne fil '%s': %s\n"
|
||||
#: lib/libalpm/remove.c:410 lib/libalpm/remove.c:419
|
||||
#, c-format
|
||||
msgid "could not backup %s due to PATH_MAX overflow\n"
|
||||
msgstr ""
|
||||
msgstr "kan ikke ta sikkerhetskopi av %sfordi PATH_MAX rant over\n"
|
||||
|
||||
#: lib/libalpm/remove.c:561
|
||||
#, c-format
|
||||
@@ -790,32 +790,33 @@ msgstr "kunne ikke fjerne oppføring '%s' fra mellomlageret\n"
|
||||
#: lib/libalpm/signing.c:171
|
||||
#, c-format
|
||||
msgid "Public keyring not found; have you run '%s'?\n"
|
||||
msgstr ""
|
||||
msgstr "Fant ikke offentlig nøkkelring. Har du kjørt '%s'?\n"
|
||||
|
||||
#: lib/libalpm/signing.c:207 lib/libalpm/signing.c:705
|
||||
#, c-format
|
||||
msgid "GPGME error: %s\n"
|
||||
msgstr ""
|
||||
msgstr "GPGME feil: %s\n"
|
||||
|
||||
#: lib/libalpm/signing.c:402
|
||||
#, c-format
|
||||
msgid "keyring is not writable\n"
|
||||
msgstr ""
|
||||
msgstr "nøkkelringen er ikke skrivbar\n"
|
||||
|
||||
#: lib/libalpm/signing.c:460
|
||||
#, c-format
|
||||
msgid "key \"%s\" could not be imported\n"
|
||||
msgstr ""
|
||||
msgstr "nøkkelen \"%s\" kunne ikke importeres\n"
|
||||
|
||||
#: lib/libalpm/signing.c:466
|
||||
#, c-format
|
||||
msgid "key %s, \"%s\" found on keyserver, keyring is not writable\n"
|
||||
msgstr ""
|
||||
"nøkkel %s, fant \"%s\" på nøkkeltjeneren, men nøkkelringen er ikke skrivbar\n"
|
||||
|
||||
#: lib/libalpm/signing.c:471
|
||||
#, c-format
|
||||
msgid "key \"%s\" could not be looked up remotely\n"
|
||||
msgstr ""
|
||||
msgstr "kunne ikke finne nøkkel \"%s\" på avstand\n"
|
||||
|
||||
#: lib/libalpm/signing.c:859 lib/libalpm/sync.c:1181
|
||||
#, c-format
|
||||
@@ -825,49 +826,49 @@ msgstr "%s: mangler påkrevd signatur\n"
|
||||
#: lib/libalpm/signing.c:874
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is marginal trust\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signaturen fra \"%s\" har veldig liten tillit\n"
|
||||
|
||||
#: lib/libalpm/signing.c:882
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is unknown trust\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signaturen fra \"%s\" har ukjent tillit\n"
|
||||
|
||||
#: lib/libalpm/signing.c:889
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" should never be trusted\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signaturen fra \"%s\" er ikke til å stole på\n"
|
||||
|
||||
#: lib/libalpm/signing.c:901
|
||||
#, c-format
|
||||
msgid "%s: key \"%s\" is unknown\n"
|
||||
msgstr ""
|
||||
msgstr "%s: nøkkel \"%s\" er ukjent\n"
|
||||
|
||||
#: lib/libalpm/signing.c:910
|
||||
#, c-format
|
||||
msgid "%s: key \"%s\" is disabled\n"
|
||||
msgstr ""
|
||||
msgstr "%s: nøkkrl \"%s\" er slått av\n"
|
||||
|
||||
#: lib/libalpm/signing.c:914
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is expired\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signaturen fra \"%s\" er utløpt\n"
|
||||
|
||||
#: lib/libalpm/signing.c:918
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is invalid\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signaturen fra \"%s\" er ugyldig\n"
|
||||
|
||||
#: lib/libalpm/signing.c:995 lib/libalpm/signing.c:1063
|
||||
#: lib/libalpm/signing.c:1142
|
||||
#, c-format
|
||||
msgid "%s: signature format error\n"
|
||||
msgstr ""
|
||||
msgstr "%s: feil ved signaturformatering\n"
|
||||
|
||||
#: lib/libalpm/signing.c:1095 lib/libalpm/signing.c:1128
|
||||
#: lib/libalpm/signing.c:1136
|
||||
#, c-format
|
||||
msgid "%s: unsupported signature format\n"
|
||||
msgstr ""
|
||||
msgstr "%s: signaturformatet er ikke støttet\n"
|
||||
|
||||
#: lib/libalpm/sync.c:98
|
||||
#, c-format
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#
|
||||
# Translators:
|
||||
# Dan McGee <dpmcgee@gmail.com>, 2011
|
||||
# Igor <f2404@yandex.ru>, 2018
|
||||
# Ilya Ostapenko (Jacobtey) <jacobtey@gmail.com>, 2017
|
||||
# Ivan Yurasov <vdk@gmx.us>, 2011
|
||||
# kyak <peselnik@gmail.com>, 2013
|
||||
@@ -18,8 +19,8 @@ msgstr ""
|
||||
"Project-Id-Version: Arch Linux Pacman package manager\n"
|
||||
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
|
||||
"POT-Creation-Date: 2018-05-15 10:34+1000\n"
|
||||
"PO-Revision-Date: 2018-05-15 01:05+0000\n"
|
||||
"Last-Translator: Allan McRae <allan@archlinux.org>\n"
|
||||
"PO-Revision-Date: 2018-05-29 16:20+0000\n"
|
||||
"Last-Translator: Igor <f2404@yandex.ru>\n"
|
||||
"Language-Team: Russian (http://www.transifex.com/toofishes/archlinux-pacman/"
|
||||
"language/ru/)\n"
|
||||
"Language: ru\n"
|
||||
@@ -253,7 +254,7 @@ msgstr "не удалось разобрать файл описания '%s' и
|
||||
#: lib/libalpm/be_sync.c:524
|
||||
#, c-format
|
||||
msgid "could not read db '%s' (%s)\n"
|
||||
msgstr ""
|
||||
msgstr "не удалось прочитать базу данных '%s' (%s)\n"
|
||||
|
||||
#: lib/libalpm/be_sync.c:558 lib/libalpm/be_sync.c:563
|
||||
#, c-format
|
||||
@@ -707,7 +708,7 @@ msgstr ""
|
||||
#: lib/libalpm/hook.c:273
|
||||
#, c-format
|
||||
msgid "error while reading hook %s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "ошибка чтения сценария %s: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:275 lib/libalpm/hook.c:315 lib/libalpm/hook.c:357
|
||||
#, c-format
|
||||
@@ -739,7 +740,7 @@ msgstr ""
|
||||
#: lib/libalpm/hook.c:613
|
||||
#, c-format
|
||||
msgid "unable to run hook %s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "не удалось выполнить сценарий %s: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:648 lib/libalpm/hook.c:660 lib/libalpm/remove.c:385
|
||||
#, c-format
|
||||
@@ -749,7 +750,7 @@ msgstr "не удалось открыть каталог %s: %s\n"
|
||||
#: lib/libalpm/hook.c:676
|
||||
#, c-format
|
||||
msgid "could not open file: %s%s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "не удалось открыть файл: %s %s: %s\n"
|
||||
|
||||
#: lib/libalpm/hook.c:696 lib/libalpm/util.c:259
|
||||
#, c-format
|
||||
@@ -759,7 +760,7 @@ msgstr "не удалось определить статус файла %s: %s\
|
||||
#: lib/libalpm/hook.c:722
|
||||
#, c-format
|
||||
msgid "could not read directory: %s: %s\n"
|
||||
msgstr ""
|
||||
msgstr "не удалось прочитать каталог %s: %s\n"
|
||||
|
||||
#: lib/libalpm/package.c:586
|
||||
#, c-format
|
||||
@@ -784,7 +785,7 @@ msgstr "не удалось удалить файл '%s': %s\n"
|
||||
#: lib/libalpm/remove.c:410 lib/libalpm/remove.c:419
|
||||
#, c-format
|
||||
msgid "could not backup %s due to PATH_MAX overflow\n"
|
||||
msgstr ""
|
||||
msgstr "не удалось создать резервную копию %s из-за превышения PATH_MAX\n"
|
||||
|
||||
#: lib/libalpm/remove.c:561
|
||||
#, c-format
|
||||
@@ -809,7 +810,7 @@ msgstr ""
|
||||
#: lib/libalpm/signing.c:207 lib/libalpm/signing.c:705
|
||||
#, c-format
|
||||
msgid "GPGME error: %s\n"
|
||||
msgstr ""
|
||||
msgstr "ошибка GPGME: %s\n"
|
||||
|
||||
#: lib/libalpm/signing.c:402
|
||||
#, c-format
|
||||
@@ -819,7 +820,7 @@ msgstr ""
|
||||
#: lib/libalpm/signing.c:460
|
||||
#, c-format
|
||||
msgid "key \"%s\" could not be imported\n"
|
||||
msgstr ""
|
||||
msgstr "не удалось импортировать ключ \"%s\"\n"
|
||||
|
||||
#: lib/libalpm/signing.c:466
|
||||
#, c-format
|
||||
@@ -854,7 +855,7 @@ msgstr ""
|
||||
#: lib/libalpm/signing.c:901
|
||||
#, c-format
|
||||
msgid "%s: key \"%s\" is unknown\n"
|
||||
msgstr ""
|
||||
msgstr "%s: неизвестный ключ \"%s\"\n"
|
||||
|
||||
#: lib/libalpm/signing.c:910
|
||||
#, c-format
|
||||
@@ -864,24 +865,24 @@ msgstr ""
|
||||
#: lib/libalpm/signing.c:914
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is expired\n"
|
||||
msgstr ""
|
||||
msgstr "%s: подпись от \"%s\" просрочена\n"
|
||||
|
||||
#: lib/libalpm/signing.c:918
|
||||
#, c-format
|
||||
msgid "%s: signature from \"%s\" is invalid\n"
|
||||
msgstr ""
|
||||
msgstr "%s: подпись от \"%s\" некорректна\n"
|
||||
|
||||
#: lib/libalpm/signing.c:995 lib/libalpm/signing.c:1063
|
||||
#: lib/libalpm/signing.c:1142
|
||||
#, c-format
|
||||
msgid "%s: signature format error\n"
|
||||
msgstr ""
|
||||
msgstr "%s: ошибка формата подписи\n"
|
||||
|
||||
#: lib/libalpm/signing.c:1095 lib/libalpm/signing.c:1128
|
||||
#: lib/libalpm/signing.c:1136
|
||||
#, c-format
|
||||
msgid "%s: unsupported signature format\n"
|
||||
msgstr ""
|
||||
msgstr "%s: неподдерживаемый формат подписи\n"
|
||||
|
||||
#: lib/libalpm/sync.c:98
|
||||
#, c-format
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
# mytbk <mytbk920423@gmail.com>, 2013,2015,2017
|
||||
# mytbk <mytbk920423@gmail.com>, 2013,2015,2017
|
||||
# ykelvis <ykelvis@users.noreply.github.com>, 2014
|
||||
# 张海, 2015
|
||||
# 张海, 2015,2018
|
||||
# 张海, 2015,2018
|
||||
# 甘 露 <rhythm.gan@gmail.com>, 2011
|
||||
msgid ""
|
||||
|
||||
@@ -74,7 +74,8 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
|
||||
pkgname = pkg->name;
|
||||
|
||||
if(alpm_pkg_find(trans->remove, pkgname)) {
|
||||
RET_ERR(handle, ALPM_ERR_TRANS_DUP_TARGET, -1);
|
||||
_alpm_log(handle, ALPM_LOG_DEBUG, "skipping duplicate target: %s\n", pkgname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
_alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s to the transaction remove list\n",
|
||||
|
||||
@@ -182,7 +182,7 @@ static int init_gpgme(alpm_handle_t *handle)
|
||||
#endif
|
||||
/* NOTE:
|
||||
* The GPGME library installs a SIGPIPE signal handler automatically if
|
||||
* the default signal hander is in use. The only time we set a handler
|
||||
* the default signal handler is in use. The only time we set a handler
|
||||
* for SIGPIPE is in dload.c, and we reset it when we are done. Given that
|
||||
* we do this, we can let GPGME do its automagic. However, if we install
|
||||
* a library-wide SIGPIPE handler, we will have to be careful.
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
/** Check for new version of pkg in sync repos
|
||||
* (only the first occurrence is considered in sync)
|
||||
*/
|
||||
alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync)
|
||||
alpm_pkg_t SYMEXPORT *alpm_sync_get_new_version(alpm_pkg_t *pkg, alpm_list_t *dbs_sync)
|
||||
{
|
||||
alpm_list_t *i;
|
||||
alpm_pkg_t *spkg = NULL;
|
||||
@@ -61,10 +61,6 @@ alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_syn
|
||||
|
||||
for(i = dbs_sync; !spkg && i; i = i->next) {
|
||||
alpm_db_t *db = i->data;
|
||||
if(!(db->usage & ALPM_DB_USAGE_SEARCH)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
spkg = _alpm_db_get_pkgfromcache(db, pkg->name);
|
||||
}
|
||||
|
||||
@@ -277,10 +273,21 @@ alpm_list_t SYMEXPORT *alpm_find_group_pkgs(alpm_list_t *dbs,
|
||||
|
||||
for(j = grp->packages; j; j = j->next) {
|
||||
alpm_pkg_t *pkg = j->data;
|
||||
alpm_trans_t *trans = db->handle->trans;
|
||||
|
||||
if(alpm_pkg_find(ignorelist, pkg->name)) {
|
||||
continue;
|
||||
}
|
||||
if(trans != NULL && trans->flags & ALPM_TRANS_FLAG_NEEDED) {
|
||||
alpm_pkg_t *local = _alpm_db_get_pkgfromcache(db->handle->db_local, pkg->name);
|
||||
if(local && _alpm_pkg_compare_versions(pkg, local) == 0) {
|
||||
/* with the NEEDED flag, packages up to date are not reinstalled */
|
||||
_alpm_log(db->handle, ALPM_LOG_WARNING, _("%s-%s is up to date -- skipping\n"),
|
||||
local->name, local->version);
|
||||
ignorelist = alpm_list_add(ignorelist, pkg);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(alpm_pkg_should_ignore(db->handle, pkg)) {
|
||||
alpm_question_install_ignorepkg_t question = {
|
||||
.type = ALPM_QUESTION_INSTALL_IGNOREPKG,
|
||||
@@ -1176,17 +1183,28 @@ static int check_validity(alpm_handle_t *handle,
|
||||
if(errors) {
|
||||
for(i = errors; i; i = i->next) {
|
||||
struct validity *v = i->data;
|
||||
if(v->error == ALPM_ERR_PKG_MISSING_SIG) {
|
||||
_alpm_log(handle, ALPM_LOG_ERROR,
|
||||
_("%s: missing required signature\n"), v->pkg->name);
|
||||
} else if(v->error == ALPM_ERR_PKG_INVALID_SIG) {
|
||||
_alpm_process_siglist(handle, v->pkg->name, v->siglist,
|
||||
v->siglevel & ALPM_SIG_PACKAGE_OPTIONAL,
|
||||
v->siglevel & ALPM_SIG_PACKAGE_MARGINAL_OK,
|
||||
v->siglevel & ALPM_SIG_PACKAGE_UNKNOWN_OK);
|
||||
prompt_to_delete(handle, v->path, v->error);
|
||||
} else if(v->error == ALPM_ERR_PKG_INVALID_CHECKSUM) {
|
||||
prompt_to_delete(handle, v->path, v->error);
|
||||
switch(v->error) {
|
||||
case ALPM_ERR_PKG_MISSING_SIG:
|
||||
_alpm_log(handle, ALPM_LOG_ERROR,
|
||||
_("%s: missing required signature\n"), v->pkg->name);
|
||||
break;
|
||||
case ALPM_ERR_PKG_INVALID_SIG:
|
||||
_alpm_process_siglist(handle, v->pkg->name, v->siglist,
|
||||
v->siglevel & ALPM_SIG_PACKAGE_OPTIONAL,
|
||||
v->siglevel & ALPM_SIG_PACKAGE_MARGINAL_OK,
|
||||
v->siglevel & ALPM_SIG_PACKAGE_UNKNOWN_OK);
|
||||
/* fallthrough */
|
||||
case ALPM_ERR_PKG_INVALID_CHECKSUM:
|
||||
prompt_to_delete(handle, v->path, v->error);
|
||||
break;
|
||||
case ALPM_ERR_PKG_NOT_FOUND:
|
||||
case ALPM_ERR_BADPERMS:
|
||||
case ALPM_ERR_PKG_OPEN:
|
||||
_alpm_log(handle, ALPM_LOG_ERROR, _("failed to read file %s: %s\n"), v->path, alpm_strerror(v->error));
|
||||
break;
|
||||
default:
|
||||
/* ignore */
|
||||
break;
|
||||
}
|
||||
alpm_siglist_cleanup(v->siglist);
|
||||
free(v->siglist);
|
||||
|
||||
@@ -548,6 +548,25 @@ static int _alpm_chroot_read_from_child(alpm_handle_t *handle, int fd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void _alpm_reset_signals(void)
|
||||
{
|
||||
/* reset POSIX defined signals (see signal.h) */
|
||||
/* there are likely more but there is no easy way
|
||||
* to get the full list of valid signals */
|
||||
int *i, signals[] = {
|
||||
SIGABRT, SIGALRM, SIGBUS, SIGCHLD, SIGCONT, SIGFPE, SIGHUP, SIGILL,
|
||||
SIGINT, SIGKILL, SIGPIPE, SIGQUIT, SIGSEGV, SIGSTOP, SIGTERM, SIGTSTP,
|
||||
SIGTTIN, SIGTTOU, SIGUSR1, SIGUSR2, SIGPOLL, SIGPROF, SIGSYS, SIGTRAP,
|
||||
SIGURG, SIGVTALRM, SIGXCPU, SIGXFSZ,
|
||||
0
|
||||
};
|
||||
struct sigaction def;
|
||||
def.sa_handler = SIG_DFL;
|
||||
for(i = signals; *i; i++) {
|
||||
sigaction(*i, &def, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/** Execute a command with arguments in a chroot.
|
||||
* @param handle the context handle
|
||||
* @param cmd command to execute
|
||||
@@ -633,6 +652,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
|
||||
exit(1);
|
||||
}
|
||||
umask(0022);
|
||||
_alpm_reset_signals();
|
||||
execv(cmd, argv);
|
||||
/* execv only returns if there was an error */
|
||||
fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno));
|
||||
@@ -645,6 +665,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
|
||||
ssize_t olen = 0, ilen = 0;
|
||||
nfds_t nfds = 2;
|
||||
struct pollfd fds[2], *child2parent = &(fds[0]), *parent2child = &(fds[1]);
|
||||
int poll_ret;
|
||||
|
||||
child2parent->fd = child2parent_pipefd[TAIL];
|
||||
child2parent->events = POLLIN;
|
||||
@@ -665,7 +686,14 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
|
||||
#define STOP_POLLING(p) do { close(p->fd); p->fd = -1; } while(0)
|
||||
|
||||
while((child2parent->fd != -1 || parent2child->fd != -1)
|
||||
&& poll(fds, nfds, -1) > 0) {
|
||||
&& (poll_ret = poll(fds, nfds, -1)) != 0) {
|
||||
if(poll_ret == -1) {
|
||||
if(errno == EINTR) {
|
||||
continue;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(child2parent->revents & POLLIN) {
|
||||
if(_alpm_chroot_read_from_child(handle, child2parent->fd,
|
||||
ibuf, &ilen, sizeof(ibuf)) != 0) {
|
||||
|
||||
@@ -38,6 +38,25 @@ AC_DEFUN([GCC_STACK_PROTECT_CC],[
|
||||
fi
|
||||
])
|
||||
|
||||
dnl GCC_STACK_CLASH_PROTECTION
|
||||
dnl check -fstack-clash-protection with the C compiler, if it exists then
|
||||
dnl updates CFLAGS
|
||||
AC_DEFUN([GCC_STACK_CLASH_PROTECTION],[
|
||||
AC_LANG_ASSERT(C)
|
||||
if test "X$CC" != "X"; then
|
||||
AC_CACHE_CHECK([whether ${CC} accepts -fstack-clash-protection],
|
||||
scp_cv_cc,
|
||||
[scp_old_cflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fstack-clash-protection"
|
||||
AC_TRY_COMPILE(,, scp_cv_cc=yes, scp_cv_cc=no)
|
||||
CFLAGS="$scp_old_cflags"
|
||||
])
|
||||
if test $scp_cv_cc = yes; then
|
||||
CFLAGS="$CFLAGS -fstack-clash-protection"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
dnl GCC_FORTIFY_SOURCE_CC
|
||||
dnl checks -D_FORTIFY_SOURCE with the C compiler, if it exists then updates
|
||||
dnl CPPFLAGS
|
||||
|
||||
507
meson.build
Normal file
507
meson.build
Normal file
@@ -0,0 +1,507 @@
|
||||
project('pacman',
|
||||
'c',
|
||||
version : '5.1.0',
|
||||
license : 'GPLv2+',
|
||||
default_options : [
|
||||
'c_std=gnu99',
|
||||
'prefix=/usr',
|
||||
'sysconfdir=/etc',
|
||||
'localstatedir=/var',
|
||||
],
|
||||
meson_version : '>= 0.47')
|
||||
|
||||
libalpm_version = '11.0.1'
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
# commandline options
|
||||
PREFIX = get_option('prefix')
|
||||
DATAROOTDIR = join_paths(PREFIX, get_option('datarootdir'))
|
||||
SYSCONFDIR = join_paths(PREFIX, get_option('sysconfdir'))
|
||||
LOCALSTATEDIR = join_paths(PREFIX, get_option('localstatedir'))
|
||||
LOCALEDIR = join_paths(PREFIX, get_option('localedir'))
|
||||
ROOTDIR = get_option('root-dir')
|
||||
BINDIR = join_paths(PREFIX, get_option('bindir'))
|
||||
MANDIR = join_paths(PREFIX, get_option('mandir'))
|
||||
BUILDSCRIPT = get_option('buildscript')
|
||||
LIBMAKEPKGDIR = join_paths(PREFIX, DATAROOTDIR, 'makepkg')
|
||||
PKGDATADIR = join_paths(PREFIX, DATAROOTDIR, meson.project_name())
|
||||
|
||||
PYTHON = import('python').find_installation('python3')
|
||||
M4 = find_program('m4')
|
||||
SED = find_program('sed')
|
||||
DU = find_program('du')
|
||||
LDCONFIG = get_option('ldconfig')
|
||||
MESON_MAKE_SYMLINK = join_paths(meson.source_root(), 'build-aux/meson-make-symlink.sh')
|
||||
MESON_INSTALL_SCRIPT = join_paths(meson.source_root(), 'build-aux/meson-install-script.sh')
|
||||
|
||||
BASH = find_program('bash4', 'bash')
|
||||
if BASH.found()
|
||||
bash_version = run_command(BASH, '-c', 'IFS=.; echo "${BASH_VERSINFO[*]:0:3}"').stdout()
|
||||
|
||||
have_bash = bash_version.version_compare('>= 4.4.0')
|
||||
endif
|
||||
if not have_bash
|
||||
error('bash >= 4.4.0 is required for pacman scripts.')
|
||||
endif
|
||||
|
||||
bashcompletion = dependency('bash-completion', required : false)
|
||||
if bashcompletion.found()
|
||||
BASHCOMPDIR = bashcompletion.get_pkgconfig_variable('completionsdir')
|
||||
else
|
||||
BASHCOMPDIR = join_paths(DATAROOTDIR, 'bash-completion/completions')
|
||||
endif
|
||||
|
||||
if get_option('use-git-version')
|
||||
PACKAGE_VERSION = run_command(
|
||||
find_program('git'),
|
||||
'describe',
|
||||
'--abbrev=4',
|
||||
'--dirty').stdout().strip().strip('v')
|
||||
else
|
||||
PACKAGE_VERSION = meson.project_version()
|
||||
endif
|
||||
|
||||
conf = configuration_data()
|
||||
conf.set('_GNU_SOURCE', true)
|
||||
conf.set_quoted('PACKAGE', meson.project_name())
|
||||
conf.set_quoted('PACKAGE_VERSION', PACKAGE_VERSION)
|
||||
conf.set_quoted('LOCALEDIR', LOCALEDIR)
|
||||
conf.set_quoted('SCRIPTLET_SHELL', get_option('scriptlet-shell'))
|
||||
conf.set_quoted('LDCONFIG', LDCONFIG)
|
||||
conf.set_quoted('LIB_VERSION', meson.project_version())
|
||||
conf.set_quoted('SYSHOOKDIR', join_paths(DATAROOTDIR, 'libalpm/hooks/'))
|
||||
conf.set_quoted('CONFFILE', join_paths(SYSCONFDIR, 'pacman.conf'))
|
||||
conf.set_quoted('DBPATH', join_paths(LOCALSTATEDIR, 'lib/pacman/'))
|
||||
conf.set_quoted('GPGDIR', join_paths(SYSCONFDIR, 'pacman.d/gnupg/'))
|
||||
conf.set_quoted('LOGFILE', join_paths(LOCALSTATEDIR, 'log/pacman.log'))
|
||||
conf.set_quoted('CACHEDIR', join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/'))
|
||||
conf.set_quoted('HOOKDIR', join_paths(SYSCONFDIR, 'pacman.d/hooks/'))
|
||||
conf.set_quoted('ROOTDIR', ROOTDIR)
|
||||
|
||||
if get_option('i18n')
|
||||
if not cc.has_function('ngettext')
|
||||
error('ngettext not found but NLS support requested')
|
||||
endif
|
||||
conf.set('ENABLE_NLS', 1)
|
||||
endif
|
||||
|
||||
# dependencies
|
||||
libarchive = dependency('libarchive',
|
||||
version : '>=3.0.0',
|
||||
static : get_option('buildstatic'))
|
||||
|
||||
libcurl = dependency('libcurl',
|
||||
version : '>=7.32.0',
|
||||
required : get_option('curl'),
|
||||
static : get_option('buildstatic'))
|
||||
conf.set('HAVE_LIBCURL', libcurl.found())
|
||||
|
||||
want_gpgme = get_option('gpgme')
|
||||
gpgme_config = find_program('gpgme-config', required : want_gpgme)
|
||||
if not want_gpgme.disabled() and gpgme_config.found()
|
||||
gpgme_version = run_command(gpgme_config, '--version').stdout().strip()
|
||||
|
||||
needed_gpgme_version = '>=1.3.0'
|
||||
have = gpgme_version.version_compare(needed_gpgme_version)
|
||||
if want_gpgme.enabled() and not have
|
||||
error('gpgme @0@ is needed for GPG signature support'.format(needed_gpgme_version))
|
||||
endif
|
||||
|
||||
gpgme_libs = [
|
||||
cc.find_library('gpgme', required : have,
|
||||
dirs : [get_option('gpgme-libdir')]),
|
||||
cc.find_library('gpg-error', required : have,
|
||||
dirs : [get_option('gpgme-libdir')]),
|
||||
cc.find_library('assuan', required : have,
|
||||
dirs : [get_option('gpgme-libdir')]),
|
||||
]
|
||||
|
||||
conf.set('HAVE_LIBGPGME', have)
|
||||
else
|
||||
gpgme_libs = []
|
||||
conf.set('HAVE_LIBGPGME', false)
|
||||
endif
|
||||
|
||||
want_crypto = get_option('crypto')
|
||||
if want_crypto == 'openssl'
|
||||
libcrypto = dependency('libcrypto', static : get_option('buildstatic'))
|
||||
if not libcrypto.found()
|
||||
error('openssl support requested but not found')
|
||||
endif
|
||||
crypto_provider = libcrypto
|
||||
conf.set10('HAVE_LIBSSL', true)
|
||||
elif want_crypto == 'nettle'
|
||||
libnettle = dependency('nettle', static : get_option('buildstatic'))
|
||||
if not libnettle.found()
|
||||
error('nettle support requested but not found')
|
||||
endif
|
||||
crypto_provider = libnettle
|
||||
conf.set10('HAVE_LIBNETTLE', true)
|
||||
else
|
||||
error('unhandled crypto value @0@'.format(want_crypto))
|
||||
endif
|
||||
|
||||
foreach header : [
|
||||
'mntent.h',
|
||||
'sys/mnttab.h',
|
||||
'sys/mount.h',
|
||||
'sys/param.h',
|
||||
'sys/statvfs.h',
|
||||
'sys/types.h',
|
||||
'sys/ucred.h',
|
||||
'termios.h',
|
||||
]
|
||||
if cc.has_header(header)
|
||||
conf.set('HAVE_' + header.underscorify().to_upper(), true)
|
||||
endif
|
||||
endforeach
|
||||
|
||||
foreach sym : [
|
||||
'dup2',
|
||||
'fork',
|
||||
'getcwd',
|
||||
'getmntent',
|
||||
'getmntinfo',
|
||||
'gettimeofday',
|
||||
'memmove',
|
||||
'memset',
|
||||
'mkdir',
|
||||
'realpath',
|
||||
'regcomp',
|
||||
'rmdir',
|
||||
'setenv',
|
||||
'setlocale',
|
||||
'strcasecmp',
|
||||
'strchr',
|
||||
'strcspn',
|
||||
'strdup',
|
||||
'strerror',
|
||||
'strndup',
|
||||
'strnlen',
|
||||
'strnlen',
|
||||
'strrchr',
|
||||
'strsep',
|
||||
'strsep',
|
||||
'strstr',
|
||||
'strtol',
|
||||
'swprintf',
|
||||
'tcflush',
|
||||
'tcflush',
|
||||
'uname',
|
||||
'wcwidth',
|
||||
]
|
||||
have = cc.has_function(sym, args : '-D_GNU_SOURCE')
|
||||
conf.set10('HAVE_' + sym.to_upper(), have)
|
||||
endforeach
|
||||
|
||||
foreach member : [
|
||||
['struct stat', 'st_blksize', '''#include <sys/stat.h>'''],
|
||||
['struct statvfs', 'f_flag', '''#include <sys/statvfs.h>'''],
|
||||
['struct statfs', 'f_flags', '''#include <sys/param.h>
|
||||
#include <sys/mount.h>'''],
|
||||
]
|
||||
have = cc.has_member(member[0], member[1], prefix : member[2])
|
||||
conf.set('HAVE_' + '_'.join([member[0], member[1]]).underscorify().to_upper(), have)
|
||||
endforeach
|
||||
|
||||
if conf.has('HAVE_STRUCT_STATVFS_F_FLAG')
|
||||
conf.set('FSSTATSTYPE', 'struct statvfs')
|
||||
elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')
|
||||
conf.set('FSSTATSTYPE', 'struct statfs')
|
||||
endif
|
||||
|
||||
if get_option('buildtype').startswith('debug')
|
||||
extra_cflags = [
|
||||
'-Wcast-align',
|
||||
'-Wclobbered',
|
||||
'-Wempty-body',
|
||||
'-Wfloat-equal',
|
||||
'-Wformat-nonliteral',
|
||||
'-Wformat-security',
|
||||
'-Wignored-qualifiers',
|
||||
'-Wimplicit-fallthrough',
|
||||
'-Winit-self',
|
||||
'-Wlogical-op',
|
||||
'-Wmissing-declarations',
|
||||
'-Wmissing-field-initializers',
|
||||
'-Wmissing-parameter-type',
|
||||
'-Wmissing-prototypes',
|
||||
'-Wold-style-declaration',
|
||||
'-Woverride-init',
|
||||
'-Wpointer-arith',
|
||||
'-Wredundant-decls',
|
||||
'-Wshadow',
|
||||
'-Wsign-compare',
|
||||
'-Wstrict-aliasing',
|
||||
'-Wstrict-overflow=5',
|
||||
'-Wstrict-prototypes',
|
||||
'-Wtype-limits',
|
||||
'-Wuninitialized',
|
||||
'-Wunused-but-set-parameter',
|
||||
'-Wunused-parameter',
|
||||
'-Wwrite-strings',
|
||||
]
|
||||
add_project_arguments(cc.get_supported_arguments(extra_cflags), language : 'c')
|
||||
|
||||
conf.set('PACMAN_DEBUG', 1)
|
||||
endif
|
||||
|
||||
config_h = configure_file(
|
||||
output : 'config.h',
|
||||
configuration : conf)
|
||||
add_project_arguments('-include', 'config.h', language : 'c')
|
||||
|
||||
default_duflags = ' -sk --apparent-size'
|
||||
default_sedinplaceflags = ' --follow-symlinks -i'
|
||||
inodecmd = 'stat -c \'%i %n\''
|
||||
ownercmd = 'stat -c \'%u:%g\''
|
||||
modecmd = 'stat -c \'%a\''
|
||||
strip_binaries = '--strip-all'
|
||||
strip_shared = '--strip-unneeded'
|
||||
strip_static = '--strip-debug'
|
||||
|
||||
os = host_machine.system()
|
||||
if os.startswith('darwin')
|
||||
inodecmd = '/usr/bin/stat -f \'%i %n\''
|
||||
ownercmd = '/usr/bin/stat -f \'%u:%g\''
|
||||
modecmd = '/usr/bin/stat -f \'%lp\''
|
||||
default_sedinplaceflags = ' -i \'\''
|
||||
default_duflags = ' -sk'
|
||||
strip_binaries = ''
|
||||
strip_shared = '-s'
|
||||
strip_static = '-s'
|
||||
elif os.contains('bsd') or os == 'dragonfly'
|
||||
inodecmd = 'stat -f \'%i %n\''
|
||||
ownercmd = 'stat -f \'%u:%g\''
|
||||
modecmd = 'stat -f \'%lp\''
|
||||
default_sedinplaceflags = ' -i \'\''
|
||||
default_duflags = ' -sk'
|
||||
endif
|
||||
|
||||
duflags = get_option('duflags')
|
||||
if duflags == 'autodetect'
|
||||
duflags = default_duflags
|
||||
endif
|
||||
|
||||
sedinplaceflags = get_option('sedinplaceflags')
|
||||
if sedinplaceflags == 'auto'
|
||||
sedinplaceflags = default_sedinplaceflags
|
||||
endif
|
||||
|
||||
chost = run_command(cc, '-dumpmachine').stdout().strip()
|
||||
carch = chost.split('-')[0]
|
||||
|
||||
# annoyingly, we have to maintain two sets of configuration_data which is
|
||||
# largely identical, but which distinguishes between quoting needs.
|
||||
substs = configuration_data()
|
||||
substs.set('SED', SED.path())
|
||||
substs.set('M4', M4.path())
|
||||
substs.set('CARCH', carch)
|
||||
substs.set('CHOST', chost)
|
||||
substs.set('PKGEXT', get_option('pkg-ext'))
|
||||
substs.set('SRCEXT', get_option('src-ext'))
|
||||
substs.set('ROOTDIR', ROOTDIR)
|
||||
substs.set('LOCALEDIR', LOCALEDIR)
|
||||
substs.set('sysconfdir', SYSCONFDIR)
|
||||
substs.set('localstatedir', LOCALSTATEDIR)
|
||||
substs.set('PKGDATADIR', PKGDATADIR)
|
||||
substs.set('PREFIX', PREFIX)
|
||||
substs.set('BASH', BASH.path())
|
||||
substs.set('PACKAGE_VERSION', PACKAGE_VERSION)
|
||||
substs.set('PACKAGE_NAME', meson.project_name())
|
||||
substs.set('BUILDSCRIPT', BUILDSCRIPT)
|
||||
substs.set('TEMPLATE_DIR', get_option('makepkg-template-dir'))
|
||||
substs.set('DEBUGSUFFIX', get_option('debug-suffix'))
|
||||
substs.set('INODECMD', inodecmd)
|
||||
substs.set('OWNERCMD', ownercmd)
|
||||
substs.set('MODECMD', modecmd)
|
||||
substs.set('SEDINPLACEFLAGS', sedinplaceflags)
|
||||
substs.set('SEDPATH', SED.path())
|
||||
substs.set('DUFLAGS', duflags)
|
||||
substs.set('DUPATH', DU.path())
|
||||
substs.set('LIBMAKEPKGDIR', LIBMAKEPKGDIR)
|
||||
substs.set('STRIP_BINARIES', strip_binaries)
|
||||
substs.set('STRIP_SHARED', strip_shared)
|
||||
substs.set('STRIP_STATIC', strip_static)
|
||||
|
||||
subdir('lib/libalpm')
|
||||
subdir('src/common')
|
||||
subdir('src/pacman')
|
||||
subdir('src/util')
|
||||
subdir('scripts')
|
||||
|
||||
# Internationalization
|
||||
if get_option('i18n')
|
||||
i18n = import('i18n')
|
||||
subdir('lib/libalpm/po')
|
||||
subdir('src/pacman/po')
|
||||
subdir('scripts/po')
|
||||
endif
|
||||
|
||||
want_doc = get_option('doc')
|
||||
ASCIIDOC = find_program('asciidoc', required : want_doc)
|
||||
A2X = find_program('a2x', required : want_doc)
|
||||
build_doc = A2X.found() and not want_doc.disabled()
|
||||
if build_doc
|
||||
subdir('doc')
|
||||
endif
|
||||
|
||||
includes = include_directories('src/common', 'lib/libalpm')
|
||||
|
||||
libcommon = static_library(
|
||||
'common',
|
||||
libcommon_sources,
|
||||
include_directories : includes,
|
||||
install : false)
|
||||
|
||||
libalpm_a = static_library(
|
||||
'alpm',
|
||||
libalpm_sources,
|
||||
include_directories : includes,
|
||||
dependencies : [crypto_provider, libarchive, libcurl] + gpgme_libs,
|
||||
link_with : [libcommon],
|
||||
install : true)
|
||||
|
||||
if get_option('default_library') != 'static'
|
||||
libalpm = library(
|
||||
'alpm',
|
||||
version : libalpm_version,
|
||||
link_whole: [libalpm_a],
|
||||
install : true)
|
||||
else
|
||||
libalpm = libalpm_a
|
||||
endif
|
||||
|
||||
install_headers(
|
||||
'lib/libalpm/alpm.h',
|
||||
'lib/libalpm/alpm_list.h')
|
||||
|
||||
# TODO: libs.private seem quite wrong here
|
||||
pkgconfig = import('pkgconfig')
|
||||
pkgconfig.generate(
|
||||
libalpm,
|
||||
name : 'libalpm',
|
||||
description : 'Arch Linux package management library',
|
||||
version : libalpm_version,
|
||||
url : 'http://www.archlinux.org/pacman/')
|
||||
|
||||
pacman_bin = executable(
|
||||
'pacman',
|
||||
pacman_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libalpm, libcommon],
|
||||
dependencies : [libarchive],
|
||||
install : true,
|
||||
)
|
||||
|
||||
executable(
|
||||
'pacman-conf',
|
||||
pacman_conf_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libalpm],
|
||||
install : true,
|
||||
)
|
||||
|
||||
executable(
|
||||
'cleanupdelta',
|
||||
cleanupdelta_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libalpm],
|
||||
install : true,
|
||||
)
|
||||
|
||||
executable(
|
||||
'testpkg',
|
||||
testpkg_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libalpm],
|
||||
install : true,
|
||||
)
|
||||
|
||||
executable(
|
||||
'vercmp',
|
||||
vercmp_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libalpm_a],
|
||||
install : true,
|
||||
)
|
||||
|
||||
configure_file(
|
||||
input : 'etc/makepkg.conf.in',
|
||||
output : 'makepkg.conf',
|
||||
configuration : substs,
|
||||
install_dir : SYSCONFDIR)
|
||||
|
||||
configure_file(
|
||||
input : 'etc/pacman.conf.in',
|
||||
output : 'pacman.conf',
|
||||
configuration : substs,
|
||||
install_dir : SYSCONFDIR)
|
||||
|
||||
install_data(
|
||||
'proto/PKGBUILD-split.proto',
|
||||
'proto/PKGBUILD-vcs.proto',
|
||||
'proto/PKGBUILD.proto',
|
||||
'proto/proto.install',
|
||||
install_dir : join_paths(DATAROOTDIR, 'pacman'))
|
||||
|
||||
foreach path : [
|
||||
join_paths(LOCALSTATEDIR, 'lib/pacman/'),
|
||||
join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/'),
|
||||
join_paths(DATAROOTDIR, 'makepkg-template/'),
|
||||
join_paths(DATAROOTDIR, 'libalpm/hooks/'),
|
||||
]
|
||||
meson.add_install_script('sh', '-c', 'mkdir -p "$DESTDIR/@0@"'.format(path))
|
||||
endforeach
|
||||
|
||||
TEST_ENV = environment()
|
||||
TEST_ENV.set('PMTEST_SCRIPTLIB_DIR', join_paths(meson.source_root(), 'scripts/library/'))
|
||||
TEST_ENV.set('PMTEST_LIBMAKEPKG_DIR', join_paths(meson.build_root(), 'scripts/libmakepkg/'))
|
||||
TEST_ENV.set('PMTEST_UTIL_DIR', meson.build_root() + '/')
|
||||
TEST_ENV.set('PMTEST_SCRIPT_DIR', join_paths(meson.build_root(), 'scripts/'))
|
||||
|
||||
subdir('test/pacman')
|
||||
subdir('test/scripts')
|
||||
subdir('test/util')
|
||||
|
||||
message('\n '.join([
|
||||
'@0@ @1@'.format(meson.project_name(), meson.project_version()),
|
||||
'Build information:',
|
||||
' prefix : @0@'.format(PREFIX),
|
||||
' sysconfdir : @0@'.format(SYSCONFDIR),
|
||||
' conf file : @0@'.format(join_paths(SYSCONFDIR, 'pacman.conf')),
|
||||
' localstatedir : @0@'.format(LOCALSTATEDIR),
|
||||
' database dir : @0@'.format(join_paths(LOCALSTATEDIR, 'lib/pacman/')),
|
||||
' cache dir : @0@'.format(join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/')),
|
||||
' compiler : @0@ @1@'.format(cc.get_id(), cc.version()),
|
||||
'',
|
||||
' Architecture : @0@'.format(carch),
|
||||
' Host Type : @0@'.format(chost),
|
||||
' File inode command : @0@'.format(inodecmd),
|
||||
' File owner command : @0@'.format(ownercmd),
|
||||
' File mode command : @0@'.format(modecmd),
|
||||
' Directory size command : @0@ @1@'.format(DU.path(), duflags),
|
||||
' In-place sed command : @0@ @1@'.format(SED.path(), sedinplaceflags),
|
||||
' libalpm version : @0@'.format(libalpm_version),
|
||||
' pacman version : @0@'.format(PACKAGE_VERSION),
|
||||
'',
|
||||
'Directory and file information:',
|
||||
' root working directory : @0@'.format(ROOTDIR),
|
||||
' package extension : @0@'.format(get_option('pkg-ext')),
|
||||
' source pkg extension : @0@'.format(get_option('src-ext')),
|
||||
' build script name : @0@'.format(BUILDSCRIPT),
|
||||
' template directory : @0@'.format(get_option('makepkg-template-dir')),
|
||||
'',
|
||||
'Compilation options:',
|
||||
' i18n support : @0@'.format(get_option('i18n')),
|
||||
' Build docs : @0@'.format(build_doc),
|
||||
' debug build : @0@'.format(get_option('buildtype') == 'debug'),
|
||||
' Use libcurl : @0@'.format(conf.get('HAVE_LIBCURL')),
|
||||
' Use GPGME : @0@'.format(conf.get('HAVE_LIBGPGME')),
|
||||
' Use OpenSSL : @0@'.format(conf.has('HAVE_LIBSSL') and
|
||||
conf.get('HAVE_LIBSSL') == 1),
|
||||
' Use nettle : @0@'.format(conf.has('HAVE_LIBNETTLE') and
|
||||
conf.get('HAVE_LIBNETTLE') == 1),
|
||||
'',
|
||||
]))
|
||||
61
meson_options.txt
Normal file
61
meson_options.txt
Normal file
@@ -0,0 +1,61 @@
|
||||
# build behavior
|
||||
option('use-git-version', type : 'boolean', value : false,
|
||||
description : 'take version information from git')
|
||||
option('buildstatic', type : 'boolean', value : false,
|
||||
description : 'if true, build statically linked binaries')
|
||||
|
||||
# directories and filenames
|
||||
option('root-dir', type : 'string', value : '/',
|
||||
description : 'set the location of the root operating directory')
|
||||
|
||||
option('pkg-ext', type : 'string', value : '.pkg.tar.gz',
|
||||
description : 'set the file extension used by packages')
|
||||
|
||||
option('src-ext', type : 'string', value : '.src.tar.gz',
|
||||
description : 'set the file extension used by source packages')
|
||||
|
||||
option('scriptlet-shell', type : 'string', value : '/bin/sh',
|
||||
description : 'The full path of the shell used to run install scriptlets')
|
||||
|
||||
option('ldconfig', type : 'string', value : '/sbin/ldconfig',
|
||||
description : 'set the full path to ldconfig')
|
||||
|
||||
option('buildscript', type : 'string', value : 'PKGBUILD',
|
||||
description : 'set the build script name used by makepkg')
|
||||
|
||||
option('datarootdir', type : 'string', value : 'share',
|
||||
description : 'FIXME')
|
||||
|
||||
option('makepkg-template-dir', type : 'string', value : '/usr/share/makepkg-template',
|
||||
description : 'template dir used by makepkg-template')
|
||||
|
||||
option('debug-suffix', type : 'string', value : 'debug',
|
||||
description : 'suffix for split debugging symbol packages used by makepkg')
|
||||
|
||||
# dependencies, features
|
||||
option('doc', type : 'feature', value : 'auto',
|
||||
description : 'generate docs and manpages')
|
||||
|
||||
option('doxygen', type : 'feature', value : 'disabled',
|
||||
description : 'generate doxygen manpages and html')
|
||||
|
||||
option('curl', type : 'feature', value : 'auto',
|
||||
description : 'use curl to download files')
|
||||
|
||||
option('crypto', type : 'combo', choices : ['openssl', 'nettle'],
|
||||
description : 'select crypto implementation')
|
||||
|
||||
option('gpgme', type : 'feature', value : 'auto',
|
||||
description : 'use GPGME for PGP signature verification')
|
||||
option('gpgme-libdir', type : 'string', value : '/usr/lib',
|
||||
description : 'search directory for gpgme libraries.')
|
||||
|
||||
option('i18n', type : 'boolean', value : true,
|
||||
description : 'enable localization of pacman, libalpm and scripts')
|
||||
|
||||
# tools
|
||||
option('duflags', type : 'string', value : 'autodetect',
|
||||
description : 'flags to pass to du to measure file size')
|
||||
|
||||
option('sedinplaceflags', type : 'string', value : 'auto',
|
||||
description : 'flags to pass to sed to edit a file in-place')
|
||||
@@ -1,10 +1,7 @@
|
||||
# enforce that all scripts have a --help and --version option
|
||||
AUTOMAKE_OPTIONS = std-options
|
||||
AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = \
|
||||
makepkg-wrapper \
|
||||
pacman-db-upgrade-wrapper \
|
||||
pacman-key-wrapper \
|
||||
pkgdelta-wrapper
|
||||
$(WRAPPER)
|
||||
|
||||
SUBDIRS = po
|
||||
|
||||
@@ -35,14 +32,13 @@ EXTRA_DIST = \
|
||||
$(LIBMAKEPKG_DIST)
|
||||
|
||||
LIBRARY = \
|
||||
library/output_format.sh \
|
||||
library/human_to_size.sh \
|
||||
library/size_to_human.sh \
|
||||
library/term_colors.sh
|
||||
library/human_to_size.sh
|
||||
|
||||
libmakepkgdir = $(datarootdir)/makepkg
|
||||
|
||||
LIBMAKEPKGDIRS = \
|
||||
buildenv \
|
||||
executable \
|
||||
integrity \
|
||||
lint_config \
|
||||
lint_package \
|
||||
@@ -52,6 +48,22 @@ LIBMAKEPKGDIRS = \
|
||||
util
|
||||
|
||||
LIBMAKEPKG_IN = \
|
||||
libmakepkg/executable.sh \
|
||||
libmakepkg/executable/ccache.sh \
|
||||
libmakepkg/executable/checksum.sh \
|
||||
libmakepkg/executable/distcc.sh \
|
||||
libmakepkg/executable/fakeroot.sh \
|
||||
libmakepkg/executable/gpg.sh \
|
||||
libmakepkg/executable/gzip.sh \
|
||||
libmakepkg/executable/pacman.sh \
|
||||
libmakepkg/executable/strip.sh \
|
||||
libmakepkg/executable/sudo.sh \
|
||||
libmakepkg/executable/vcs.sh \
|
||||
libmakepkg/buildenv.sh \
|
||||
libmakepkg/buildenv/buildflags.sh \
|
||||
libmakepkg/buildenv/compiler.sh \
|
||||
libmakepkg/buildenv/debugflags.sh \
|
||||
libmakepkg/buildenv/makeflags.sh \
|
||||
libmakepkg/integrity.sh \
|
||||
libmakepkg/integrity/generate_checksum.sh \
|
||||
libmakepkg/integrity/generate_signature.sh \
|
||||
@@ -59,6 +71,7 @@ LIBMAKEPKG_IN = \
|
||||
libmakepkg/integrity/verify_signature.sh \
|
||||
libmakepkg/lint_config.sh \
|
||||
libmakepkg/lint_config/paths.sh \
|
||||
libmakepkg/lint_config/source_date_epoch.sh \
|
||||
libmakepkg/lint_config/variable.sh \
|
||||
libmakepkg/lint_package.sh \
|
||||
libmakepkg/lint_package/build_references.sh \
|
||||
@@ -67,17 +80,20 @@ LIBMAKEPKG_IN = \
|
||||
libmakepkg/lint_package/missing_backup.sh \
|
||||
libmakepkg/lint_pkgbuild.sh \
|
||||
libmakepkg/lint_pkgbuild/arch.sh \
|
||||
libmakepkg/lint_pkgbuild/arch_specific.sh \
|
||||
libmakepkg/lint_pkgbuild/backup.sh \
|
||||
libmakepkg/lint_pkgbuild/changelog.sh \
|
||||
libmakepkg/lint_pkgbuild/checkdepends.sh \
|
||||
libmakepkg/lint_pkgbuild/conflicts.sh \
|
||||
libmakepkg/lint_pkgbuild/depends.sh \
|
||||
libmakepkg/lint_pkgbuild/epoch.sh \
|
||||
libmakepkg/lint_pkgbuild/fullpkgver.sh \
|
||||
libmakepkg/lint_pkgbuild/install.sh \
|
||||
libmakepkg/lint_pkgbuild/makedepends.sh \
|
||||
libmakepkg/lint_pkgbuild/optdepends.sh \
|
||||
libmakepkg/lint_pkgbuild/options.sh \
|
||||
libmakepkg/lint_pkgbuild/package_function.sh \
|
||||
libmakepkg/lint_pkgbuild/package_function_variable.sh \
|
||||
libmakepkg/lint_pkgbuild/pkgbase.sh \
|
||||
libmakepkg/lint_pkgbuild/pkglist.sh \
|
||||
libmakepkg/lint_pkgbuild/pkgname.sh \
|
||||
@@ -110,6 +126,7 @@ LIBMAKEPKG_IN = \
|
||||
libmakepkg/util/option.sh \
|
||||
libmakepkg/util/parseopts.sh \
|
||||
libmakepkg/util/pkgbuild.sh \
|
||||
libmakepkg/util/schema.sh \
|
||||
libmakepkg/util/source.sh \
|
||||
libmakepkg/util/util.sh
|
||||
|
||||
@@ -120,7 +137,8 @@ WRAPPER = \
|
||||
makepkg-wrapper \
|
||||
pacman-db-upgrade-wrapper \
|
||||
pacman-key-wrapper \
|
||||
pkgdelta-wrapper
|
||||
pkgdelta-wrapper \
|
||||
repo-add-wrapper
|
||||
|
||||
COMPLETION_IN = \
|
||||
completion/bash_completion \
|
||||
@@ -161,18 +179,17 @@ edit = sed \
|
||||
-e "s|@INODECMD[@]|$(INODECMD)|g" \
|
||||
-e "s|@OWNERCMD[@]|$(OWNERCMD)|g" \
|
||||
-e "s|@MODECMD[@]|$(MODECMD)|g" \
|
||||
-e 's|@SIZECMD[@]|$(SIZECMD)|g' \
|
||||
-e 's|@SEDINPLACEFLAGS[@]|$(SEDINPLACEFLAGS)|g' \
|
||||
-e 's|@SEDPATH[@]|$(SEDPATH)|g' \
|
||||
-e 's|@DUFLAGS[@]|$(DUFLAGS)|g' \
|
||||
-e 's|@DUPATH[@]|$(DUPATH)|g' \
|
||||
-e 's|@SCRIPTNAME[@]|$@|g' \
|
||||
-e 's|@configure_input[@]|Generated from $@.sh.in; do not edit by hand.|g'
|
||||
-e 's|@configure_input[@]|Generated from $<; do not edit by hand.|g'
|
||||
|
||||
## All the scripts depend on Makefile so that they are rebuilt when the
|
||||
## prefix etc. changes. Use chmod -w to prevent people from editing the
|
||||
## wrong file by accident.
|
||||
$(OURSCRIPTS): Makefile
|
||||
$(OURSCRIPTS): %: %.sh.in wrapper.sh.in $(LIBMAKEPKG_IN) Makefile
|
||||
$(AM_V_at)$(RM) $@
|
||||
$(AM_V_GEN)test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@
|
||||
$(AM_V_at)chmod +x,a-w $@
|
||||
@@ -193,11 +210,6 @@ $(COMPLETION_IN): %: %.in Makefile
|
||||
|
||||
all-am: $(COMPLETION_IN)
|
||||
|
||||
makepkg: \
|
||||
$(srcdir)/makepkg.sh.in \
|
||||
$(srcdir)/wrapper.sh.in \
|
||||
$(LIBMAKEPKG_IN)
|
||||
|
||||
makepkg-template: \
|
||||
$(srcdir)/makepkg-template.pl.in \
|
||||
Makefile
|
||||
@@ -206,32 +218,13 @@ makepkg-template: \
|
||||
$(AM_V_GEN)$(edit) $< > $@
|
||||
$(AM_V_at)chmod +x,a-w $@
|
||||
|
||||
pacman-db-upgrade: \
|
||||
$(srcdir)/pacman-db-upgrade.sh.in \
|
||||
$(srcdir)/library/output_format.sh
|
||||
|
||||
pacman-key: \
|
||||
$(srcdir)/pacman-key.sh.in \
|
||||
$(srcdir)/library/output_format.sh
|
||||
|
||||
pkgdelta: \
|
||||
$(srcdir)/pkgdelta.sh.in \
|
||||
$(srcdir)/library/output_format.sh
|
||||
|
||||
repo-add: \
|
||||
$(srcdir)/repo-add.sh.in \
|
||||
$(srcdir)/library/output_format.sh
|
||||
|
||||
repo-remove: $(srcdir)/repo-add.sh.in
|
||||
$(AM_V_at)$(RM) repo-remove
|
||||
$(AM_V_at)$(LN_S) repo-add repo-remove
|
||||
|
||||
repo-elephant: $(srcdir)/repo-add.sh.in
|
||||
$(AM_V_at)$(RM) repo-elephant
|
||||
$(AM_V_at)$(LN_S) repo-add repo-elephant
|
||||
repo-remove repo-elephant: repo-add
|
||||
$(AM_V_at)$(RM) $@
|
||||
$(AM_V_at)$(LN_S) repo-add $@
|
||||
|
||||
.SECONDEXPANSION:
|
||||
$(WRAPPER): \
|
||||
$(srcdir)/wrapper.sh.in \
|
||||
$$(subst -wrapper,,$$@)
|
||||
|
||||
$(AM_V_at)$(MKDIR_P) .lib
|
||||
@@ -246,13 +239,18 @@ $(WRAPPER): \
|
||||
$(AM_V_at)$(LN_S) $@ $(subst -wrapper,,$@)
|
||||
|
||||
install-data-local:
|
||||
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
|
||||
$(INSTALL_DATA) completion/bash_completion $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
|
||||
$(MKDIR_P) $(DESTDIR)$(bashcompdir)
|
||||
$(INSTALL_DATA) completion/bash_completion $(DESTDIR)/$(bashcompdir)/pacman
|
||||
for completion in makepkg pacman-key; do \
|
||||
$(LN_S) pacman $(DESTDIR)/$(bashcompdir)/$$completion; \
|
||||
done
|
||||
$(MKDIR_P) $(DESTDIR)$(datarootdir)/zsh/site-functions/
|
||||
$(INSTALL_DATA) completion/zsh_completion $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
|
||||
|
||||
uninstall-local:
|
||||
$(RM) $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
|
||||
$(RM) $(DESTDIR)$(bashcompdir)/makepkg
|
||||
$(RM) $(DESTDIR)$(bashcompdir)/pacman
|
||||
$(RM) $(DESTDIR)$(bashcompdir)/pacman-key
|
||||
$(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
|
||||
|
||||
install-exec-hook:
|
||||
|
||||
@@ -71,10 +71,13 @@ _pacman_key() {
|
||||
}
|
||||
|
||||
_makepkg() {
|
||||
compopt +o default
|
||||
local cur opts prev
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
if [[ $cur = -* && ! $prev =~ ^-(-(config|help|key|version)$|\w*[Vhp]) ]]; then
|
||||
if [[ $prev = @(-p|--config) ]]; then
|
||||
compopt -o default
|
||||
elif [[ ! $prev =~ ^-(-(config|help|key|version)$|\w*[Vh]) ]]; then
|
||||
opts=('allsource asdeps check clean cleanbuild config force geninteg help
|
||||
holdver ignorearch install key log needed noarchive nobuild nocheck
|
||||
nocolor noconfirm nodeps noextract noprepare noprogressbar nosign
|
||||
@@ -101,6 +104,7 @@ _pacman_repo_list() {
|
||||
}
|
||||
|
||||
_pacman() {
|
||||
compopt -o default
|
||||
local common core cur database files prev query remove sync upgrade o
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
@@ -131,16 +135,20 @@ _pacman() {
|
||||
D|R)
|
||||
_pacman_pkg Qq;;
|
||||
F)
|
||||
_arch_incomp 'l list' && _pacman_pkg Slq;
|
||||
;;
|
||||
{ _arch_incomp 'l list' && _pacman_pkg Slq ; } ||
|
||||
_arch_incomp 'o owns' ||
|
||||
compopt +o default;;
|
||||
Q)
|
||||
{ _arch_incomp 'g groups' && _pacman_pkg Qg sort; } ||
|
||||
{ _arch_incomp 'p file' && _pacman_file; } ||
|
||||
_arch_incomp 'o owns' || _arch_incomp 'u upgrades' ||
|
||||
{ _arch_incomp 's search' && compopt +o default; } ||
|
||||
{ _arch_incomp 'u upgrades' && compopt +o default; } ||
|
||||
_arch_incomp 'o owns' ||
|
||||
_pacman_pkg Qq;;
|
||||
S)
|
||||
{ _arch_incomp 'g groups' && _pacman_pkg Sg; } ||
|
||||
{ _arch_incomp 'l list' && _pacman_repo_list; } ||
|
||||
{ _arch_incomp 's search' && compopt +o default; } ||
|
||||
_pacman_pkg Slq;;
|
||||
U)
|
||||
_pacman_file;;
|
||||
@@ -153,8 +161,8 @@ _pacman_file() {
|
||||
compopt -o filenames; _filedir 'pkg.tar*'
|
||||
}
|
||||
|
||||
complete -F _pacman -o default pacman
|
||||
complete -F _makepkg -o default makepkg
|
||||
complete -F _pacman pacman
|
||||
complete -F _makepkg makepkg
|
||||
complete -F _pacman_key -o default pacman-key
|
||||
|
||||
# ex:et ts=2 sw=2 ft=sh
|
||||
|
||||
@@ -370,7 +370,7 @@ _pacman_get_command() {
|
||||
|
||||
# main dispatcher
|
||||
_pacman_zsh_comp() {
|
||||
local -a args cmds;
|
||||
local -a args cmds
|
||||
local tmp
|
||||
args=( ${${${(M)words:#-*}#-}:#-*} )
|
||||
for tmp in $words; do
|
||||
@@ -465,7 +465,7 @@ _pacman_zsh_comp() {
|
||||
if (( ${(w)#cmds} == 1 )); then
|
||||
_pacman_action_help
|
||||
else
|
||||
return 0;
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
*--sync*)
|
||||
@@ -554,7 +554,7 @@ _pacman_key() {
|
||||
"$_key_longopts[@]"
|
||||
;;
|
||||
*)
|
||||
i=$#;
|
||||
i=$#
|
||||
while [[ $words[$i] != -* ]] && [[ $words[$i] != "pacman-key" ]];do
|
||||
i=$(($i-1))
|
||||
done
|
||||
@@ -681,7 +681,7 @@ _makepkg(){
|
||||
*)
|
||||
i=$#
|
||||
while [[ $words[i] != -* ]] && [[ $words[$i] != "makepkg" ]];do
|
||||
i=$((i-1));
|
||||
i=$((i-1))
|
||||
done
|
||||
case $words[$i] in
|
||||
-*)
|
||||
|
||||
45
scripts/libmakepkg/buildenv.sh.in
Normal file
45
scripts/libmakepkg/buildenv.sh.in
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# buildenv.sh - functions for altering the build environment before
|
||||
# compiliation
|
||||
#
|
||||
# Copyright (c) 2015-2018 Pacman Development Team <pacman-dev@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_SH" ]] && return
|
||||
LIBMAKEPKG_BUILDENV_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/message.sh"
|
||||
|
||||
|
||||
declare -a buildenv_functions build_options
|
||||
|
||||
for lib in "$LIBRARY/buildenv/"*.sh; do
|
||||
source "$lib"
|
||||
done
|
||||
|
||||
readonly -a buildenv_functions build_options
|
||||
|
||||
prepare_buildenv() {
|
||||
for func in ${buildenv_functions[@]}; do
|
||||
$func
|
||||
done
|
||||
|
||||
# ensure all necessary build variables are exported
|
||||
export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS CHOST
|
||||
}
|
||||
35
scripts/libmakepkg/buildenv/buildflags.sh.in
Normal file
35
scripts/libmakepkg/buildenv/buildflags.sh.in
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# buildflags.sh - Clear user-specified buildflags if requested
|
||||
#
|
||||
# Copyright (c) 2011-2018 Pacman Development Team <pacman-dev@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_BUILDFLAGS_SH" ]] && return
|
||||
LIBMAKEPKG_BUILDENV_BUILDFLAGS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
build_options+=('buildflags')
|
||||
buildenv_functions+=('buildenv_buildflags')
|
||||
|
||||
buildenv_buildflags() {
|
||||
if check_option "buildflags" "n"; then
|
||||
unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS
|
||||
fi
|
||||
}
|
||||
55
scripts/libmakepkg/buildenv/compiler.sh.in
Normal file
55
scripts/libmakepkg/buildenv/compiler.sh.in
Normal file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# compiler.sh - CCache and DistCC compilation
|
||||
# ccache - Cache compilations and reuse them to save time on repetitions
|
||||
# distcc - Distribute compilation of C and C++ across machines
|
||||
#
|
||||
# Copyright (c) 2007-2018 Pacman Development Team <pacman-dev@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_COMPILER_SH" ]] && return
|
||||
LIBMAKEPKG_BUILDENV_COMPILER_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
build_options+=('ccache' 'distcc')
|
||||
buildenv_functions+=('buildenv_ccache' 'buildenv_distcc')
|
||||
|
||||
using_ccache=0
|
||||
|
||||
buildenv_ccache() {
|
||||
if check_buildoption "ccache" "y"; then
|
||||
if [ -d /usr/lib/ccache/bin ]; then
|
||||
export PATH="/usr/lib/ccache/bin:$PATH"
|
||||
using_ccache=1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
buildenv_distcc() {
|
||||
if check_buildoption "distcc" "y"; then
|
||||
if (( using_ccache )); then
|
||||
export CCACHE_PREFIX="${CCACHE_PREFIX:+$CCACHE_PREFIX }distcc"
|
||||
export CCACHE_BASEDIR="$srcdir"
|
||||
elif [[ -d /usr/lib/distcc/bin ]]; then
|
||||
export PATH="/usr/lib/distcc/bin:$PATH"
|
||||
fi
|
||||
|
||||
export DISTCC_HOSTS
|
||||
fi
|
||||
}
|
||||
38
scripts/libmakepkg/buildenv/debugflags.sh.in
Normal file
38
scripts/libmakepkg/buildenv/debugflags.sh.in
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# debugflags.sh - Specify flags for building a package with debugging
|
||||
# symbols
|
||||
#
|
||||
# Copyright (c) 2012-2018 Pacman Development Team <pacman-dev@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_DEBUGFLAGS_SH" ]] && return
|
||||
LIBMAKEPKG_BUILDENV_DEBUGFLAGS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
buildenv_functions+=('buildenv_debugflags')
|
||||
|
||||
buildenv_debugflags() {
|
||||
if check_option "debug" "y"; then
|
||||
DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
|
||||
DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
|
||||
CFLAGS+=" $DEBUG_CFLAGS"
|
||||
CXXFLAGS+=" $DEBUG_CXXFLAGS"
|
||||
fi
|
||||
}
|
||||
35
scripts/libmakepkg/buildenv/makeflags.sh.in
Normal file
35
scripts/libmakepkg/buildenv/makeflags.sh.in
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# makeflags.sh - Clear user-specified makeflags if requested
|
||||
#
|
||||
# Copyright (c) 2007-2018 Pacman Development Team <pacman-dev@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_MAKEFLAGS_SH" ]] && return
|
||||
LIBMAKEPKG_BUILDENV_MAKEFLAGS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
build_options+=('makeflags')
|
||||
buildenv_functions+=('buildenv_makeflags')
|
||||
|
||||
buildenv_makeflags() {
|
||||
if check_option "makeflags" "n"; then
|
||||
unset MAKEFLAGS
|
||||
fi
|
||||
}
|
||||
20
scripts/libmakepkg/buildenv/meson.build
Normal file
20
scripts/libmakepkg/buildenv/meson.build
Normal file
@@ -0,0 +1,20 @@
|
||||
libmakepkg_module = 'buildenv'
|
||||
|
||||
sources = [
|
||||
'buildflags.sh.in',
|
||||
'compiler.sh.in',
|
||||
'debugflags.sh.in',
|
||||
'makeflags.sh.in',
|
||||
]
|
||||
|
||||
foreach src : sources
|
||||
output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module)
|
||||
|
||||
custom_target(
|
||||
libmakepkg_module + '_' + src.underscorify(),
|
||||
command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ],
|
||||
input : src,
|
||||
output : '@BASENAME@',
|
||||
install : true,
|
||||
install_dir : output_dir)
|
||||
endforeach
|
||||
45
scripts/libmakepkg/executable.sh.in
Normal file
45
scripts/libmakepkg/executable.sh.in
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# executable.sh - confirm presence of dependent executables
|
||||
#
|
||||
# Copyright (c) 2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/message.sh"
|
||||
|
||||
|
||||
declare -a executable_functions
|
||||
|
||||
for lib in "$LIBRARY/executable/"*.sh; do
|
||||
source "$lib"
|
||||
done
|
||||
|
||||
readonly -a executable_functions
|
||||
|
||||
check_software() {
|
||||
local ret=0
|
||||
|
||||
for func in ${executable_functions[@]}; do
|
||||
$func || ret=1
|
||||
done
|
||||
|
||||
return $ret
|
||||
}
|
||||
37
scripts/libmakepkg/executable/ccache.sh.in
Normal file
37
scripts/libmakepkg/executable/ccache.sh.in
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# ccache.sh - Confirm presence of ccache binary
|
||||
#
|
||||
# Copyright (c) 2011-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_CCACHE_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_CCACHE_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
executable_functions+=('executable_ccache')
|
||||
|
||||
executable_ccache() {
|
||||
if check_buildoption "ccache" "y"; then
|
||||
if ! type -p ccache >/dev/null; then
|
||||
error "$(gettext "Cannot find the %s binary required for compiler cache usage.")" "ccache"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
42
scripts/libmakepkg/executable/checksum.sh.in
Normal file
42
scripts/libmakepkg/executable/checksum.sh.in
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# checksum.sh - Confirm presence of binaries for checksum operations
|
||||
#
|
||||
# Copyright (c) 2016-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_CHECKSUM_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_CHECKSUM_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
|
||||
executable_functions+=('executable_checksum')
|
||||
|
||||
executable_checksum() {
|
||||
if (( GENINTEG || ! SKIPCHECKSUMS )); then
|
||||
local integlist
|
||||
mapfile -t integlist < <(get_integlist)
|
||||
|
||||
local integ
|
||||
for integ in "${integlist[@]}"; do
|
||||
if ! type -p "${integ}sum" >/dev/null; then
|
||||
error "$(gettext "Cannot find the %s binary required for source file checksums operations.")" "${integ}sum"
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
37
scripts/libmakepkg/executable/distcc.sh.in
Normal file
37
scripts/libmakepkg/executable/distcc.sh.in
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# distcc.sh - Confirm presence of distcc binary
|
||||
#
|
||||
# Copyright (c) 2011-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_DISTCC_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_DISTCC_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
executable_functions+=('executable_distcc')
|
||||
|
||||
executable_distcc() {
|
||||
if check_buildoption "distcc" "y"; then
|
||||
if ! type -p distcc >/dev/null; then
|
||||
error "$(gettext "Cannot find the %s binary required for distributed compilation.")" "distcc"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
37
scripts/libmakepkg/executable/fakeroot.sh.in
Normal file
37
scripts/libmakepkg/executable/fakeroot.sh.in
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# fakeroot.sh - Confirm presence of fakeroot binary
|
||||
#
|
||||
# Copyright (c) 2011-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_FAKEROOT_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_FAKEROOT_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
executable_functions+=('executable_fakeroot')
|
||||
|
||||
executable_fakeroot() {
|
||||
if (( SOURCEONLY || BUILDPKG )); then
|
||||
if ! type -p fakeroot >/dev/null; then
|
||||
error "$(gettext "Cannot find the %s binary.")" "fakeroot"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
48
scripts/libmakepkg/executable/gpg.sh.in
Normal file
48
scripts/libmakepkg/executable/gpg.sh.in
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# gpg.sh - Confirm presence of gpg binary
|
||||
#
|
||||
# Copyright (c) 2011-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_GPG_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_GPG_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
executable_functions+=('executable_gpg')
|
||||
|
||||
executable_gpg() {
|
||||
local ret=0
|
||||
|
||||
if [[ $SIGNPKG == 'y' ]] || { [[ -z $SIGNPKG ]] && check_buildenv "sign" "y"; }; then
|
||||
if ! type -p gpg >/dev/null; then
|
||||
error "$(gettext "Cannot find the %s binary required for signing packages.")" "gpg"
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( ! SKIPPGPCHECK )) && source_has_signatures; then
|
||||
if ! type -p gpg >/dev/null; then
|
||||
error "$(gettext "Cannot find the %s binary required for verifying source files.")" "gpg"
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
|
||||
return $ret
|
||||
}
|
||||
37
scripts/libmakepkg/executable/gzip.sh.in
Normal file
37
scripts/libmakepkg/executable/gzip.sh.in
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# gzip.sh - Confirm presence of gzip binary
|
||||
#
|
||||
# Copyright (c) 2011-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_GZIP_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_GZIP_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
executable_functions+=('executable_gzip')
|
||||
|
||||
executable_gzip() {
|
||||
if check_option "zipman" "y"; then
|
||||
if ! type -p gzip >/dev/null; then
|
||||
error "$(gettext "Cannot find the %s binary required for compressing man and info pages.")" "gzip"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
26
scripts/libmakepkg/executable/meson.build
Normal file
26
scripts/libmakepkg/executable/meson.build
Normal file
@@ -0,0 +1,26 @@
|
||||
libmakepkg_module = 'executable'
|
||||
|
||||
sources = [
|
||||
'ccache.sh.in',
|
||||
'checksum.sh.in',
|
||||
'distcc.sh.in',
|
||||
'fakeroot.sh.in',
|
||||
'gpg.sh.in',
|
||||
'gzip.sh.in',
|
||||
'pacman.sh.in',
|
||||
'strip.sh.in',
|
||||
'sudo.sh.in',
|
||||
'vcs.sh.in',
|
||||
]
|
||||
|
||||
foreach src : sources
|
||||
output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module)
|
||||
|
||||
custom_target(
|
||||
libmakepkg_module + '_' + src.underscorify(),
|
||||
command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ],
|
||||
input : src,
|
||||
output : '@BASENAME@',
|
||||
install : true,
|
||||
install_dir : output_dir)
|
||||
endforeach
|
||||
37
scripts/libmakepkg/executable/pacman.sh.in
Normal file
37
scripts/libmakepkg/executable/pacman.sh.in
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# pacman.sh - Confirm presence of pacman binary
|
||||
#
|
||||
# Copyright (c) 2012-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_PACMAN_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_PACMAN_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
executable_functions+=('executable_pacman')
|
||||
|
||||
executable_pacman() {
|
||||
if (( ! NODEPS || DEP_BIN || RMDEPS || INSTALL )); then
|
||||
if [[ -z $PACMAN_PATH ]]; then
|
||||
error "$(gettext "Cannot find the %s binary required for dependency operations.")" "$PACMAN"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
37
scripts/libmakepkg/executable/strip.sh.in
Normal file
37
scripts/libmakepkg/executable/strip.sh.in
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# strip.sh - Confirm presence of strip binary
|
||||
#
|
||||
# Copyright (c) 2011-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_STRIP_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_STRIP_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
executable_functions+=('executable_strip')
|
||||
|
||||
executable_strip() {
|
||||
if check_option "strip" "y"; then
|
||||
if ! type -p strip >/dev/null; then
|
||||
error "$(gettext "Cannot find the %s binary required for object file stripping.")" "strip"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
36
scripts/libmakepkg/executable/sudo.sh.in
Normal file
36
scripts/libmakepkg/executable/sudo.sh.in
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# sudo.sh - Confirm presence of sudo binary
|
||||
#
|
||||
# Copyright (c) 2011-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_SUDO_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_SUDO_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
executable_functions+=('executable_sudo')
|
||||
|
||||
executable_sudo() {
|
||||
if (( DEP_BIN || RMDEPS || INSTALL )); then
|
||||
if ! type -p sudo >/dev/null; then
|
||||
warning "$(gettext "Cannot find the %s binary. Will use %s to acquire root privileges.")" "sudo" "su"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
103
scripts/libmakepkg/executable/vcs.sh.in
Normal file
103
scripts/libmakepkg/executable/vcs.sh.in
Normal file
@@ -0,0 +1,103 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# vcs.sh - Confirm presence of binaries for VCS operations
|
||||
#
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@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_EXECUTABLE_VCS_SH" ]] && return
|
||||
LIBMAKEPKG_EXECUTABLE_VCS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/option.sh"
|
||||
|
||||
executable_functions+=('executable_vcs')
|
||||
|
||||
get_vcsclient() {
|
||||
local proto=${1%%+*}
|
||||
|
||||
local i
|
||||
for i in "${VCSCLIENTS[@]}"; do
|
||||
local handler="${i%%::*}"
|
||||
if [[ $proto = "$handler" ]]; then
|
||||
local client="${i##*::}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# if we didn't find an client, return an error
|
||||
if [[ -z $client ]]; then
|
||||
error "$(gettext "Unknown download protocol: %s")" "$proto"
|
||||
plain "$(gettext "Aborting...")"
|
||||
exit $E_CONFIG_ERROR
|
||||
fi
|
||||
|
||||
printf "%s\n" "$client"
|
||||
}
|
||||
|
||||
executable_vcs() {
|
||||
local netfile all_sources all_deps deps ret=0
|
||||
|
||||
if (( SOURCEONLY == 1 )); then
|
||||
# we will not download VCS sources
|
||||
return $ret
|
||||
fi
|
||||
|
||||
if [[ -z $PACMAN_PATH ]]; then
|
||||
warning "$(gettext "Cannot find the %s binary needed to check VCS source requirements.")" "$PACMAN"
|
||||
return $ret
|
||||
fi
|
||||
|
||||
# we currently only use global depends/makedepends arrays for --syncdeps
|
||||
for attr in depends makedepends; do
|
||||
get_pkgbuild_attribute "$pkg" "$attr" 1 'deps'
|
||||
all_deps+=("${deps[@]}")
|
||||
|
||||
get_pkgbuild_attribute "$pkg" "${attr}_$CARCH" 1 'deps'
|
||||
all_deps+=("${deps[@]}")
|
||||
done
|
||||
|
||||
get_all_sources_for_arch 'all_sources'
|
||||
for netfile in ${all_sources[@]}; do
|
||||
local proto=$(get_protocol "$netfile")
|
||||
|
||||
case $proto in
|
||||
bzr*|git*|hg*|svn*)
|
||||
if ! type -p ${proto%%+*} > /dev/null; then
|
||||
local client
|
||||
client=$(get_vcsclient "$proto") || exit $?
|
||||
# ensure specified program is installed
|
||||
local uninstalled
|
||||
uninstalled=$(check_deps "$client") || exit $E_INSTALL_DEPS_FAILED
|
||||
# if not installed, check presence in depends or makedepends
|
||||
if [[ -n "$uninstalled" ]] && (( ! NODEPS || ( VERIFYSOURCE && !DEP_BIN ) )); then
|
||||
if ! in_array "$client" ${all_deps[@]}; then
|
||||
error "$(gettext "Cannot find the %s package needed to handle %s sources.")" \
|
||||
"$client" "${proto%%+*}"
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# non VCS source
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
return $ret
|
||||
}
|
||||
@@ -25,6 +25,7 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
source "$LIBRARY/util/schema.sh"
|
||||
|
||||
generate_one_checksum() {
|
||||
local integ=$1 arch=$2 sources numsrc indentsz idx
|
||||
@@ -52,7 +53,7 @@ generate_one_checksum() {
|
||||
proto="$(get_protocol "$netfile")"
|
||||
|
||||
case $proto in
|
||||
bzr*|git*|hg*|svn*)
|
||||
bzr|git|hg|svn)
|
||||
sum="SKIP"
|
||||
;;
|
||||
*)
|
||||
@@ -78,7 +79,7 @@ generate_one_checksum() {
|
||||
}
|
||||
|
||||
generate_checksums() {
|
||||
msg "$(gettext "Generating checksums for source files...")"
|
||||
msg "$(gettext "Generating checksums for source files...")" >&2
|
||||
|
||||
local integlist
|
||||
if (( $# == 0 )); then
|
||||
|
||||
@@ -40,7 +40,7 @@ create_signature() {
|
||||
if (( ! ret )); then
|
||||
msg2 "$(gettext "Created signature file %s.")" "${filename##*/}.sig"
|
||||
else
|
||||
warning "$(gettext "Failed to sign package file.")"
|
||||
warning "$(gettext "Failed to sign package file %s.")" "${filename##*/}"
|
||||
fi
|
||||
|
||||
return $ret
|
||||
@@ -63,7 +63,7 @@ create_package_signatures() {
|
||||
done
|
||||
|
||||
# check if debug package needs a signature
|
||||
if ! check_option "debug" "y" || ! check_option "strip" "y"; then
|
||||
if check_option "debug" "y" && check_option "strip" "y"; then
|
||||
pkg=$pkgbase-@DEBUGSUFFIX@
|
||||
pkgarch=$(get_pkg_arch)
|
||||
pkg_file="$PKGDEST/${pkg}-${fullver}-${pkgarch}${PKGEXT}"
|
||||
|
||||
20
scripts/libmakepkg/integrity/meson.build
Normal file
20
scripts/libmakepkg/integrity/meson.build
Normal file
@@ -0,0 +1,20 @@
|
||||
libmakepkg_module = 'integrity'
|
||||
|
||||
sources = [
|
||||
'generate_checksum.sh.in',
|
||||
'generate_signature.sh.in',
|
||||
'verify_checksum.sh.in',
|
||||
'verify_signature.sh.in',
|
||||
]
|
||||
|
||||
foreach src : sources
|
||||
output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module)
|
||||
|
||||
custom_target(
|
||||
libmakepkg_module + '_' + src.underscorify(),
|
||||
command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ],
|
||||
input : src,
|
||||
output : '@BASENAME@',
|
||||
install : true,
|
||||
install_dir : output_dir)
|
||||
endforeach
|
||||
@@ -25,6 +25,7 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
source "$LIBRARY/util/schema.sh"
|
||||
|
||||
check_checksums() {
|
||||
local integ a
|
||||
|
||||
@@ -49,8 +49,8 @@ check_pgpsigs() {
|
||||
for netfile in "${all_sources[@]}"; do
|
||||
proto="$(get_protocol "$netfile")"
|
||||
|
||||
if [[ $proto = git* ]]; then
|
||||
verify_git_signature "$netfile" "$statusfile" || continue
|
||||
if declare -f verify_${proto}_signature > /dev/null; then
|
||||
verify_${proto}_signature "$netfile" "$statusfile" || continue
|
||||
else
|
||||
verify_file_signature "$netfile" "$statusfile" || continue
|
||||
fi
|
||||
@@ -137,7 +137,7 @@ verify_file_signature() {
|
||||
for ext in "" gz bz2 xz lrz lzo Z; do
|
||||
if sourcefile="$(get_filepath "${file%.*}${ext:+.$ext}")"; then
|
||||
found=1
|
||||
break;
|
||||
break
|
||||
fi
|
||||
done
|
||||
if (( ! found )); then
|
||||
@@ -263,7 +263,8 @@ source_has_signatures() {
|
||||
proto="$(get_protocol "$netfile")"
|
||||
query=$(get_uri_query "$netfile")
|
||||
|
||||
if [[ ${netfile%%::*} = *.@(sig?(n)|asc) || ( $proto = git* && $query = signed ) ]]; then
|
||||
if [[ ${netfile%%::*} = *.@(sig?(n)|asc) ]] || \
|
||||
( declare -f verify_${proto}_signature > /dev/null && [[ $query = signed ]] ); then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
19
scripts/libmakepkg/lint_config/meson.build
Normal file
19
scripts/libmakepkg/lint_config/meson.build
Normal file
@@ -0,0 +1,19 @@
|
||||
libmakepkg_module = 'lint_config'
|
||||
|
||||
sources = [
|
||||
'paths.sh.in',
|
||||
'source_date_epoch.sh.in',
|
||||
'variable.sh.in',
|
||||
]
|
||||
|
||||
foreach src : sources
|
||||
output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module)
|
||||
|
||||
custom_target(
|
||||
libmakepkg_module + '_' + src.underscorify(),
|
||||
command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ],
|
||||
input : src,
|
||||
output : '@BASENAME@',
|
||||
install : true,
|
||||
install_dir : output_dir)
|
||||
endforeach
|
||||
37
scripts/libmakepkg/lint_config/source_date_epoch.sh.in
Executable file
37
scripts/libmakepkg/lint_config/source_date_epoch.sh.in
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# source_date_epoch.sh - Check that reproducible builds timestamp is valid
|
||||
#
|
||||
# Copyright (c) 2018 Pacman Development Team <pacman-dev@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_LINT_CONFIG_SOURCE_DATE_EPOCH_SH ]] && return
|
||||
LIBMAKEPKG_LINT_CONFIG_SOURCE_DATE_EPOCH_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/message.sh"
|
||||
|
||||
lint_config_functions+=('lint_source_date_epoch')
|
||||
|
||||
|
||||
lint_source_date_epoch() {
|
||||
if [[ $SOURCE_DATE_EPOCH = *[^[:digit:]]* ]]; then
|
||||
error "$(gettext "%s contains invalid characters: %s")" \
|
||||
"\$SOURCE_DATE_EPOCH" "${SOURCE_DATE_EPOCH//[[:digit:]]}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
@@ -25,10 +25,10 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/message.sh"
|
||||
|
||||
lint_config_functions+=('lint_variable')
|
||||
lint_config_functions+=('lint_config_variables')
|
||||
|
||||
|
||||
lint_variable() {
|
||||
lint_config_variables() {
|
||||
local array=(DLAGENTS VCSCLIENTS BUILDENV OPTIONS INTEGRITY_CHECK MAN_DIRS
|
||||
DOC_DIRS PURGE_TARGETS COMPRESSGZ COMPRESSBZ2 COMPRESSXZ
|
||||
COMPRESSLRZ COMPRESSLZO COMPRESSZ)
|
||||
|
||||
20
scripts/libmakepkg/lint_package/meson.build
Normal file
20
scripts/libmakepkg/lint_package/meson.build
Normal file
@@ -0,0 +1,20 @@
|
||||
libmakepkg_module = 'lint_package'
|
||||
|
||||
sources = [
|
||||
'build_references.sh.in',
|
||||
'dotfiles.sh.in',
|
||||
'file_names.sh.in',
|
||||
'missing_backup.sh.in',
|
||||
]
|
||||
|
||||
foreach src : sources
|
||||
output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module)
|
||||
|
||||
custom_target(
|
||||
libmakepkg_module + '_' + src.underscorify(),
|
||||
command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ],
|
||||
input : src,
|
||||
output : '@BASENAME@',
|
||||
install : true,
|
||||
install_dir : output_dir)
|
||||
endforeach
|
||||
@@ -33,8 +33,13 @@ lint_pkgbuild_functions+=('lint_arch')
|
||||
lint_arch() {
|
||||
local a name list ret=0
|
||||
|
||||
if [[ $arch == 'any' ]]; then
|
||||
return 0
|
||||
if in_array "any" "${arch[@]}"; then
|
||||
if (( ${#arch[@]} == 1 )); then
|
||||
return 0;
|
||||
else
|
||||
error "$(gettext "Can not use '%s' architecture with other architectures")" "any"
|
||||
return 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
for a in "${arch[@]}"; do
|
||||
|
||||
82
scripts/libmakepkg/lint_pkgbuild/arch_specific.sh.in
Normal file
82
scripts/libmakepkg/lint_pkgbuild/arch_specific.sh.in
Normal file
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# arch_specific.sh - Check that arch specific variables can be arch specific.
|
||||
#
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@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_LINT_PKGBUILD_ARCH_SPECIFIC_SH" ]] && return
|
||||
LIBMAKEPKG_LINT_PKGBUILD_ARCH_SPECIFIC_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
source "$LIBRARY/util/schema.sh"
|
||||
source "$LIBRARY/util/util.sh"
|
||||
|
||||
|
||||
lint_pkgbuild_functions+=('lint_arch_specific')
|
||||
|
||||
|
||||
lint_arch_specific() {
|
||||
local i a pkg ret=0
|
||||
|
||||
# global variables
|
||||
for a in ${arch[@]}; do
|
||||
if [[ $a == "any" ]]; then
|
||||
for i in ${pkgbuild_schema_arch_arrays[@]}; do
|
||||
if declare -p "${i}_${a}" > /dev/null 2>&1; then
|
||||
error "$(gettext "Can not provide architecture specific variables for the '%s' architecture: %s")" "any" "${i}_${a}"
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
for i in ${pkgbuild_schema_arrays[@]} ${pkgbuild_schema_strings[@]}; do
|
||||
in_array "$i" ${pkgbuild_schema_arch_arrays[@]} && continue
|
||||
v="${i}_${a}"
|
||||
if declare -p "$v" > /dev/null 2>&1; then
|
||||
error "$(gettext "%s can not be architecture specific: %s")" "$i" "${i}_${a}"
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# package function variables
|
||||
for pkg in ${pkgname[@]}; do
|
||||
for a in ${arch[@]}; do
|
||||
if [[ $a == "any" ]]; then
|
||||
for i in ${pkgbuild_schema_arch_arrays[@]}; do
|
||||
if exists_function_variable "package_$pkg" "${i}_${a}"; then
|
||||
error "$(gettext "Can not provide architecture specific variables for the '%s' architecture: %s")" "any" "${i}_${a}"
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
for i in ${pkgbuild_schema_arrays[@]} ${pkgbuild_schema_strings[@]}; do
|
||||
in_array "$i" ${pkgbuild_schema_arch_arrays[@]} && continue
|
||||
if exists_function_variable "package_$pkg" "${i}_${a}"; then
|
||||
error "$(gettext "%s can not be architecture specific: %s")" "$i" "${i}_${a}"
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
|
||||
return $ret
|
||||
}
|
||||
@@ -23,8 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
@@ -43,12 +43,10 @@ lint_checkdepends() {
|
||||
|
||||
for checkdepend in "${checkdepends_list[@]}"; do
|
||||
name=${checkdepend%%@(<|>|=|>=|<=)*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${checkdepend##$name@(<|>|=|>=|<=)?(+([0-9]):)}
|
||||
lint_one_pkgname checkdepends "$name" || ret=1
|
||||
if [[ $ver != $checkdepend ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" checkdepends || ret=1
|
||||
if [[ $name != $checkdepend ]]; then
|
||||
ver=${checkdepend##$name@(<|>|=|>=|<=)}
|
||||
check_fullpkgver "$ver" checkdepends || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
@@ -43,12 +43,10 @@ lint_conflicts() {
|
||||
|
||||
for conflict in "${conflicts_list[@]}"; do
|
||||
name=${conflict%%@(<|>|=|>=|<=)*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${conflict##$name@(<|>|=|>=|<=)?(+([0-9]):)}
|
||||
lint_one_pkgname conflicts "$name" || ret=1
|
||||
if [[ $ver != $conflict ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" conflicts || ret=1
|
||||
if [[ $name != $conflict ]]; then
|
||||
ver=${conflict##$name@(<|>|=|>=|<=)}
|
||||
check_fullpkgver "$ver" conflicts || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
@@ -43,12 +43,13 @@ lint_depends() {
|
||||
|
||||
for depend in "${depends_list[@]}"; do
|
||||
name=${depend%%@(<|>|=|>=|<=)*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${depend##$name@(<|>|=|>=|<=)?(+([0-9]):)}
|
||||
lint_one_pkgname depends "$name" || ret=1
|
||||
if [[ $ver != $depend ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" depends || ret=1
|
||||
if [[ $name != $depend ]]; then
|
||||
ver=${depend##$name@(<|>|=|>=|<=)}
|
||||
# Don't validate empty version because of https://bugs.archlinux.org/task/58776
|
||||
if [[ -n $ver ]]; then
|
||||
check_fullpkgver "$ver" depends || ret=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -29,9 +29,15 @@ source "$LIBRARY/util/message.sh"
|
||||
lint_pkgbuild_functions+=('lint_epoch')
|
||||
|
||||
|
||||
lint_epoch() {
|
||||
check_epoch() {
|
||||
local epoch=$1 type=$2
|
||||
|
||||
if [[ $epoch != *([[:digit:]]) ]]; then
|
||||
error "$(gettext "%s must be an integer, not %s.")" "epoch" "$epoch"
|
||||
error "$(gettext "%s must be an integer, not %s.")" "epoch${type:+ in $type}" "$epoch"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
lint_epoch() {
|
||||
check_epoch "$epoch"
|
||||
}
|
||||
|
||||
58
scripts/libmakepkg/lint_pkgbuild/fullpkgver.sh.in
Normal file
58
scripts/libmakepkg/lint_pkgbuild/fullpkgver.sh.in
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# fullpkgver.sh - Check whether a full version conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2018 Pacman Development Team <pacman-dev@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_LINT_PKGBUILD_FULLPKGVER_SH" ]] && return
|
||||
LIBMAKEPKG_LINT_PKGBUILD_FULLPKGVER_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/epoch.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgrel.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
|
||||
|
||||
check_fullpkgver() {
|
||||
local fullver=$1 type=$2
|
||||
local ret=0
|
||||
|
||||
# If there are multiple colons or multiple hyphens, there's a
|
||||
# question of how we split it--it's invalid either way, but it
|
||||
# will affect error messages. Let's mimic version.c:parseEVR().
|
||||
|
||||
if [[ $fullver = *:* ]]; then
|
||||
# split at the *first* colon
|
||||
check_epoch "${fullver%%:*}" "$type" || ret=1
|
||||
fullver=${fullver#*:}
|
||||
fi
|
||||
|
||||
# Since ver isn't allowed to be empty, don't let rel strip it
|
||||
# down to nothing. Given "-XXX", "pkgver isn't allowed to
|
||||
# contain hyphens" is more helpful than "pkgver isn't allowed
|
||||
# to be empty".
|
||||
if [[ $fullver = ?*-* ]]; then
|
||||
# split at the *last* hyphen
|
||||
check_pkgrel "${fullver##*-}" "$type" || ret=1
|
||||
fullver=${fullver%-*}
|
||||
fi
|
||||
|
||||
check_pkgver "$fullver" "$type" || ret=1
|
||||
|
||||
return $ret
|
||||
}
|
||||
@@ -23,8 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
@@ -43,12 +43,10 @@ lint_makedepends() {
|
||||
|
||||
for makedepend in "${makedepends_list[@]}"; do
|
||||
name=${makedepend%%@(<|>|=|>=|<=)*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${makedepend##$name@(<|>|=|>=|<=)?(+([0-9]):)}
|
||||
lint_one_pkgname makedepends "$name" || ret=1
|
||||
if [[ $ver != $makedepend ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" makedepends || ret=1
|
||||
if [[ $name != $makedepend ]]; then
|
||||
ver=${makedepend##$name@(<|>|=|>=|<=)}
|
||||
check_fullpkgver "$ver" makedepends || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
40
scripts/libmakepkg/lint_pkgbuild/meson.build
Normal file
40
scripts/libmakepkg/lint_pkgbuild/meson.build
Normal file
@@ -0,0 +1,40 @@
|
||||
libmakepkg_module = 'lint_pkgbuild'
|
||||
|
||||
sources = [
|
||||
'arch.sh.in',
|
||||
'arch_specific.sh.in',
|
||||
'backup.sh.in',
|
||||
'changelog.sh.in',
|
||||
'checkdepends.sh.in',
|
||||
'conflicts.sh.in',
|
||||
'depends.sh.in',
|
||||
'epoch.sh.in',
|
||||
'fullpkgver.sh.in',
|
||||
'install.sh.in',
|
||||
'makedepends.sh.in',
|
||||
'optdepends.sh.in',
|
||||
'options.sh.in',
|
||||
'package_function.sh.in',
|
||||
'package_function_variable.sh.in',
|
||||
'pkgbase.sh.in',
|
||||
'pkglist.sh.in',
|
||||
'pkgname.sh.in',
|
||||
'pkgrel.sh.in',
|
||||
'pkgver.sh.in',
|
||||
'provides.sh.in',
|
||||
'source.sh.in',
|
||||
'util.sh.in',
|
||||
'variable.sh.in',
|
||||
]
|
||||
|
||||
foreach src : sources
|
||||
output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module)
|
||||
|
||||
custom_target(
|
||||
libmakepkg_module + '_' + src.underscorify(),
|
||||
command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ],
|
||||
input : src,
|
||||
output : '@BASENAME@',
|
||||
install : true,
|
||||
install_dir : output_dir)
|
||||
endforeach
|
||||
@@ -23,6 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/fullpkgver.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
@@ -31,15 +33,21 @@ lint_pkgbuild_functions+=('lint_optdepends')
|
||||
|
||||
|
||||
lint_optdepends() {
|
||||
local a list name optdepends_list ret=0
|
||||
|
||||
local optdepends_list optdepend name ret=0
|
||||
local optdepends_list optdepend name ver ret=0
|
||||
|
||||
get_pkgbuild_all_split_attributes optdepends optdepends_list
|
||||
|
||||
for optdepend in "${optdepends_list[@]}"; do
|
||||
name=${optdepend%%:[[:space:]]*}
|
||||
# this function requires extglob - save current status to restore later
|
||||
local shellopts=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
for optdepend in "${optdepends_list[@]%%:[[:space:]]*}"; do
|
||||
name=${optdepend%%@(<|>|=|>=|<=)*}
|
||||
lint_one_pkgname optdepends "$name" || ret=1
|
||||
if [[ $name != $optdepend ]]; then
|
||||
ver=${optdepend##$name@(<|>|=|>=|<=)}
|
||||
check_fullpkgver "$ver" optdepends || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
return $ret
|
||||
|
||||
@@ -34,11 +34,18 @@ lint_package_function() {
|
||||
local i ret=0
|
||||
|
||||
if (( ${#pkgname[@]} == 1 )); then
|
||||
if have_function 'build' && ! { have_function 'package' || have_function "package_$pkgname"; }; then
|
||||
if have_function 'package' && have_function "package_$pkgname"; then
|
||||
error "$(gettext "Conflicting %s and %s functions in %s")" "package()" "package_$pkgname()" "$BUILDFILE"
|
||||
ret=1
|
||||
elif have_function 'build' && ! { have_function 'package' || have_function "package_$pkgname"; }; then
|
||||
error "$(gettext "Missing %s function in %s")" "package()" "$BUILDFILE"
|
||||
ret=1
|
||||
fi
|
||||
else
|
||||
if have_function "package"; then
|
||||
error "$(gettext "Extra %s function for split package '%s'")" "package()" "$pkgbase"
|
||||
ret=1
|
||||
fi
|
||||
for i in "${pkgname[@]}"; do
|
||||
if ! have_function "package_$i"; then
|
||||
error "$(gettext "Missing %s function for split package '%s'")" "package_$i()" "$i"
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# package_function_variable.sh - Check variables inside the package function.
|
||||
#
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@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_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH" ]] && return
|
||||
LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
|
||||
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
source "$LIBRARY/util/schema.sh"
|
||||
source "$LIBRARY/util/util.sh"
|
||||
|
||||
|
||||
lint_pkgbuild_functions+=('lint_package_function_variable')
|
||||
|
||||
|
||||
lint_package_function_variable() {
|
||||
local i a pkg ret=0
|
||||
|
||||
# package function variables
|
||||
for pkg in ${pkgname[@]}; do
|
||||
for a in ${arch[@]}; do
|
||||
[[ $a == "any" ]] && continue
|
||||
|
||||
for i in ${pkgbuild_schema_arrays[@]} ${pkgbuild_schema_strings[@]}; do
|
||||
in_array "$i" ${pkgbuild_schema_package_overrides[@]} && continue
|
||||
if exists_function_variable "package_$pkg" "${i}_${a}"; then
|
||||
error "$(gettext "%s can not be set inside a package function")" "${i}_${a}"
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for i in ${pkgbuild_schema_arrays[@]} ${pkgbuild_schema_strings[@]}; do
|
||||
in_array "$i" ${pkgbuild_schema_package_overrides[@]} && continue
|
||||
if exists_function_variable "package_$pkg" "$i"; then
|
||||
error "$(gettext "%s can not be set inside a package function")" "$i"
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
return $ret
|
||||
}
|
||||
@@ -35,8 +35,7 @@ lint_one_pkgname() {
|
||||
|
||||
if [[ -z $name ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "$type"
|
||||
ret=1
|
||||
continue
|
||||
return 1
|
||||
fi
|
||||
if [[ ${name:0:1} = "-" ]]; then
|
||||
error "$(gettext "%s is not allowed to start with a hyphen.")" "$type"
|
||||
|
||||
@@ -29,14 +29,19 @@ source "$LIBRARY/util/message.sh"
|
||||
lint_pkgbuild_functions+=('lint_pkgrel')
|
||||
|
||||
|
||||
lint_pkgrel() {
|
||||
if [[ -z $pkgrel ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
|
||||
check_pkgrel() {
|
||||
local rel=$1 type=$2
|
||||
if [[ -z $rel ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgrel${type:+ in $type}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ $pkgrel != +([0-9])?(.+([0-9])) ]]; then
|
||||
error "$(gettext "%s must be a decimal, not %s.")" "pkgrel" "$pkgrel"
|
||||
if [[ $rel != +([0-9])?(.+([0-9])) ]]; then
|
||||
error "$(gettext "%s must be of the form 'integer[.integer]', not %s.")" "pkgrel${type:+ in $type}" "$rel"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
lint_pkgrel() {
|
||||
check_pkgrel "$pkgrel"
|
||||
}
|
||||
|
||||
@@ -44,10 +44,5 @@ check_pkgver() {
|
||||
}
|
||||
|
||||
lint_pkgver() {
|
||||
if (( PKGVERFUNC )); then
|
||||
# defer check to after getting version from pkgver function
|
||||
return 0
|
||||
fi
|
||||
|
||||
check_pkgver "$pkgver"
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user