mirror of
https://gitlab.archlinux.org/pacman/pacman.git
synced 2025-11-05 01:44:48 +01:00
Compare commits
10 Commits
morganamil
...
allan/alte
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7175062526 | ||
|
|
7ceee8805b | ||
|
|
d21fb58da3 | ||
|
|
5352367022 | ||
|
|
5287cc7251 | ||
|
|
fed522775d | ||
|
|
b0a2fd75b2 | ||
|
|
806ccd90ed | ||
|
|
b242f5f24c | ||
|
|
529e208f39 |
@@ -27,7 +27,7 @@ arch:
|
|||||||
arch-debug:
|
arch-debug:
|
||||||
extends: .arch-test
|
extends: .arch-test
|
||||||
script:
|
script:
|
||||||
- meson --buildtype=debug build
|
- meson --buildtype=debug --werror build
|
||||||
- ninja -C build
|
- ninja -C build
|
||||||
- fakechroot meson test -C build
|
- fakechroot meson test -C build
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
given in the PKGBUILD. Nevertheless, the following ones can be overridden within
|
||||||
each split package's packaging function:
|
each split package's packaging function:
|
||||||
`pkgdesc`, `arch`, `url`, `license`, `groups`, `depends`, `optdepends`,
|
`pkgdesc`, `arch`, `url`, `license`, `groups`, `depends`, `optdepends`,
|
||||||
`provides`, `conflicts`, `replaces`, `backup`, `options`, `install`, and
|
`provides`, `conflicts`, `replaces`, `backup`, `options`, `install`,
|
||||||
`changelog`.
|
`changelog` and `alternative`.
|
||||||
|
|
||||||
Note that makepkg does not consider split package `depends` when checking
|
Note that makepkg does not consider split package `depends` when checking
|
||||||
if dependencies are installed before package building and with `--syncdeps`.
|
if dependencies are installed before package building and with `--syncdeps`.
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ link:translation-help.html[translation-help].
|
|||||||
Bugs
|
Bugs
|
||||||
----
|
----
|
||||||
If you find bugs (which is quite likely), please email them to the pacman-dev
|
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
|
such as your command-line, the nature of the bug, and even the package database
|
||||||
if it helps.
|
if it helps.
|
||||||
|
|
||||||
@@ -251,6 +251,6 @@ bugs under the Pacman project.
|
|||||||
Copyright
|
Copyright
|
||||||
---------
|
---------
|
||||||
pacman is Copyright (C) 2006-2021 Pacman Development Team
|
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,
|
<jvinet@zeroflux.org> and is licensed through the GNU General Public License,
|
||||||
version 2 or later.
|
version 2 or later.
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ Pre-release Updates
|
|||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
A week or two before each release, the codebase will go into a string freeze
|
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
|
mailing list asking for translations. This email will have a prefix of
|
||||||
*[translation]* for anyone looking to set up an email filter.
|
*[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
|
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
|
someone has experience with i18n man pages and how to best include them with our
|
||||||
source, please contact the pacman-dev mailing list at
|
source, please contact the pacman-dev mailing list at
|
||||||
mailto:pacman-dev@archlinux.org[].
|
mailto:pacman-dev@lists.archlinux.org[].
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
#
|
#
|
||||||
#-- The download utilities that makepkg should use to acquire sources
|
#-- The download utilities that makepkg should use to acquire sources
|
||||||
# Format: 'protocol::agent'
|
# Format: 'protocol::agent'
|
||||||
DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
|
DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
|
||||||
'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
|
'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
|
||||||
'http::/usr/bin/curl -gqb "" -fLC - --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 -gqb "" -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'
|
'rsync::/usr/bin/rsync --no-motd -z %u %o'
|
||||||
'scp::/usr/bin/scp -C %u %o')
|
'scp::/usr/bin/scp -C %u %o')
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* add.c
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* add.h
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* alpm.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* alpm.h
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
@@ -2555,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);
|
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 the database containing pkg.
|
||||||
* Returns a pointer to the alpm_db_t structure the package is
|
* Returns a pointer to the alpm_db_t structure the package is
|
||||||
* originating from, or NULL if the package was loaded from a file.
|
* originating from, or NULL if the package was loaded from a file.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* alpm_list.c
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* alpm_list.h
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* backup.c
|
* 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 Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* backup.h
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* be_local.c : backend for the local database
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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;
|
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,
|
* Open a package changelog for reading. Similar to fopen in functionality,
|
||||||
* except that the returned 'file stream' is from the database.
|
* 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_replaces = _cache_get_replaces,
|
||||||
.get_files = _cache_get_files,
|
.get_files = _cache_get_files,
|
||||||
.get_backup = _cache_get_backup,
|
.get_backup = _cache_get_backup,
|
||||||
|
.get_alternatives = _cache_get_alternatives,
|
||||||
|
|
||||||
.changelog_open = _cache_changelog_open,
|
.changelog_open = _cache_changelog_open,
|
||||||
.changelog_read = _cache_changelog_read,
|
.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);
|
READ_AND_SPLITDEP(info->conflicts);
|
||||||
} else if(strcmp(line, "%PROVIDES%") == 0) {
|
} else if(strcmp(line, "%PROVIDES%") == 0) {
|
||||||
READ_AND_SPLITDEP(info->provides);
|
READ_AND_SPLITDEP(info->provides);
|
||||||
|
} else if(strcmp(line, "%ALTERNATIVES%") == 0) {
|
||||||
|
READ_AND_STORE_ALL(info->alternatives);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(fp);
|
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, "%CONFLICTS%", info->conflicts);
|
||||||
write_deps(fp, "%PROVIDES%", info->provides);
|
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);
|
fclose(fp);
|
||||||
fp = NULL;
|
fp = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* be_package.c : backend for packages
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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);
|
CALLOC(backup, 1, sizeof(alpm_backup_t), return -1);
|
||||||
STRDUP(backup->name, ptr, FREE(backup); return -1);
|
STRDUP(backup->name, ptr, FREE(backup); return -1);
|
||||||
newpkg->backup = alpm_list_add(newpkg->backup, backup);
|
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) {
|
} else if(strcmp(key, "force") == 0) {
|
||||||
/* deprecated, skip it */
|
/* deprecated, skip it */
|
||||||
} else if(strcmp(key, "makepkgopt") == 0) {
|
} else if(strcmp(key, "makepkgopt") == 0) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* be_sync.c : backend for sync databases
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* conflict.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* conflict.h
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* db.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* db.h
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* deps.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* deps.h
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* diskspace.c
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* diskspace.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* dload.c
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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;
|
len = strlen(server) + strlen(payload->filepath) + 2;
|
||||||
MALLOC(payload->fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
|
MALLOC(payload->fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
|
||||||
snprintf(payload->fileurl, len, "%s/%s", server, payload->filepath);
|
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);
|
fflush(payload->localf);
|
||||||
@@ -490,8 +493,8 @@ static int curl_check_finished_download(CURLM *curlm, CURLMsg *msg,
|
|||||||
|
|
||||||
curl_gethost(payload->fileurl, hostname, sizeof(hostname));
|
curl_gethost(payload->fileurl, hostname, sizeof(hostname));
|
||||||
curlerr = msg->data.result;
|
curlerr = msg->data.result;
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "%s: curl returned result %d from transfer\n",
|
_alpm_log(handle, ALPM_LOG_DEBUG, "%s: %s returned result %d from transfer\n",
|
||||||
payload->remote_name, curlerr);
|
payload->remote_name, "curl", curlerr);
|
||||||
|
|
||||||
/* was it a success? */
|
/* was it a success? */
|
||||||
switch(curlerr) {
|
switch(curlerr) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* dload.h
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* error.c
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* filelist.c
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* filelist.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* graph.c - helpful graph structure and setup/teardown methods
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* graph.h - helpful graph structure and setup/teardown methods
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* group.c
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* group.h
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* handle.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* handle.h
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* hook.c
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* hook.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
/*
|
/*
|
||||||
* libarchive-compat.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* log.c
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* log.h
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* package.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005, 2006 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005, 2006 by Christian Hamar <krics@linuxforum.hu>
|
||||||
@@ -57,7 +57,7 @@ int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg)
|
|||||||
ASSERT(pkg->origin == ALPM_PKG_FROM_SYNCDB,
|
ASSERT(pkg->origin == ALPM_PKG_FROM_SYNCDB,
|
||||||
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
|
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
|
||||||
|
|
||||||
fpath = _alpm_cache_find_pkg(pkg, 0);
|
fpath = _alpm_filecache_find(pkg->handle, pkg->filename);
|
||||||
|
|
||||||
retval = _alpm_test_checksum(fpath, pkg->md5sum, ALPM_PKG_VALIDATION_MD5SUM);
|
retval = _alpm_test_checksum(fpath, pkg->md5sum, ALPM_PKG_VALIDATION_MD5SUM);
|
||||||
|
|
||||||
@@ -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_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_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_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)
|
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_replaces = _pkg_get_replaces,
|
||||||
.get_files = _pkg_get_files,
|
.get_files = _pkg_get_files,
|
||||||
.get_backup = _pkg_get_backup,
|
.get_backup = _pkg_get_backup,
|
||||||
|
.get_alternatives = _pkg_get_alternatives,
|
||||||
|
|
||||||
.changelog_open = _pkg_changelog_open,
|
.changelog_open = _pkg_changelog_open,
|
||||||
.changelog_read = _pkg_changelog_read,
|
.changelog_read = _pkg_changelog_read,
|
||||||
@@ -283,7 +285,7 @@ int SYMEXPORT alpm_pkg_get_sig(alpm_pkg_t *pkg, unsigned char **sig, size_t *sig
|
|||||||
alpm_errno_t err;
|
alpm_errno_t err;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
pkgpath = _alpm_cache_find_pkg(pkg, 0);
|
pkgpath = _alpm_filecache_find(pkg->handle, pkg->filename);
|
||||||
if(!pkgpath) {
|
if(!pkgpath) {
|
||||||
GOTO_ERR(pkg->handle, ALPM_ERR_PKG_NOT_FOUND, cleanup);
|
GOTO_ERR(pkg->handle, ALPM_ERR_PKG_NOT_FOUND, cleanup);
|
||||||
}
|
}
|
||||||
@@ -418,6 +420,13 @@ alpm_list_t SYMEXPORT *alpm_pkg_get_backup(alpm_pkg_t *pkg)
|
|||||||
return pkg->ops->get_backup(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)
|
alpm_db_t SYMEXPORT *alpm_pkg_get_db(alpm_pkg_t *pkg)
|
||||||
{
|
{
|
||||||
/* Sanity checks */
|
/* 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->optdepends = list_depdup(pkg->optdepends);
|
||||||
newpkg->conflicts = list_depdup(pkg->conflicts);
|
newpkg->conflicts = list_depdup(pkg->conflicts);
|
||||||
newpkg->provides = list_depdup(pkg->provides);
|
newpkg->provides = list_depdup(pkg->provides);
|
||||||
|
newpkg->alternatives = alpm_list_strdup(pkg->alternatives);
|
||||||
|
|
||||||
if(pkg->files.count) {
|
if(pkg->files.count) {
|
||||||
size_t filenum;
|
size_t filenum;
|
||||||
@@ -709,6 +719,7 @@ void _alpm_pkg_free(alpm_pkg_t *pkg)
|
|||||||
free_deplist(pkg->provides);
|
free_deplist(pkg->provides);
|
||||||
alpm_list_free(pkg->removes);
|
alpm_list_free(pkg->removes);
|
||||||
_alpm_pkg_free(pkg->oldpkg);
|
_alpm_pkg_free(pkg->oldpkg);
|
||||||
|
FREELIST(pkg->alternatives);
|
||||||
|
|
||||||
if(pkg->origin == ALPM_PKG_FROM_FILE) {
|
if(pkg->origin == ALPM_PKG_FROM_FILE) {
|
||||||
FREE(pkg->origin_data.file);
|
FREE(pkg->origin_data.file);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* package.h
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
* 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_list_t *(*get_replaces) (alpm_pkg_t *);
|
||||||
alpm_filelist_t *(*get_files) (alpm_pkg_t *);
|
alpm_filelist_t *(*get_files) (alpm_pkg_t *);
|
||||||
alpm_list_t *(*get_backup) (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 *);
|
void *(*changelog_open) (alpm_pkg_t *);
|
||||||
size_t (*changelog_read) (void *, size_t, const alpm_pkg_t *, void *);
|
size_t (*changelog_read) (void *, size_t, const alpm_pkg_t *, void *);
|
||||||
@@ -120,6 +121,7 @@ struct _alpm_pkg_t {
|
|||||||
alpm_list_t *provides;
|
alpm_list_t *provides;
|
||||||
alpm_list_t *removes; /* in transaction targets only */
|
alpm_list_t *removes; /* in transaction targets only */
|
||||||
alpm_pkg_t *oldpkg; /* in transaction targets only */
|
alpm_pkg_t *oldpkg; /* in transaction targets only */
|
||||||
|
alpm_list_t *alternatives;
|
||||||
|
|
||||||
const struct pkg_operations *ops;
|
const struct pkg_operations *ops;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* pkghash.c
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* pkghash.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* remove.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* 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.
|
/* If we fail write permissions due to a read-only filesystem, abort.
|
||||||
* Assume all other possible failures are covered somewhere else */
|
* Assume all other possible failures are covered somewhere else */
|
||||||
if(_alpm_access(handle, NULL, filepath, W_OK) == -1) {
|
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
|
/* only return failure if the file ACTUALLY exists and we can't write to
|
||||||
* it - ignore "chmod -w" simple permission failures */
|
* it - ignore "chmod -w" simple permission failures */
|
||||||
_alpm_log(handle, ALPM_LOG_ERROR, _("cannot remove file '%s': %s\n"),
|
_alpm_log(handle, ALPM_LOG_ERROR, _("cannot remove file '%s': %s\n"),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* remove.h
|
* 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>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* signing.c
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* signing.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* sync.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
@@ -323,7 +323,7 @@ static int compute_download_size(alpm_pkg_t *newpkg)
|
|||||||
|
|
||||||
ASSERT(newpkg->filename != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1));
|
ASSERT(newpkg->filename != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1));
|
||||||
fname = newpkg->filename;
|
fname = newpkg->filename;
|
||||||
fpath = _alpm_cache_find_pkg(newpkg, 0);
|
fpath = _alpm_filecache_find(handle, fname);
|
||||||
|
|
||||||
/* downloaded file exists, so there's nothing to grab */
|
/* downloaded file exists, so there's nothing to grab */
|
||||||
if(fpath) {
|
if(fpath) {
|
||||||
@@ -333,7 +333,7 @@ static int compute_download_size(alpm_pkg_t *newpkg)
|
|||||||
|
|
||||||
CALLOC(fnamepart, strlen(fname) + 6, sizeof(char), return -1);
|
CALLOC(fnamepart, strlen(fname) + 6, sizeof(char), return -1);
|
||||||
sprintf(fnamepart, "%s.part", fname);
|
sprintf(fnamepart, "%s.part", fname);
|
||||||
fpath = _alpm_cache_find_pkg(newpkg, 1);
|
fpath = _alpm_filecache_find(handle, fnamepart);
|
||||||
if(fpath) {
|
if(fpath) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if(stat(fpath, &st) == 0) {
|
if(stat(fpath, &st) == 0) {
|
||||||
@@ -737,13 +737,21 @@ static int find_dl_candidates(alpm_handle_t *handle, alpm_list_t **files)
|
|||||||
|
|
||||||
ASSERT(spkg->filename != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1));
|
ASSERT(spkg->filename != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1));
|
||||||
|
|
||||||
need_download = spkg->download_size != 0 || !_alpm_cache_pkg_exists(spkg, 0);
|
need_download = spkg->download_size != 0 || !_alpm_filecache_exists(handle, spkg->filename);
|
||||||
/* even if the package file in the cache we need to check for
|
/* even if the package file in the cache we need to check for
|
||||||
* accompanion *.sig file as well.
|
* accompanion *.sig file as well.
|
||||||
* If *.sig is not cached then force download the package + its signature file.
|
* If *.sig is not cached then force download the package + its signature file.
|
||||||
*/
|
*/
|
||||||
if(!need_download && (siglevel & ALPM_SIG_PACKAGE)) {
|
if(!need_download && (siglevel & ALPM_SIG_PACKAGE)) {
|
||||||
need_download = !_alpm_cache_pkg_exists(spkg, 1);
|
char *sig_filename = NULL;
|
||||||
|
int len = strlen(spkg->filename) + 5;
|
||||||
|
|
||||||
|
MALLOC(sig_filename, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
|
||||||
|
snprintf(sig_filename, len, "%s.sig", spkg->filename);
|
||||||
|
|
||||||
|
need_download = !_alpm_filecache_exists(handle, sig_filename);
|
||||||
|
|
||||||
|
FREE(sig_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(need_download) {
|
if(need_download) {
|
||||||
@@ -982,7 +990,7 @@ static int check_validity(alpm_handle_t *handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
current_bytes += v.pkg->size;
|
current_bytes += v.pkg->size;
|
||||||
v.path = _alpm_cache_find_pkg(v.pkg, 0);
|
v.path = _alpm_filecache_find(handle, v.pkg->filename);
|
||||||
v.siglevel = alpm_db_get_siglevel(alpm_pkg_get_db(v.pkg));
|
v.siglevel = alpm_db_get_siglevel(alpm_pkg_get_db(v.pkg));
|
||||||
|
|
||||||
if(_alpm_pkg_validate_internal(handle, v.path, v.pkg,
|
if(_alpm_pkg_validate_internal(handle, v.path, v.pkg,
|
||||||
@@ -1072,8 +1080,7 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
current_bytes += spkg->size;
|
current_bytes += spkg->size;
|
||||||
|
filepath = _alpm_filecache_find(handle, spkg->filename);
|
||||||
filepath = _alpm_cache_find_pkg(spkg, 0);
|
|
||||||
|
|
||||||
/* load the package file and replace pkgcache entry with it in the target list */
|
/* load the package file and replace pkgcache entry with it in the target list */
|
||||||
/* TODO: alpm_pkg_get_db() will not work on this target anymore */
|
/* TODO: alpm_pkg_get_db() will not work on this target anymore */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* sync.h
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* trans.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* trans.h
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* util.c
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
@@ -815,37 +815,6 @@ int _alpm_str_cmp(const void *s1, const void *s2)
|
|||||||
return strcmp(s1, s2);
|
return strcmp(s1, s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *_alpm_cache_find_pkg(alpm_pkg_t *pkg, int sig) {
|
|
||||||
alpm_handle_t *handle = pkg->handle;
|
|
||||||
struct stat buf;
|
|
||||||
alpm_list_t *servers = pkg->origin_data.db->servers;
|
|
||||||
char *retpath;
|
|
||||||
char filepath[PATH_MAX];
|
|
||||||
|
|
||||||
for(alpm_list_t *j = servers; j; j = j->next) {
|
|
||||||
char *server = j->data;
|
|
||||||
|
|
||||||
if(strncmp("file://", server, strlen("file://")) == 0) {
|
|
||||||
int len = strlen(server) - strlen("file://") + 1 + strlen(pkg->filename) + 1;
|
|
||||||
|
|
||||||
if(sig) {
|
|
||||||
len += strlen(".sig");
|
|
||||||
snprintf(filepath, len, "%s/%s", server + strlen("file://"), pkg->filename);
|
|
||||||
} else {
|
|
||||||
snprintf(filepath, len, "%s/%s.sig", server + strlen("file://"), pkg->filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(stat(filepath, &buf) == 0 && S_ISREG(buf.st_mode)) {
|
|
||||||
STRDUP(retpath, filepath, RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
|
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "found pkg in repo cache: %s\n", retpath);
|
|
||||||
return retpath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return _alpm_filecache_find(handle, pkg->filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Find a filename in a registered alpm cachedir.
|
/** Find a filename in a registered alpm cachedir.
|
||||||
* @param handle the context handle
|
* @param handle the context handle
|
||||||
* @param filename name of file to find
|
* @param filename name of file to find
|
||||||
@@ -877,10 +846,10 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename)
|
|||||||
* @param filename name of file to find
|
* @param filename name of file to find
|
||||||
* @return 0 if the filename was not found, 1 otherwise
|
* @return 0 if the filename was not found, 1 otherwise
|
||||||
*/
|
*/
|
||||||
int _alpm_cache_pkg_exists(alpm_pkg_t *pkg, int sig)
|
int _alpm_filecache_exists(alpm_handle_t *handle, const char *filename)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
char *fpath = _alpm_cache_find_pkg(pkg, sig);
|
char *fpath = _alpm_filecache_find(handle, filename);
|
||||||
res = (fpath != NULL);
|
res = (fpath != NULL);
|
||||||
FREE(fpath);
|
FREE(fpath);
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* util.h
|
* 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) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
@@ -133,10 +133,9 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
|
|||||||
_alpm_cb_io in_cb, void *in_ctx);
|
_alpm_cb_io in_cb, void *in_ctx);
|
||||||
int _alpm_ldconfig(alpm_handle_t *handle);
|
int _alpm_ldconfig(alpm_handle_t *handle);
|
||||||
int _alpm_str_cmp(const void *s1, const void *s2);
|
int _alpm_str_cmp(const void *s1, const void *s2);
|
||||||
char *_alpm_cache_find_pkg(alpm_pkg_t *pkg, int sig);
|
|
||||||
char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename);
|
char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename);
|
||||||
/* Checks whether a file exists in cache */
|
/* Checks whether a file exists in cache */
|
||||||
int _alpm_cache_pkg_exists(alpm_pkg_t *pkg, int sig);
|
int _alpm_filecache_exists(alpm_handle_t *handle, const char *filename);
|
||||||
const char *_alpm_filecache_setup(alpm_handle_t *handle);
|
const char *_alpm_filecache_setup(alpm_handle_t *handle);
|
||||||
/* Unlike many uses of alpm_pkgvalidation_t, _alpm_test_checksum expects
|
/* Unlike many uses of alpm_pkgvalidation_t, _alpm_test_checksum expects
|
||||||
* an enum value rather than a bitfield. */
|
* an enum value rather than a bitfield. */
|
||||||
|
|||||||
@@ -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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# buildenv.sh - functions for altering the build environment before
|
# buildenv.sh - functions for altering the build environment before
|
||||||
# compilation
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# buildflags.sh - Clear user-specified buildflags if requested
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# ccache - Cache compilations and reuse them to save time on repetitions
|
# ccache - Cache compilations and reuse them to save time on repetitions
|
||||||
# distcc - Distribute compilation of C and C++ across machines
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# debugflags.sh - Specify flags for building a package with debugging
|
# debugflags.sh - Specify flags for building a package with debugging
|
||||||
# symbols
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# lto.sh - Specify flags for building a package with link-time
|
# lto.sh - Specify flags for building a package with link-time
|
||||||
# optimisation
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# makeflags.sh - Clear user-specified makeflags if requested
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# executable.sh - confirm presence of dependent executables
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# ccache.sh - Confirm presence of ccache binary
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# checksum.sh - Confirm presence of binaries for checksum operations
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# distcc.sh - Confirm presence of distcc binary
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# fakeroot.sh - Confirm presence of fakeroot binary
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# gpg.sh - Confirm presence of gpg binary
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# gzip.sh - Confirm presence of gzip binary
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# pacman.sh - Confirm presence of pacman binary
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# strip.sh - Confirm presence of strip binary
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# sudo.sh - Confirm presence of sudo binary
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# vcs.sh - Confirm presence of binaries for VCS operations
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# integrity.sh - functions relating to source integrity checking
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# generate_checksum.sh - functions for generating source checksums
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# generate_signature.sh - functions for generating PGP signatures
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# verify_checksum.sh - functions for checking source checksums
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# verify_signature.sh - functions for checking PGP signatures
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# lint_config.sh - functions for checking for makepkg.conf errors
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# ext.sh - Check that source/package extensions have valid prefixes
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# paths.sh - Check that pathname components do not contain odd characters
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# source_date_epoch.sh - Check that reproducible builds timestamp is valid
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# variable.sh - Check that variables are or are not arrays as appropriate
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# lint_package.sh - functions for checking for packaging errors
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# build_references.sh - Warn about files containing references to build directories
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# dotfiles.sh - check for dotfiles in the package root
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# file_names.sh - check package file names
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# missing_backup.sh - Warn about missing files in the backup array
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# lint_pkgbuild.sh - functions for detecting PKGBUILD errors
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
41
scripts/libmakepkg/lint_pkgbuild/alternative.sh.in
Normal file
41
scripts/libmakepkg/lint_pkgbuild/alternative.sh.in
Normal 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
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# arch.sh - Check the 'arch' array conforms to requirements.
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# arch_specific.sh - Check that arch specific variables can be arch specific.
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# backup.sh - Check the 'backup' array conforms to requirements.
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# changelog.sh - Check the files in the 'changelog' array exist.
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# checkdepends.sh - Check the 'checkdepends' array conforms to requirements.
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# conflicts.sh - Check the 'conflicts' array conforms to requirements.
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# depends.sh - Check the 'depends' array conforms to requirements.
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# epoch.sh - Check the 'epoch' variable conforms to requirements.
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# fullpkgver.sh - Check whether a full version conforms to requirements.
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# install.sh - Check the files in the 'install' array exist.
|
# install.sh - Check the files in the 'install' 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
|
# 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
|
# 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
Reference in New Issue
Block a user