Compare commits

...

18 Commits

Author SHA1 Message Date
Allan McRae
7175062526 Store and read name of alternatives
Add the names of supplied alternatives to the .PKGINFO file.  Read and store
these values in libalpm.  This information is currently not used anywhere.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-12-12 11:54:51 +10:00
Allan McRae
7ceee8805b makepkg: add basic support for alternatives
Alternatives are specified in makepkg via (e.g.):

alternative=('sh')

There should be a file (e.g.) sh.alternative alongside the PKGBUILD containing
a list of symlinks to be created with the alternative is active.  This file is
stored in the root of the package as (e.g.) .ALTERNATIVE.sh.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-12-12 11:54:49 +10:00
Allan McRae
d21fb58da3 Gitlab CI: add --werror to debug build
Catch build warnings in the CI.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-11-21 09:54:56 -08:00
Allan McRae
5352367022 Prevent translation of curl
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-11-20 12:39:42 -08:00
morganamilo
5287cc7251 alpm: fix wrong access() being used
When removing files we check _alpm_access() to see if we can write
(delete) the file. If not, we check if the file exists because if the
file does not exist then we don't actually need to remove it so there's
no issue.

However the second call uses acess() instead of _alpm_access() which
does not the rootdir into account.
2021-11-20 12:39:22 -08:00
Evangelos Foutras
fed522775d makepkg.conf: Pass -q as the first option to curl
As per curl(1), the -q (--disable) option must be first on the command
line to disable reading the curlrc config file. Without being first it
does not appear to have any effect.

Signed-off-by: Evangelos Foutras <evangelos@foutrelis.com>
2021-11-20 12:38:57 -08:00
morganamilo
b0a2fd75b2 Update mailing list url
change pacman-dev@archlinux.org to pacmandev@lists.archlinux.org

Most of this is copyright notices but this also fixes FS#72129 by
updating the address in docs/index.asciidoc.
2021-11-20 12:38:25 -08:00
Carlo Teubner
806ccd90ed "pacman -Q --changelog": fix writing uninit'd mem
Previously, when printing a package changelog to stdout, we would write
chunks of data that were not necessarily nul-terminated to stdout using
a function (fputs) which requires the input string to be nul-terminated.

On my system, this would result in occasional garbage characters showing
up in the "pacman -Qc" output.

Fix this by never nul-terminating the chunk, and using the fwrite()
function which takes an explicit input size and does not require a
nul-terminated string.

Signed-off-by: Carlo Teubner <carlo@cteubner.net>
2021-11-20 12:36:59 -08:00
Vladimir Panteleev
b242f5f24c libalpm: Log URLs when retrying
Allow finding which mirror was used to fetch a file.

This makes it a bit easier to debug situations in which mirrors serve
bad files with HTTP 200.

Signed-off-by: Vladimir Panteleev <archlinux@cy.md>
2021-11-20 12:36:29 -08:00
Andrew Gregory
529e208f39 remove YouCompleteMe config
Added, seemingly by accident, with meson in
51db84750e

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2021-11-20 12:22:06 -08:00
Allan McRae
39c3cbdf56 _alpm_key_import: Initialise fetch_key
Prevents build warning.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-09-05 09:58:18 +10:00
morganamilo
165e492485 pacman: don't run hooks when using --dbonly
--dbonly is meant to only touch the database and not the actual system.
However hooks still run which can leave files in place or run commands
you may not want.

The hooks being run also means `fakeroot pacman -S --dbpath test/ foo --dbonly`
fails because alpm tries to chroot for hooks which requires real root.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-09-04 20:46:57 +10:00
morganamilo
be76f8bf06 libalpm: add ALPM_TRANS_FLAG_NOHOOKS
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-09-04 20:46:47 +10:00
morganamilo
625f3d645b libalpm: don't use alpm_pgpkey_t in import question
When constructing an import question we never really used a proper gpg
key. We just zero initialize the key, set the uid and fingerprint, and
sent that to the front end.

Instead lets just give the import question a uid and fingerprint field.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-09-04 20:43:16 +10:00
morganamilo
e187aa9b48 libalpm: use else when setting fingerprint
The docs [1] say keyid will always be there, so no need to check if it
exists.

[1] https://www.gnupg.org/documentation/manuals/gpgme/Key-objects.html

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-09-04 19:52:23 +10:00
morganamilo
c5c6633dd1 libalpm: rename __foo tyes to _foo
__foo is reserved in c and should not be used.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-09-04 19:52:23 +10:00
morganamilo
2109de613a libalpm: take alpm_trans_t out of the public API
this type is only used internally by alpm

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-09-04 19:52:23 +10:00
Allan McRae
fbb29b5047 repo-add: add --include-sigs option
Pacman now downloads the signature files for all packages when present in a
repository.  That makes distributing signatures within repository databases
redundant and costly.

Do not distribute the package signature files within the repo databases by
default and add an --include-sigs to revert to the old behaviour.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-09-04 19:52:23 +10:00
195 changed files with 349 additions and 503 deletions

View File

@@ -27,7 +27,7 @@ arch:
arch-debug:
extends: .arch-test
script:
- meson --buildtype=debug build
- meson --buildtype=debug --werror build
- ninja -C build
- fakechroot meson test -C build

View File

@@ -1,250 +0,0 @@
#!/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
}

View File

@@ -402,8 +402,8 @@ All options and directives for the split packages default to the global values
given in the PKGBUILD. Nevertheless, the following ones can be overridden within
each split package's packaging function:
`pkgdesc`, `arch`, `url`, `license`, `groups`, `depends`, `optdepends`,
`provides`, `conflicts`, `replaces`, `backup`, `options`, `install`, and
`changelog`.
`provides`, `conflicts`, `replaces`, `backup`, `options`, `install`,
`changelog` and `alternative`.
Note that makepkg does not consider split package `depends` when checking
if dependencies are installed before package building and with `--syncdeps`.

View File

@@ -240,7 +240,7 @@ link:translation-help.html[translation-help].
Bugs
----
If you find bugs (which is quite likely), please email them to the pacman-dev
mailing last at mailto:pacman-dev@archlinux.org[] with specific information
mailing last at mailto:pacman-dev@lists.archlinux.org[] with specific information
such as your command-line, the nature of the bug, and even the package database
if it helps.
@@ -251,6 +251,6 @@ bugs under the Pacman project.
Copyright
---------
pacman is Copyright (C) 2006-2021 Pacman Development Team
<pacman-dev@archlinux.org> and Copyright (C) 2002-2006 Judd Vinet
<pacman-dev@lists.archlinux.org> and Copyright (C) 2002-2006 Judd Vinet
<jvinet@zeroflux.org> and is licensed through the GNU General Public License,
version 2 or later.

View File

@@ -70,6 +70,8 @@ repo-add Options
Remove old package files from the disk when updating their entry in the
database.
*\--include-sigs*::
Include package PGP signatures in the repository database (if available)
Example
-------

View File

@@ -55,7 +55,7 @@ Pre-release Updates
~~~~~~~~~~~~~~~~~~~
A week or two before each release, the codebase will go into a string freeze
and an email will be sent to the mailto:pacman-dev@archlinux.org[pacman-dev]
and an email will be sent to the mailto:pacman-dev@lists.archlinux.org[pacman-dev]
mailing list asking for translations. This email will have a prefix of
*[translation]* for anyone looking to set up an email filter.
@@ -150,4 +150,4 @@ There are currently no efforts underway to include translated manual pages in
the pacman codebase. However, this is not to say translations are unwelcome. If
someone has experience with i18n man pages and how to best include them with our
source, please contact the pacman-dev mailing list at
mailto:pacman-dev@archlinux.org[].
mailto:pacman-dev@lists.archlinux.org[].

View File

@@ -9,10 +9,10 @@
#
#-- The download utilities that makepkg should use to acquire sources
# Format: 'protocol::agent'
DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
'rsync::/usr/bin/rsync --no-motd -z %u %o'
'scp::/usr/bin/scp -C %u %o')

View File

@@ -1,7 +1,7 @@
/*
* add.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* add.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* alpm.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>

View File

@@ -1,7 +1,7 @@
/*
* alpm.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@@ -78,7 +78,7 @@ extern "C" {
* This struct represents an instance of libalpm.
* @ingroup libalpm_handle
*/
typedef struct __alpm_handle_t alpm_handle_t;
typedef struct _alpm_handle_t alpm_handle_t;
/** A database.
*
@@ -98,7 +98,7 @@ typedef struct __alpm_handle_t alpm_handle_t;
* Databases are automatically unregistered when the \link alpm_handle_t \endlink is released.
* @ingroup libalpm_databases
*/
typedef struct __alpm_db_t alpm_db_t;
typedef struct _alpm_db_t alpm_db_t;
/** A package.
@@ -111,13 +111,7 @@ typedef struct __alpm_db_t alpm_db_t;
* to be added or removed from the system.
* @ingroup libalpm_packages
*/
typedef struct __alpm_pkg_t alpm_pkg_t;
/** Transaction structure used internally by libalpm
* @ingroup libalpm_trans
* */
typedef struct __alpm_trans_t alpm_trans_t;
typedef struct _alpm_pkg_t alpm_pkg_t;
/** The time type used by libalpm. Represents a unix time stamp
* @ingroup libalpm_misc */
@@ -1080,8 +1074,10 @@ typedef struct _alpm_question_import_key_t {
alpm_question_type_t type;
/** Answer: whether or not to import key */
int import;
/** The key to import */
alpm_pgpkey_t *key;
/** UID of the key to import */
const char *uid;
/** Fingerprint the key to import */
const char *fingerprint;
} alpm_question_import_key_t;
/**
@@ -2559,6 +2555,12 @@ alpm_filelist_t *alpm_pkg_get_files(alpm_pkg_t *pkg);
*/
alpm_list_t *alpm_pkg_get_backup(alpm_pkg_t *pkg);
/** Returns the list of alternatives provided by the package
* @param pkg a pointer to package
* @return a reference to a list of char* objects
*/
alpm_list_t *alpm_pkg_get_alternatives(alpm_pkg_t *pkg);
/** Returns the database containing pkg.
* Returns a pointer to the alpm_db_t structure the package is
* originating from, or NULL if the package was loaded from a file.
@@ -2719,7 +2721,8 @@ typedef enum _alpm_transflag_t {
ALPM_TRANS_FLAG_RECURSE = (1 << 5),
/** Modify database but do not commit changes to the filesystem. */
ALPM_TRANS_FLAG_DBONLY = (1 << 6),
/* (1 << 7) flag can go here */
/** Do not run hooks during a transaction */
ALPM_TRANS_FLAG_NOHOOKS = (1 << 7),
/** Use ALPM_PKG_REASON_DEPEND when installing packages. */
ALPM_TRANS_FLAG_ALLDEPS = (1 << 8),
/** Only download packages and do not actually install. */

View File

@@ -1,7 +1,7 @@
/*
* alpm_list.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* alpm_list.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -48,13 +48,13 @@ extern "C" {
*/
/** A doubly linked list */
typedef struct __alpm_list_t {
typedef struct _alpm_list_t {
/** data held by the list node */
void *data;
/** pointer to the previous node */
struct __alpm_list_t *prev;
struct _alpm_list_t *prev;
/** pointer to the next node */
struct __alpm_list_t *next;
struct _alpm_list_t *next;
} alpm_list_t;
/** Frees a list and its contents */

View File

@@ -1,7 +1,7 @@
/*
* backup.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2005 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>

View File

@@ -1,7 +1,7 @@
/*
* backup.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* be_local.c : backend for the local database
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -195,6 +195,12 @@ static alpm_list_t *_cache_get_backup(alpm_pkg_t *pkg)
return pkg->backup;
}
static alpm_list_t *_cache_get_alternatives(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_DESC);
return pkg->alternatives;
}
/**
* Open a package changelog for reading. Similar to fopen in functionality,
* except that the returned 'file stream' is from the database.
@@ -349,6 +355,7 @@ static const struct pkg_operations local_pkg_ops = {
.get_replaces = _cache_get_replaces,
.get_files = _cache_get_files,
.get_backup = _cache_get_backup,
.get_alternatives = _cache_get_alternatives,
.changelog_open = _cache_changelog_open,
.changelog_read = _cache_changelog_read,
@@ -804,6 +811,8 @@ static int local_db_read(alpm_pkg_t *info, int inforeq)
READ_AND_SPLITDEP(info->conflicts);
} else if(strcmp(line, "%PROVIDES%") == 0) {
READ_AND_SPLITDEP(info->provides);
} else if(strcmp(line, "%ALTERNATIVES%") == 0) {
READ_AND_STORE_ALL(info->alternatives);
}
}
fclose(fp);
@@ -1040,6 +1049,15 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, int inforeq)
write_deps(fp, "%CONFLICTS%", info->conflicts);
write_deps(fp, "%PROVIDES%", info->provides);
if(info->alternatives) {
fputs("%ALTERNATIVES%\n", fp);
for(lp = info->alternatives; lp; lp = lp->next) {
fputs(lp->data, fp);
fputc('\n', fp);
}
fputc('\n', fp);
}
fclose(fp);
fp = NULL;
}

View File

@@ -1,7 +1,7 @@
/*
* be_package.c : backend for packages
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -244,6 +244,8 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t *
CALLOC(backup, 1, sizeof(alpm_backup_t), return -1);
STRDUP(backup->name, ptr, FREE(backup); return -1);
newpkg->backup = alpm_list_add(newpkg->backup, backup);
} else if(strcmp(key, "alternative") == 0) {
newpkg->alternatives = alpm_list_add(newpkg->alternatives, strdup(ptr));
} else if(strcmp(key, "force") == 0) {
/* deprecated, skip it */
} else if(strcmp(key, "makepkgopt") == 0) {

View File

@@ -1,7 +1,7 @@
/*
* be_sync.c : backend for sync databases
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* conflict.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>

View File

@@ -1,7 +1,7 @@
/*
* conflict.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* db.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>

View File

@@ -1,7 +1,7 @@
/*
* db.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
@@ -62,7 +62,7 @@ struct db_operations {
};
/* Database */
struct __alpm_db_t {
struct _alpm_db_t {
alpm_handle_t *handle;
char *treename;
/* do not access directly, use _alpm_db_path(db) for lazy access */

View File

@@ -1,7 +1,7 @@
/*
* deps.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>

View File

@@ -1,7 +1,7 @@
/*
* deps.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>

View File

@@ -1,7 +1,7 @@
/*
* diskspace.c
*
* Copyright (c) 2010-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2010-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
* diskspace.h
*
* Copyright (c) 2010-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2010-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@ enum mount_fsinfo {
MOUNT_FSINFO_FAIL,
};
typedef struct __alpm_mountpoint_t {
typedef struct _alpm_mountpoint_t {
/* mount point information */
char *mount_dir;
size_t mount_dir_len;

View File

@@ -1,7 +1,7 @@
/*
* dload.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -427,6 +427,9 @@ static int curl_retry_next_server(CURLM *curlm, CURL *curl, struct dload_payload
len = strlen(server) + strlen(payload->filepath) + 2;
MALLOC(payload->fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(payload->fileurl, len, "%s/%s", server, payload->filepath);
_alpm_log(handle, ALPM_LOG_DEBUG,
"%s: retrying from %s\n",
payload->remote_name, payload->fileurl);
fflush(payload->localf);
@@ -490,8 +493,8 @@ static int curl_check_finished_download(CURLM *curlm, CURLMsg *msg,
curl_gethost(payload->fileurl, hostname, sizeof(hostname));
curlerr = msg->data.result;
_alpm_log(handle, ALPM_LOG_DEBUG, "%s: curl returned result %d from transfer\n",
payload->remote_name, curlerr);
_alpm_log(handle, ALPM_LOG_DEBUG, "%s: %s returned result %d from transfer\n",
payload->remote_name, "curl", curlerr);
/* was it a success? */
switch(curlerr) {

View File

@@ -1,7 +1,7 @@
/*
* dload.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* error.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* filelist.c
*
* Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
* filelist.h
*
* Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
* graph.c - helpful graph structure and setup/teardown methods
*
* Copyright (c) 2007-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2007-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
* graph.h - helpful graph structure and setup/teardown methods
*
* Copyright (c) 2007-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2007-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,19 +23,19 @@
#include "alpm_list.h"
enum __alpm_graph_vertex_state {
enum _alpm_graph_vertex_state {
ALPM_GRAPH_STATE_UNPROCESSED,
ALPM_GRAPH_STATE_PROCESSING,
ALPM_GRAPH_STATE_PROCESSED
};
typedef struct __alpm_graph_t {
typedef struct _alpm_graph_t {
void *data;
struct __alpm_graph_t *parent; /* where did we come from? */
struct _alpm_graph_t *parent; /* where did we come from? */
alpm_list_t *children;
alpm_list_t *iterator; /* used for DFS without recursion */
off_t weight; /* weight of the node */
enum __alpm_graph_vertex_state state;
enum _alpm_graph_vertex_state state;
} alpm_graph_t;
alpm_graph_t *_alpm_graph_new(void);

View File

@@ -1,7 +1,7 @@
/*
* group.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* group.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* handle.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>

View File

@@ -1,7 +1,7 @@
/*
* handle.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,7 @@
#include "alpm_list.h"
#include "alpm.h"
#include "trans.h"
#ifdef HAVE_LIBCURL
#include <curl/curl.h>
@@ -50,7 +51,7 @@ do { \
} \
} while(0)
struct __alpm_handle_t {
struct _alpm_handle_t {
/* internal usage */
alpm_db_t *db_local; /* local db pointer */
alpm_list_t *dbs_sync; /* List of (alpm_db_t *) */

View File

@@ -1,7 +1,7 @@
/*
* hook.c
*
* Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
* hook.h
*
* Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -4,7 +4,7 @@
/*
* libarchive-compat.h
*
* Copyright (c) 2013-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2013-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
* log.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* log.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* package.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005, 2006 by Christian Hamar <krics@linuxforum.hu>
@@ -98,6 +98,7 @@ static alpm_list_t *_pkg_get_provides(alpm_pkg_t *pkg) { return pkg->provides;
static alpm_list_t *_pkg_get_replaces(alpm_pkg_t *pkg) { return pkg->replaces; }
static alpm_filelist_t *_pkg_get_files(alpm_pkg_t *pkg) { return &(pkg->files); }
static alpm_list_t *_pkg_get_backup(alpm_pkg_t *pkg) { return pkg->backup; }
static alpm_list_t *_pkg_get_alternatives(alpm_pkg_t *pkg) { return pkg->alternatives; }
static void *_pkg_changelog_open(alpm_pkg_t UNUSED *pkg)
{
@@ -162,6 +163,7 @@ const struct pkg_operations default_pkg_ops = {
.get_replaces = _pkg_get_replaces,
.get_files = _pkg_get_files,
.get_backup = _pkg_get_backup,
.get_alternatives = _pkg_get_alternatives,
.changelog_open = _pkg_changelog_open,
.changelog_read = _pkg_changelog_read,
@@ -418,6 +420,13 @@ alpm_list_t SYMEXPORT *alpm_pkg_get_backup(alpm_pkg_t *pkg)
return pkg->ops->get_backup(pkg);
}
alpm_list_t SYMEXPORT *alpm_pkg_get_alternatives(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = ALPM_ERR_OK;
return pkg->ops->get_alternatives(pkg);
}
alpm_db_t SYMEXPORT *alpm_pkg_get_db(alpm_pkg_t *pkg)
{
/* Sanity checks */
@@ -632,6 +641,7 @@ int _alpm_pkg_dup(alpm_pkg_t *pkg, alpm_pkg_t **new_ptr)
newpkg->optdepends = list_depdup(pkg->optdepends);
newpkg->conflicts = list_depdup(pkg->conflicts);
newpkg->provides = list_depdup(pkg->provides);
newpkg->alternatives = alpm_list_strdup(pkg->alternatives);
if(pkg->files.count) {
size_t filenum;
@@ -709,6 +719,7 @@ void _alpm_pkg_free(alpm_pkg_t *pkg)
free_deplist(pkg->provides);
alpm_list_free(pkg->removes);
_alpm_pkg_free(pkg->oldpkg);
FREELIST(pkg->alternatives);
if(pkg->origin == ALPM_PKG_FROM_FILE) {
FREE(pkg->origin_data.file);

View File

@@ -1,7 +1,7 @@
/*
* package.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
@@ -66,6 +66,7 @@ struct pkg_operations {
alpm_list_t *(*get_replaces) (alpm_pkg_t *);
alpm_filelist_t *(*get_files) (alpm_pkg_t *);
alpm_list_t *(*get_backup) (alpm_pkg_t *);
alpm_list_t *(*get_alternatives) (alpm_pkg_t *);
void *(*changelog_open) (alpm_pkg_t *);
size_t (*changelog_read) (void *, size_t, const alpm_pkg_t *, void *);
@@ -85,7 +86,7 @@ struct pkg_operations {
*/
extern const struct pkg_operations default_pkg_ops;
struct __alpm_pkg_t {
struct _alpm_pkg_t {
unsigned long name_hash;
char *filename;
char *base;
@@ -120,6 +121,7 @@ struct __alpm_pkg_t {
alpm_list_t *provides;
alpm_list_t *removes; /* in transaction targets only */
alpm_pkg_t *oldpkg; /* in transaction targets only */
alpm_list_t *alternatives;
const struct pkg_operations *ops;

View File

@@ -1,7 +1,7 @@
/*
* pkghash.c
*
* Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
* pkghash.h
*
* Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
* A combination of a hash table and a list, allowing for fast look-up
* by package name but also iteration over the packages.
*/
struct __alpm_pkghash_t {
struct _alpm_pkghash_t {
/** data held by the hash table */
alpm_list_t **hash_table;
/** head node of the hash table data in normal list format */
@@ -45,7 +45,7 @@ struct __alpm_pkghash_t {
unsigned int limit;
};
typedef struct __alpm_pkghash_t alpm_pkghash_t;
typedef struct _alpm_pkghash_t alpm_pkghash_t;
alpm_pkghash_t *_alpm_pkghash_create(unsigned int size);

View File

@@ -1,7 +1,7 @@
/*
* remove.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@@ -332,7 +332,7 @@ static int can_remove_file(alpm_handle_t *handle, const alpm_file_t *file)
/* If we fail write permissions due to a read-only filesystem, abort.
* Assume all other possible failures are covered somewhere else */
if(_alpm_access(handle, NULL, filepath, W_OK) == -1) {
if(errno != EACCES && errno != ETXTBSY && access(filepath, F_OK) == 0) {
if(errno != EACCES && errno != ETXTBSY && _alpm_access(handle, NULL, filepath, F_OK) == 0) {
/* only return failure if the file ACTUALLY exists and we can't write to
* it - ignore "chmod -w" simple permission failures */
_alpm_log(handle, ALPM_LOG_ERROR, _("cannot remove file '%s': %s\n"),

View File

@@ -1,7 +1,7 @@
/*
* remove.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
/*
* signing.c
*
* Copyright (c) 2008-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2008-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -350,7 +350,7 @@ static int key_search_keyserver(alpm_handle_t *handle, const char *fpr,
pgpkey->data = key;
if(key->subkeys->fpr) {
pgpkey->fingerprint = key->subkeys->fpr;
} else if(key->subkeys->keyid) {
} else {
pgpkey->fingerprint = key->subkeys->keyid;
}
pgpkey->uid = key->uids->uid;
@@ -504,19 +504,15 @@ int _alpm_key_import(alpm_handle_t *handle, const char *uid, const char *fpr)
return -1;
}
STRDUP(fetch_key.uid, uid, return -1);
STRDUP(fetch_key.fingerprint, fpr, free(fetch_key.uid); return -1);
alpm_question_import_key_t question = {
.type = ALPM_QUESTION_IMPORT_KEY,
.import = 0,
.key = &fetch_key
.uid = uid,
.fingerprint = fpr
};
QUESTION(handle, &question);
free(fetch_key.uid);
free(fetch_key.fingerprint);
if(question.import) {
/* Try to import the key from a WKD first */
if(email_from_uid(uid, &email) == 0) {

View File

@@ -1,7 +1,7 @@
/*
* signing.h
*
* Copyright (c) 2008-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2008-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
* sync.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>

View File

@@ -1,7 +1,7 @@
/*
* sync.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>

View File

@@ -1,7 +1,7 @@
/*
* trans.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@@ -198,7 +198,8 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
}
}
if(_alpm_hook_run(handle, ALPM_HOOK_PRE_TRANSACTION) != 0) {
if(!(trans->flags & ALPM_TRANS_FLAG_NOHOOKS) &&
_alpm_hook_run(handle, ALPM_HOOK_PRE_TRANSACTION) != 0) {
RET_ERR(handle, ALPM_ERR_TRANS_HOOK_FAILED, -1);
}
@@ -232,7 +233,10 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
event.type = ALPM_EVENT_TRANSACTION_DONE;
EVENT(handle, (void *)&event);
alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction completed\n");
_alpm_hook_run(handle, ALPM_HOOK_POST_TRANSACTION);
if(!(trans->flags & ALPM_TRANS_FLAG_NOHOOKS)) {
_alpm_hook_run(handle, ALPM_HOOK_POST_TRANSACTION);
}
}
trans->state = STATE_COMMITED;

View File

@@ -1,7 +1,7 @@
/*
* trans.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@@ -36,7 +36,7 @@ typedef enum _alpm_transstate_t {
} alpm_transstate_t;
/* Transaction */
struct __alpm_trans_t {
typedef struct _alpm_trans_t {
/* bitfield of alpm_transflag_t flags */
int flags;
alpm_transstate_t state;
@@ -44,7 +44,7 @@ struct __alpm_trans_t {
alpm_list_t *add; /* list of (alpm_pkg_t *) */
alpm_list_t *remove; /* list of (alpm_pkg_t *) */
alpm_list_t *skip_remove; /* list of (char *) */
};
} alpm_trans_t;
void _alpm_trans_free(alpm_trans_t *trans);
/* flags is a bitfield of alpm_transflag_t flags */

View File

@@ -1,7 +1,7 @@
/*
* util.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>

View File

@@ -1,7 +1,7 @@
/*
* util.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
# buildenv.sh - functions for altering the build environment before
# compilation
#
# Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# buildflags.sh - Clear user-specified buildflags if requested
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -4,7 +4,7 @@
# ccache - Cache compilations and reuse them to save time on repetitions
# distcc - Distribute compilation of C and C++ across machines
#
# Copyright (c) 2007-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2007-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
# debugflags.sh - Specify flags for building a package with debugging
# symbols
#
# Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
# lto.sh - Specify flags for building a package with link-time
# optimisation
#
# Copyright (c) 2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# makeflags.sh - Clear user-specified makeflags if requested
#
# Copyright (c) 2007-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2007-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# executable.sh - confirm presence of dependent executables
#
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# ccache.sh - Confirm presence of ccache binary
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# checksum.sh - Confirm presence of binaries for checksum operations
#
# Copyright (c) 2016-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2016-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# distcc.sh - Confirm presence of distcc binary
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# fakeroot.sh - Confirm presence of fakeroot binary
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# gpg.sh - Confirm presence of gpg binary
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# gzip.sh - Confirm presence of gzip binary
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# pacman.sh - Confirm presence of pacman binary
#
# Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# strip.sh - Confirm presence of strip binary
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# sudo.sh - Confirm presence of sudo binary
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# vcs.sh - Confirm presence of binaries for VCS operations
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# integrity.sh - functions relating to source integrity checking
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# generate_checksum.sh - functions for generating source checksums
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# generate_signature.sh - functions for generating PGP signatures
#
# Copyright (c) 2008-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2008-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# verify_checksum.sh - functions for checking source checksums
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# verify_signature.sh - functions for checking PGP signatures
#
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2011-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# lint_config.sh - functions for checking for makepkg.conf errors
#
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# ext.sh - Check that source/package extensions have valid prefixes
#
# Copyright (c) 2019-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2019-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# paths.sh - Check that pathname components do not contain odd characters
#
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# source_date_epoch.sh - Check that reproducible builds timestamp is valid
#
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# variable.sh - Check that variables are or are not arrays as appropriate
#
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# lint_package.sh - functions for checking for packaging errors
#
# Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# build_references.sh - Warn about files containing references to build directories
#
# Copyright (c) 2013-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2013-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# dotfiles.sh - check for dotfiles in the package root
#
# Copyright (c) 2016-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2016-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# file_names.sh - check package file names
#
# Copyright (c) 2016-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2016-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# missing_backup.sh - Warn about missing files in the backup array
#
# Copyright (c) 2013-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2013-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# lint_pkgbuild.sh - functions for detecting PKGBUILD errors
#
# Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2015-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -0,0 +1,41 @@
#!/bin/bash
#
# alternative.sh - Check the files associated with the 'alternative'
# array exist.
#
# Copyright (c) 2020 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_ALTERNATIVE_SH" ]] && return
LIBMAKEPKG_LINT_PKGBUILD_ALTERNATIVE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/lint_pkgbuild/util.sh"
lint_pkgbuild_functions+=('lint_alternative')
lint_alternative() {
local ret=0
check_files_exist 'alternative' "${alternative[@]/%/.alternative}" || ret=1
return $ret
}

View File

@@ -2,7 +2,7 @@
#
# arch.sh - Check the 'arch' array conforms to requirements.
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# arch_specific.sh - Check that arch specific variables can be arch specific.
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# backup.sh - Check the 'backup' array conforms to requirements.
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# changelog.sh - Check the files in the 'changelog' array exist.
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# checkdepends.sh - Check the 'checkdepends' array conforms to requirements.
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# conflicts.sh - Check the 'conflicts' array conforms to requirements.
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# depends.sh - Check the 'depends' array conforms to requirements.
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# epoch.sh - Check the 'epoch' variable conforms to requirements.
#
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2014-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
#
# fullpkgver.sh - Check whether a full version conforms to requirements.
#
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@archlinux.org>
# Copyright (c) 2018-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

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