mirror of
				https://gitlab.archlinux.org/pacman/pacman.git
				synced 2025-11-04 01:14:41 +01:00 
			
		
		
		
	Compare commits
	
		
			65 Commits
		
	
	
		
			v7.0.0
			...
			morganamil
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					3612510ee0 | ||
| 
						 | 
					a1ff7d8c72 | ||
| 
						 | 
					f6aa79c10a | ||
| 
						 | 
					3370dd586a | ||
| 
						 | 
					af54cd4ee1 | ||
| 
						 | 
					e392f01a94 | ||
| 
						 | 
					f722b86990 | ||
| 
						 | 
					4ddc642398 | ||
| 
						 | 
					53b1db84ef | ||
| 
						 | 
					571c13236f | ||
| 
						 | 
					64299ccfbb | ||
| 
						 | 
					692f7a2cfe | ||
| 
						 | 
					b104b95423 | ||
| 
						 | 
					2bcdbc6a87 | ||
| 
						 | 
					46f7f6e9ac | ||
| 
						 | 
					38394d54f0 | ||
| 
						 | 
					267a0cc912 | ||
| 
						 | 
					d0c10a795e | ||
| 
						 | 
					0d37c1daa0 | ||
| 
						 | 
					24fc50269d | ||
| 
						 | 
					08070e9abe | ||
| 
						 | 
					f13d7d480c | ||
| 
						 | 
					007261ade5 | ||
| 
						 | 
					bbe3f614b2 | ||
| 
						 | 
					f07d547cf1 | ||
| 
						 | 
					34f09204fa | ||
| 
						 | 
					0f6b4f4fab | ||
| 
						 | 
					bc7b8e2eb2 | ||
| 
						 | 
					faea473550 | ||
| 
						 | 
					680169fb61 | ||
| 
						 | 
					e767cf9a54 | ||
| 
						 | 
					e65b7d421c | ||
| 
						 | 
					e6b3eb2570 | ||
| 
						 | 
					7ccf316ceb | ||
| 
						 | 
					ae603e35d7 | ||
| 
						 | 
					4908eed57d | ||
| 
						 | 
					286e776eda | ||
| 
						 | 
					cc87999d6d | ||
| 
						 | 
					425ff046ed | ||
| 
						 | 
					5f4c7e3ddc | ||
| 
						 | 
					02b35b9155 | ||
| 
						 | 
					dbde37aafb | ||
| 
						 | 
					0c136ecc8a | ||
| 
						 | 
					5e2a763e4a | ||
| 
						 | 
					62d3192126 | ||
| 
						 | 
					3e557af72f | ||
| 
						 | 
					fa7a9f748d | ||
| 
						 | 
					870eae26dc | ||
| 
						 | 
					cb940620bc | ||
| 
						 | 
					dd55afad68 | ||
| 
						 | 
					775db50538 | ||
| 
						 | 
					95a7d416ce | ||
| 
						 | 
					9154600490 | ||
| 
						 | 
					e0162a6868 | ||
| 
						 | 
					71afd4d88f | ||
| 
						 | 
					a2d029388c | ||
| 
						 | 
					8a60361949 | ||
| 
						 | 
					e80569f5da | ||
| 
						 | 
					60ec268458 | ||
| 
						 | 
					7bc5d55b56 | ||
| 
						 | 
					6ba5c20e76 | ||
| 
						 | 
					4c18204938 | ||
| 
						 | 
					cf473bcfbd | ||
| 
						 | 
					f142df92c7 | ||
| 
						 | 
					c3aa1bc123 | 
							
								
								
									
										2
									
								
								.mailmap
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								.mailmap
									
									
									
									
									
								
							@@ -12,7 +12,7 @@ Daenyth Blank <Daenyth+arch@gmail.com> <Daenyth+git@gmail.com>
 | 
			
		||||
Dave Reisner <dreisner@archlinux.org> <d@falconindy.com>
 | 
			
		||||
甘露(Gan Lu) <rhythm.gan@gmail.com>
 | 
			
		||||
Giovanni Scafora <giovanni@archlinux.org> <linuxmania@gmail.com>
 | 
			
		||||
Jan Steffens <jan.steffens@gmail.com>
 | 
			
		||||
Jan Alexander Steffens (heftig) <heftig@archlinux.org> <jan.steffens@gmail.com>
 | 
			
		||||
Jaroslaw Swierczynski <swiergot@gmail.com> <swiergot@juvepoland.com>
 | 
			
		||||
Jonathan Conder <j@skurvy.no-ip.org> <jonno.conder@gmail.com>
 | 
			
		||||
Juan Pablo González Tognarelli <lord_jotape@yahoo.com.ar>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								NEWS
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
			
		||||
VERSION         DESCRIPTION
 | 
			
		||||
-----------------------------------------------------------------------------
 | 
			
		||||
7.0.0         - Add DownloadUser configuation option used to drop-privileges
 | 
			
		||||
7.0.0         - Add DownloadUser configuration option used to drop-privileges
 | 
			
		||||
                when downloading files.
 | 
			
		||||
              - Download files to a temporary directory owned by DownloadUser
 | 
			
		||||
              - On Linux systems, ensure the download process does not write
 | 
			
		||||
@@ -649,7 +649,7 @@ VERSION         DESCRIPTION
 | 
			
		||||
                file overwrites from malicious databases
 | 
			
		||||
              - makepkg:
 | 
			
		||||
                - restrict package name from starting with a dot
 | 
			
		||||
                - fix BZR source revision support (FS#35281)
 | 
			
		||||
                - fix Bazaar source revision support (FS#35281)
 | 
			
		||||
                - Use LOGDEST for log pipe
 | 
			
		||||
                - fix distcc disabling (FS#35741)
 | 
			
		||||
                - correct stat usage on BSD/Darwin (FS#35469)
 | 
			
		||||
@@ -665,7 +665,7 @@ VERSION         DESCRIPTION
 | 
			
		||||
                FS#34716, FS#35097)
 | 
			
		||||
              - makepkg:
 | 
			
		||||
                - improve SVN VCS PKGBUILD handling (FS#34675, FS#34636)
 | 
			
		||||
                - allow "lp:" URLs for BZR sources (FS#34650)
 | 
			
		||||
                - allow "lp:" URLs for Bazaar sources (FS#34650)
 | 
			
		||||
                - prevent pkgver() capturing stderr (FS#34974)
 | 
			
		||||
                - fix attempt to remove package twice on failure (FS#34672)
 | 
			
		||||
              - contrib:
 | 
			
		||||
@@ -1338,7 +1338,7 @@ VERSION         DESCRIPTION
 | 
			
		||||
                - add source package creation option
 | 
			
		||||
              - rankmirrors- allow reading from stdin (FS#8043)
 | 
			
		||||
              - and many other updates: 198 bugs/FRs closed since 3.0.0 release
 | 
			
		||||
              - switch to GIT for source code management
 | 
			
		||||
              - switch to Git for source code management
 | 
			
		||||
3.0.6         - config files updated to reflect current -> core change
 | 
			
		||||
              - fix symlink overwriting issue (FS#7484)
 | 
			
		||||
              - fix config parsing with tr_TR locale (FS#7235)
 | 
			
		||||
@@ -1490,7 +1490,7 @@ VERSION         DESCRIPTION
 | 
			
		||||
                - Cleanup db_loadpkgs(), add list_add_sorted()
 | 
			
		||||
              - Fixed a memory leak in db_find_conflicts()
 | 
			
		||||
2.8.3         - Fixed a little makepkg bug with bash 3.0
 | 
			
		||||
              - Fixed resolvedeps to always prefer literals over provisios
 | 
			
		||||
              - Fixed resolvedeps to always prefer literals over providers
 | 
			
		||||
              - Added --config option to specify an alternate config file
 | 
			
		||||
              - Added "Include" directive to include repositories from
 | 
			
		||||
                config files (inspired by Michael Baehr's patch)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								README
									
									
									
									
									
								
							@@ -352,7 +352,7 @@ API CHANGES BETWEEN 3.4 AND 3.5
 | 
			
		||||
     - alpm_db_get_pkg() for normal targets
 | 
			
		||||
     - alpm_find_dbs_satisfier() for versioned provisions
 | 
			
		||||
     - alpm_find_grp_pkgs() for groups
 | 
			
		||||
- alpm_deptest() is replaced by the more flexibile alpm_find_satisfier()
 | 
			
		||||
- alpm_deptest() is replaced by the more flexible alpm_find_satisfier()
 | 
			
		||||
- size_t used for alpm_list_t sizes
 | 
			
		||||
  - return type for alpm_list_count()
 | 
			
		||||
  - parameter type in alpm_list_msort() and alpm_list_nth()
 | 
			
		||||
@@ -724,6 +724,7 @@ API CHANGES BETWEEN 6.0 AND 6.1
 | 
			
		||||
 - alpm_db_set_cache_servers()
 | 
			
		||||
 - alpm_db_add_cache_server()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API CHANGES BETWEEN 6.1 AND 7.0
 | 
			
		||||
===============================
 | 
			
		||||
 | 
			
		||||
@@ -733,3 +734,11 @@ API CHANGES BETWEEN 6.1 AND 7.0
 | 
			
		||||
 - alpm_option_set_sandboxuser()
 | 
			
		||||
 - alpm_option_set_disable_sandbox()
 | 
			
		||||
 - alpm_sandbox_setup_child()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API CHANGES BETWEEN 7.0 AND 7.1
 | 
			
		||||
===============================
 | 
			
		||||
 | 
			
		||||
[CHANGED]
 | 
			
		||||
- error codes:
 | 
			
		||||
    PM_ERR_TRANS_COMMITING renamed to PM_ERR_TRANS_COMMITTING
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ currently. Our translations are currently maintained in Transifex; please read
 | 
			
		||||
doc/translation-help.txt for more details.
 | 
			
		||||
 | 
			
		||||
Below is a list of past translators before we switched to Transifex; more can
 | 
			
		||||
be found by looking in the GIT history.
 | 
			
		||||
be found by looking in the Git history.
 | 
			
		||||
 | 
			
		||||
If your language is not already in the various po/ subdirectories and you wish
 | 
			
		||||
it was, set up a team in Transifex for your language and we will be happy to
 | 
			
		||||
 
 | 
			
		||||
@@ -11,8 +11,8 @@ Synopsis
 | 
			
		||||
This manual page describes the format of a BUILDINFO file found in the root of
 | 
			
		||||
a package created by makepkg. The file contains a description of the package's
 | 
			
		||||
build environment. The information is formatted in key-value pairs separated by
 | 
			
		||||
a '=', one value per line. Arrays are represented multiple keys with the same
 | 
			
		||||
value.
 | 
			
		||||
a '=', one value per line. Arrays are represented as multiple key-value pairs
 | 
			
		||||
having the same key.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Description
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
## linkman: macro
 | 
			
		||||
# Inspired by/borrowed from the GIT source tree at Documentation/asciidoc.conf
 | 
			
		||||
# Inspired by/borrowed from the Git source tree at Documentation/asciidoc.conf
 | 
			
		||||
#
 | 
			
		||||
# Usage: linkman:command[manpage-section]
 | 
			
		||||
#
 | 
			
		||||
 
 | 
			
		||||
@@ -252,7 +252,7 @@ the package database if it helps.
 | 
			
		||||
 | 
			
		||||
Copyright
 | 
			
		||||
---------
 | 
			
		||||
pacman is Copyright (C) 2006-2024 Pacman Development Team
 | 
			
		||||
pacman is Copyright (C) 2006-2025 Pacman Development Team
 | 
			
		||||
<pacman-dev@lists.archlinux.org> and Copyright (C) 2002-2006 Judd Vinet
 | 
			
		||||
<jvinet@zeroflux.org> and is licensed through the GNU General Public License,
 | 
			
		||||
version 2 or later.
 | 
			
		||||
 
 | 
			
		||||
@@ -247,6 +247,11 @@ Environment Variables
 | 
			
		||||
	Use an alternate config file instead of the +{sysconfdir}/makepkg.conf+
 | 
			
		||||
	default.
 | 
			
		||||
 | 
			
		||||
**MAKEPKG_GIT_CONFIG=**"/path/to/file"::
 | 
			
		||||
	Use an alternate config file for Git instead of the
 | 
			
		||||
	+{sysconfdir}/makepkg.d/gitconfig+ default. makepkg always prevents Git
 | 
			
		||||
	from loading any other config files.
 | 
			
		||||
 | 
			
		||||
**PKGDEST=**"/path/to/directory"::
 | 
			
		||||
	Directory where the resulting packages will be stored. Overrides the
 | 
			
		||||
	corresponding value defined in linkman:makepkg.conf[5].
 | 
			
		||||
@@ -297,7 +302,7 @@ Environment Variables
 | 
			
		||||
**BUILDTOOLVER=**"<version>"::
 | 
			
		||||
	The version of the '$BUILDTOOL' used.
 | 
			
		||||
 | 
			
		||||
**MAKEPKG_LINT_PKGBUILD=**0
 | 
			
		||||
**MAKEPKG_LINT_PKGBUILD=**0::
 | 
			
		||||
	Setting to 0 disables PKGBUILD linting within makepkg. Useful on systems
 | 
			
		||||
	with slow bash subshell operations, or on PKGBUILDs with extreme amounts of
 | 
			
		||||
	package splitting.
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,11 @@ Options
 | 
			
		||||
	A string such as ``i686-pc-linux-gnu''; do not touch this unless you know what
 | 
			
		||||
	you are doing. This can be commented out by most users if desired.
 | 
			
		||||
 | 
			
		||||
**NPROC=**""::
 | 
			
		||||
	Sets the number of processors to use for parallel jobs in makepkg.
 | 
			
		||||
	Note: this does not affect parallelization of tasks during ``build()`` and
 | 
			
		||||
	related functions.
 | 
			
		||||
 | 
			
		||||
**CPPFLAGS=**"cppflags"::
 | 
			
		||||
	Flags used for the C preprocessor; see CFLAGS for more information.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -151,7 +151,8 @@ Options
 | 
			
		||||
	+{localstatedir}/cache/pacman/pkg+). Multiple cache directories can be
 | 
			
		||||
	specified, and they are tried in the order they are passed to pacman.
 | 
			
		||||
	*NOTE*: This is an absolute path, and the root path is not automatically
 | 
			
		||||
	prepended.
 | 
			
		||||
	prepended. If DownloadUser is set in linkman:pacman.conf[5], then the
 | 
			
		||||
	specified user must have permission to access the cache directory.
 | 
			
		||||
 | 
			
		||||
*\--color* <when>::
 | 
			
		||||
	Specify when to enable coloring. Valid options are 'always', 'never', or
 | 
			
		||||
 
 | 
			
		||||
@@ -235,7 +235,7 @@ contain a file that lists the servers for that repository.
 | 
			
		||||
# use this server first
 | 
			
		||||
Server = ftp://ftp.archlinux.org/$repo/os/$arch
 | 
			
		||||
# next use servers as defined in the mirrorlist below
 | 
			
		||||
Include = {sysconfdir}/pacman.d/mirrorlist
 | 
			
		||||
Include = /etc/pacman.d/mirrorlist
 | 
			
		||||
--------
 | 
			
		||||
 | 
			
		||||
The order of repositories in the configuration files matters; repositories
 | 
			
		||||
 
 | 
			
		||||
@@ -29,9 +29,10 @@ specified on the command line. Multiple packages to remove can be specified
 | 
			
		||||
on the command line.
 | 
			
		||||
 | 
			
		||||
A package database is a tar file, optionally compressed. Valid extensions are
 | 
			
		||||
``.db'' followed by an archive extension of ``.tar'', ``.tar.gz'', ``.tar.bz2'',
 | 
			
		||||
``.tar.xz'', or ``.tar.Z''. The file does not need to exist, but all parent
 | 
			
		||||
directories must exist.
 | 
			
		||||
``.db'' followed by an archive extension of ``.tar'', ``.tar.bz2'',
 | 
			
		||||
``.tar.gz'', ``.tar.lrz'', ``.tar.lz'', ``.tar.lz4'', ``.tar.lzo'',
 | 
			
		||||
``.tar.xz'', ``.tar.zst'' or ``.tar.Z''. The file does not need to exist, but
 | 
			
		||||
all parent directories must exist.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Common Options
 | 
			
		||||
@@ -59,6 +60,14 @@ Common Options
 | 
			
		||||
*\--nocolor*::
 | 
			
		||||
	Remove color from 'repo-add' and 'repo-remove' output.
 | 
			
		||||
 | 
			
		||||
*-R, \--remove*::
 | 
			
		||||
	Remove old package files from the disk when updating or removing their
 | 
			
		||||
	entry in the database.
 | 
			
		||||
 | 
			
		||||
*-w, \--wait-for-lock*::
 | 
			
		||||
	Wait for the lock file to be acquired. If unset, command will fail with
 | 
			
		||||
	exit code 2 if acquiring the lock fails. If set, it will retry to acquire
 | 
			
		||||
	lock until success.
 | 
			
		||||
 | 
			
		||||
repo-add Options
 | 
			
		||||
----------------
 | 
			
		||||
@@ -66,10 +75,6 @@ repo-add Options
 | 
			
		||||
	Only add packages that are not already in the database.  Warnings will be
 | 
			
		||||
	printed upon detection of existing packages, but they will not be re-added.
 | 
			
		||||
 | 
			
		||||
*-R, \--remove*::
 | 
			
		||||
	Remove old package files from the disk when updating their entry in the
 | 
			
		||||
	database.
 | 
			
		||||
 | 
			
		||||
*\--include-sigs*::
 | 
			
		||||
	Include package PGP signatures in the repository database (if available)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -11,9 +11,9 @@ NOTE: Some of this is paraphrased from the kernel documentation's
 | 
			
		||||
 | 
			
		||||
Getting the most recent source
 | 
			
		||||
------------------------------
 | 
			
		||||
Patches need to be submitted in GIT format and are best if they are against the
 | 
			
		||||
Patches need to be submitted in Git format and are best if they are against the
 | 
			
		||||
latest version of the code. There are several helpful tutorials for getting
 | 
			
		||||
started with GIT if you have not worked with it before.
 | 
			
		||||
started with Git if you have not worked with it before.
 | 
			
		||||
 | 
			
		||||
* https://www.kernel.org/pub/software/scm/git/docs/gittutorial.html
 | 
			
		||||
* https://wiki.archlinux.org/index.php/Super_Quick_Git_Guide
 | 
			
		||||
 
 | 
			
		||||
@@ -4,10 +4,10 @@ Pacman - Translating
 | 
			
		||||
This document is here to guide you in helping translate pacman messages,
 | 
			
		||||
libalpm messages, and the manual pages for the entire pacman package.
 | 
			
		||||
 | 
			
		||||
We are currently using https://www.transifex.com/[Transifex] as the translation
 | 
			
		||||
We are currently using https://app.transifex.com/[Transifex] as the translation
 | 
			
		||||
platform for pacman and libalpm. You will need to sign up for an account there
 | 
			
		||||
and then register with a translation team on the
 | 
			
		||||
https://www.transifex.com/projects/p/archlinux-pacman/[pacman project page].
 | 
			
		||||
https://explore.transifex.com/toofishes/archlinux-pacman/[pacman project page].
 | 
			
		||||
 | 
			
		||||
NOTE: This may be old information due to our switch to Transifex, but the
 | 
			
		||||
gettext website is a very useful guide to read before embarking on translation
 | 
			
		||||
@@ -31,7 +31,7 @@ either be hand-edited, or modified with a tool such as poedit, gtranslator or
 | 
			
		||||
kbabel. Using a translation tool tends to make the job easier.
 | 
			
		||||
 | 
			
		||||
Please read up on Transifex usage using the
 | 
			
		||||
https://docs.transifex.com/[Transifex Help] if you are not familiar.
 | 
			
		||||
https://help.transifex.com/[Transifex Help] if you are not familiar.
 | 
			
		||||
 | 
			
		||||
Transifex provides a command-line client to help with translations.  Here is
 | 
			
		||||
an example set of commands if you have a source code checkout and are not
 | 
			
		||||
@@ -56,19 +56,19 @@ Pre-release Updates
 | 
			
		||||
 | 
			
		||||
A week or two before each release, the codebase will go into a string freeze
 | 
			
		||||
and an email will be sent to the mailto:pacman-dev@lists.archlinux.org[pacman-dev]
 | 
			
		||||
mailing list asking for translations. This email will have a prefix of
 | 
			
		||||
*[translation]* for anyone looking to set up an email filter.
 | 
			
		||||
mailing list asking for translations. An announcement in Transifex is also made,
 | 
			
		||||
which reaches everyone that is member of the translation team.
 | 
			
		||||
 | 
			
		||||
At this time, the latest `.po` language files will be made available at the
 | 
			
		||||
Transifex project page.  Each language will have two files available (back-end
 | 
			
		||||
and front-end). Translators interested in helping are encouraged to use the
 | 
			
		||||
Transifex project page.  Each language will have three files available (libalpm,
 | 
			
		||||
pacman and pacman-scripts). Translators interested in helping are encouraged to use the
 | 
			
		||||
features of Transifex to let others know they are currently translating their
 | 
			
		||||
language.
 | 
			
		||||
 | 
			
		||||
Once a translator has completed the translation (*OR* realizes they do not have
 | 
			
		||||
Once a translator has completed the translation offline (*OR* realizes they do not have
 | 
			
		||||
time to finish), please upload your progress back to the Transifex site.
 | 
			
		||||
 | 
			
		||||
NOTE: Please upload your translations as soon as possible- this will give other
 | 
			
		||||
NOTE: Please upload your translations as soon as possible - this will give other
 | 
			
		||||
speakers of your language time to review your translations and update them as
 | 
			
		||||
necessary.
 | 
			
		||||
 | 
			
		||||
@@ -80,21 +80,25 @@ repository.
 | 
			
		||||
 | 
			
		||||
	git clone https://gitlab.archlinux.org/pacman/pacman.git
 | 
			
		||||
 | 
			
		||||
Next, you will need to run `./autogen.sh` and `./configure` in the base
 | 
			
		||||
directory to generate the correct Makefiles. At this point, all necessary
 | 
			
		||||
make targets will be generated and we can begin updating the translation
 | 
			
		||||
files.
 | 
			
		||||
Next, you will need to configure the build environment. From the base directory,
 | 
			
		||||
run:
 | 
			
		||||
 | 
			
		||||
We need to first update the main message catalog file. Navigate into either the
 | 
			
		||||
`lib/libalpm/po` or `po` directory depending on which translation you wish to
 | 
			
		||||
work on first, and execute the following command.  If you are working in the
 | 
			
		||||
`po/` tree, replace 'libalpm.pot' with 'pacman.pot':
 | 
			
		||||
	meson setup . build
 | 
			
		||||
 | 
			
		||||
	make libalpm.pot-update
 | 
			
		||||
If any required dependencies are missing, please install. After that,
 | 
			
		||||
update the template translation (.pot) files to the latest state of
 | 
			
		||||
the source code by running:
 | 
			
		||||
	
 | 
			
		||||
	meson compile -C build pacman-scripts-pot pacman-pot libalpm-pot
 | 
			
		||||
	
 | 
			
		||||
We need to first update the main message catalog file. Navigate into either
 | 
			
		||||
the `lib/libalpm/po`, `scripts/po` or `src/pacman/po` directory depending
 | 
			
		||||
on which translation you wish to work on first, and execute the following
 | 
			
		||||
command to update your specific language's translation file
 | 
			
		||||
(replace `lang_code` with your language code e.g. 'pt_BR', and `pot_file`
 | 
			
		||||
with `libalpm.pot`, `pacman.pot` or `pacman-scripts.pot`):
 | 
			
		||||
 | 
			
		||||
Next, update your specific language's translation file:
 | 
			
		||||
 | 
			
		||||
	make <po file>-update
 | 
			
		||||
	msgmerge --update --previous <lang_code>.po  <pot_filename>.pot
 | 
			
		||||
 | 
			
		||||
At this point, you can do the translation. To submit your changes, either email
 | 
			
		||||
the new `.po` file to the mailing-list with *[translation]* in the subject, or
 | 
			
		||||
@@ -103,7 +107,7 @@ submit a Git-formatted patch (please do not include any `.pot` file changes).
 | 
			
		||||
As a shortcut, all translation files (including `.pot` files) can be updated
 | 
			
		||||
with the following command:
 | 
			
		||||
 | 
			
		||||
	make update-po
 | 
			
		||||
	./build-aux/update-po
 | 
			
		||||
 | 
			
		||||
Adding a New Language
 | 
			
		||||
~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
@@ -112,10 +116,10 @@ Making a new language is not too hard, but be sure to follow all the steps.
 | 
			
		||||
You will have to do the following steps in both the `lib/libalpm/po/` and `po/`
 | 
			
		||||
directories, substituting where appropriate. First, edit the `LINGUAS` file and
 | 
			
		||||
add your new language code at the bottom. Next, run the following command,
 | 
			
		||||
substituting 'libalpm.pot' or 'pacman.pot' for potfile depending on which
 | 
			
		||||
substituting `libalpm.pot` or `pacman.pot` for potfile depending on which
 | 
			
		||||
directory you are currently working in:
 | 
			
		||||
 | 
			
		||||
	msginit -l <lang code> -o <lang code>.po -i <potfile>
 | 
			
		||||
	msginit -l <lang_code> -o <lang_code>.po -i <potfile>
 | 
			
		||||
 | 
			
		||||
You can then also add your language code to the end of the `LINGUAS` file
 | 
			
		||||
located in each po directory.
 | 
			
		||||
@@ -137,11 +141,13 @@ following two translations are equivalent:
 | 
			
		||||
	msgstr ""
 | 
			
		||||
	"This is a test translation"
 | 
			
		||||
 | 
			
		||||
If you want to test the translation (for example, the front-end one):
 | 
			
		||||
If you want to test the translation (copy the .po file you want to test,
 | 
			
		||||
you may ignore the rest), replacing `<lang_code>` accordingly:
 | 
			
		||||
 | 
			
		||||
	rm *.gmo stamp-po
 | 
			
		||||
	make
 | 
			
		||||
	cp <lang code>.gmo /usr/share/locale/<lang code>/LC_MESSAGES/pacman.mo
 | 
			
		||||
	meson compile -C build pacman-scripts-gmo pacman-gmo libalpm-gmo
 | 
			
		||||
	cp ./build/lib/libalpm/po/<lang_code>/LC_MESSAGES/libalpm.mo    /usr/share/locale/<lang_code>/LC_MESSAGES/libalpm.mo
 | 
			
		||||
	cp ./build/scripts/po/<lang_code>/LC_MESSAGES/pacman-scripts.mo /usr/share/locale/<lang_code>/LC_MESSAGES/pacman-scripts.mo
 | 
			
		||||
	cp ./build/src/pacman/po/<lang_code>/LC_MESSAGES/pacman.mo      /usr/share/locale/<lang_code>/LC_MESSAGES/pacman.mo
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Translating Manpages
 | 
			
		||||
 
 | 
			
		||||
@@ -36,6 +36,8 @@ VCSCLIENTS=('bzr::breezy'
 | 
			
		||||
CARCH="@CARCH@"
 | 
			
		||||
CHOST="@CHOST@"
 | 
			
		||||
 | 
			
		||||
#NPROC=2
 | 
			
		||||
 | 
			
		||||
#-- Compiler and Linker Flags
 | 
			
		||||
#CPPFLAGS=""
 | 
			
		||||
#CFLAGS="-O2 -pipe"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  add.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  add.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  alpm.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
@@ -25,6 +25,9 @@
 | 
			
		||||
#include <curl/curl.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <pwd.h>
 | 
			
		||||
 | 
			
		||||
/* libalpm */
 | 
			
		||||
#include "alpm.h"
 | 
			
		||||
#include "alpm_list.h"
 | 
			
		||||
@@ -39,6 +42,7 @@ alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath,
 | 
			
		||||
	const char *lf = "db.lck";
 | 
			
		||||
	char *hookdir;
 | 
			
		||||
	size_t hookdirlen, lockfilelen;
 | 
			
		||||
	struct passwd const *pw = NULL;
 | 
			
		||||
	alpm_handle_t *myhandle = _alpm_handle_new();
 | 
			
		||||
 | 
			
		||||
	if(myhandle == NULL) {
 | 
			
		||||
@@ -78,6 +82,10 @@ alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath,
 | 
			
		||||
 | 
			
		||||
	myhandle->parallel_downloads = 1;
 | 
			
		||||
 | 
			
		||||
	/* set default sandboxuser */
 | 
			
		||||
	ASSERT((pw = getpwuid(0)) != NULL, myerr = errno; goto cleanup);
 | 
			
		||||
	STRDUP(myhandle->sandboxuser, pw->pw_name, goto nomem);
 | 
			
		||||
	
 | 
			
		||||
#ifdef ENABLE_NLS
 | 
			
		||||
	bindtextdomain("libalpm", LOCALEDIR);
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * alpm.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
@@ -34,6 +34,7 @@
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdbool.h>   /* bool */
 | 
			
		||||
#include <stdint.h>    /* int64_t */
 | 
			
		||||
#include <sys/types.h> /* off_t */
 | 
			
		||||
#include <stdarg.h>    /* va_list */
 | 
			
		||||
@@ -307,6 +308,8 @@ typedef enum _alpm_errno_t {
 | 
			
		||||
	/** Files conflict */
 | 
			
		||||
	ALPM_ERR_FILE_CONFLICTS,
 | 
			
		||||
	/* Misc */
 | 
			
		||||
	/** Download setup failed */
 | 
			
		||||
	ALPM_ERR_RETRIEVE_PREPARE,
 | 
			
		||||
	/** Download failed */
 | 
			
		||||
	ALPM_ERR_RETRIEVE,
 | 
			
		||||
	/** Invalid Regex */
 | 
			
		||||
@@ -450,14 +453,6 @@ typedef struct _alpm_pgpkey_t {
 | 
			
		||||
	unsigned int length;
 | 
			
		||||
	/** has the key been revoked */
 | 
			
		||||
	unsigned int revoked;
 | 
			
		||||
	/** A character representing the  encryption algorithm used by the public key
 | 
			
		||||
	 *
 | 
			
		||||
	 * ? = unknown
 | 
			
		||||
	 * R = RSA
 | 
			
		||||
	 * D = DSA
 | 
			
		||||
	 * E = EDDSA
 | 
			
		||||
	 */
 | 
			
		||||
	char pubkey_algo;
 | 
			
		||||
} alpm_pgpkey_t;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -2264,6 +2259,12 @@ int alpm_option_set_remote_file_siglevel(alpm_handle_t *handle, int level);
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** Get the download timeout state
 | 
			
		||||
 * @param handle the context handle
 | 
			
		||||
 * @return 0 for enabled, 1 for disabled
 | 
			
		||||
*/
 | 
			
		||||
int alpm_option_get_disable_dl_timeout(alpm_handle_t *handle);
 | 
			
		||||
 | 
			
		||||
/** Enables/disables the download timeout.
 | 
			
		||||
 * @param handle the context handle
 | 
			
		||||
 * @param disable_dl_timeout 0 for enabled, 1 for disabled
 | 
			
		||||
@@ -2306,6 +2307,12 @@ int alpm_option_set_parallel_downloads(alpm_handle_t *handle, unsigned int num_s
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** Get the sandbox state
 | 
			
		||||
 * @param handle the context handle
 | 
			
		||||
 * @return 0 for enabled, 1 for disabled
 | 
			
		||||
 */
 | 
			
		||||
int alpm_option_get_disable_sandbox(alpm_handle_t *handle);
 | 
			
		||||
 | 
			
		||||
/** Enables/disables the sandbox.
 | 
			
		||||
 * @param handle the context handle
 | 
			
		||||
 * @param disable_sandbox 0 for enabled, 1 for disabled
 | 
			
		||||
@@ -2971,9 +2978,10 @@ int alpm_capabilities(void);
 | 
			
		||||
 * @param handle the context handle
 | 
			
		||||
 * @param sandboxuser the user to switch to
 | 
			
		||||
 * @param sandbox_path if non-NULL, restrict writes to this filesystem path
 | 
			
		||||
 * @param restrict_syscalls whether to deny access to a list of dangerous syscalls
 | 
			
		||||
 * @return 0 on success, -1 on failure
 | 
			
		||||
 */
 | 
			
		||||
int alpm_sandbox_setup_child(alpm_handle_t *handle, const char *sandboxuser, const char *sandbox_path);
 | 
			
		||||
int alpm_sandbox_setup_child(alpm_handle_t *handle, const char *sandboxuser, const char *sandbox_path, bool restrict_syscalls);
 | 
			
		||||
 | 
			
		||||
/* End of libalpm_misc */
 | 
			
		||||
/** @} */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  alpm_list.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  alpm_list.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  backup.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  backup.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  be_local.c : backend for the local database
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  be_package.c : backend for packages
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  be_sync.c : backend for sync databases
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
@@ -153,7 +153,7 @@ int SYMEXPORT alpm_db_update(alpm_handle_t *handle, alpm_list_t *dbs, int force)
 | 
			
		||||
 | 
			
		||||
	syncpath = get_sync_dir(handle);
 | 
			
		||||
	ASSERT(syncpath != NULL, return -1);
 | 
			
		||||
	temporary_syncpath = _alpm_temporary_download_dir_setup(syncpath, handle->sandboxuser);
 | 
			
		||||
	temporary_syncpath = _alpm_temporary_download_dir_setup(handle, syncpath);
 | 
			
		||||
	ASSERT(temporary_syncpath != NULL, FREE(syncpath); return -1);
 | 
			
		||||
 | 
			
		||||
	/* make sure we have a sane umask */
 | 
			
		||||
@@ -309,11 +309,11 @@ static int _sync_get_validation(alpm_pkg_t *pkg)
 | 
			
		||||
static const struct pkg_operations *get_sync_pkg_ops(void)
 | 
			
		||||
{
 | 
			
		||||
	static struct pkg_operations sync_pkg_ops;
 | 
			
		||||
	static int sync_pkg_ops_initalized = 0;
 | 
			
		||||
	if(!sync_pkg_ops_initalized) {
 | 
			
		||||
	static int sync_pkg_ops_initialized = 0;
 | 
			
		||||
	if(!sync_pkg_ops_initialized) {
 | 
			
		||||
		sync_pkg_ops = default_pkg_ops;
 | 
			
		||||
		sync_pkg_ops.get_validation = _sync_get_validation;
 | 
			
		||||
		sync_pkg_ops_initalized = 1;
 | 
			
		||||
		sync_pkg_ops_initialized = 1;
 | 
			
		||||
	}
 | 
			
		||||
	return &sync_pkg_ops;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  conflict.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  conflict.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  db.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  db.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  deps.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
 | 
			
		||||
@@ -181,13 +181,13 @@ static void _alpm_warn_dep_cycle(alpm_handle_t *handle, alpm_list_t *targets,
 | 
			
		||||
	} else {
 | 
			
		||||
		alpm_pkg_t *ancestorpkg = ancestor->data;
 | 
			
		||||
		alpm_pkg_t *childpkg = vertex->data;
 | 
			
		||||
		_alpm_log(handle, ALPM_LOG_WARNING, _("dependency cycle detected:\n"));
 | 
			
		||||
		_alpm_log(handle, ALPM_LOG_DEBUG, _("dependency cycle detected:\n"));
 | 
			
		||||
		if(reverse) {
 | 
			
		||||
			_alpm_log(handle, ALPM_LOG_WARNING,
 | 
			
		||||
			_alpm_log(handle, ALPM_LOG_DEBUG,
 | 
			
		||||
					_("%s will be removed after its %s dependency\n"),
 | 
			
		||||
					ancestorpkg->name, childpkg->name);
 | 
			
		||||
		} else {
 | 
			
		||||
			_alpm_log(handle, ALPM_LOG_WARNING,
 | 
			
		||||
			_alpm_log(handle, ALPM_LOG_DEBUG,
 | 
			
		||||
					_("%s will be installed before its %s dependency\n"),
 | 
			
		||||
					ancestorpkg->name, childpkg->name);
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  deps.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  diskspace.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2010-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2010-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  diskspace.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2010-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2010-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  dload.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
@@ -76,13 +76,16 @@ static mode_t _getumask(void)
 | 
			
		||||
static int finalize_download_file(const char *filename)
 | 
			
		||||
{
 | 
			
		||||
	struct stat st;
 | 
			
		||||
	uid_t myuid = getuid();
 | 
			
		||||
	ASSERT(filename != NULL, return -1);
 | 
			
		||||
	ASSERT(stat(filename, &st) == 0, return -1);
 | 
			
		||||
	if(st.st_size == 0) {
 | 
			
		||||
		unlink(filename);
 | 
			
		||||
                return 1;
 | 
			
		||||
	}
 | 
			
		||||
	ASSERT(chown(filename, 0, 0) != -1, return -1);
 | 
			
		||||
	if(myuid == 0) {
 | 
			
		||||
		ASSERT(chown(filename, 0, 0) != -1, return -1);
 | 
			
		||||
	}
 | 
			
		||||
	ASSERT(chmod(filename, ~(_getumask()) & 0666) != -1, return -1);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -695,9 +698,9 @@ cleanup:
 | 
			
		||||
	 * only applies to FTP transfers. */
 | 
			
		||||
	curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
 | 
			
		||||
	curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, (char *)NULL);
 | 
			
		||||
 | 
			
		||||
	if(payload->localf != NULL) {
 | 
			
		||||
		fclose(payload->localf);
 | 
			
		||||
		payload->localf = NULL;
 | 
			
		||||
		utimes_long(payload->tempfile_name, remote_time);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -877,7 +880,6 @@ static int curl_download_internal(alpm_handle_t *handle,
 | 
			
		||||
			p = NULL;
 | 
			
		||||
			err = -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		while(true) {
 | 
			
		||||
			int msgs_left = 0;
 | 
			
		||||
			CURLMsg *msg = curl_multi_info_read(curlm, &msgs_left);
 | 
			
		||||
@@ -901,7 +903,6 @@ static int curl_download_internal(alpm_handle_t *handle,
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	int ret = err ? -1 : updated ? 0 : 1;
 | 
			
		||||
	_alpm_log(handle, ALPM_LOG_DEBUG, "curl_download_internal return code is %d\n", ret);
 | 
			
		||||
	alpm_list_free(payloads);
 | 
			
		||||
@@ -919,12 +920,10 @@ static int curl_download_internal_sandboxed(alpm_handle_t *handle,
 | 
			
		||||
{
 | 
			
		||||
	int pid, err = 0, ret = -1, callbacks_fd[2];
 | 
			
		||||
	sigset_t oldblock;
 | 
			
		||||
	struct sigaction sa_ign, oldint, oldquit;
 | 
			
		||||
	struct sigaction sa_ign = { .sa_handler = SIG_IGN }, oldint, oldquit;
 | 
			
		||||
	_alpm_sandbox_callback_context callbacks_ctx;
 | 
			
		||||
 | 
			
		||||
	sigemptyset(&sa_ign.sa_mask);
 | 
			
		||||
	sa_ign.sa_handler = SIG_IGN;
 | 
			
		||||
	sa_ign.sa_flags=0;
 | 
			
		||||
 | 
			
		||||
	if(pipe(callbacks_fd) != 0) {
 | 
			
		||||
		return -1;
 | 
			
		||||
@@ -963,7 +962,7 @@ static int curl_download_internal_sandboxed(alpm_handle_t *handle,
 | 
			
		||||
			_alpm_log(handle, ALPM_LOG_ERROR, _("could not chdir to download directory %s\n"), localpath);
 | 
			
		||||
			ret = -1;
 | 
			
		||||
		} else {
 | 
			
		||||
			ret = alpm_sandbox_setup_child(handle, handle->sandboxuser, localpath);
 | 
			
		||||
			ret = alpm_sandbox_setup_child(handle, handle->sandboxuser, localpath, true);
 | 
			
		||||
			if (ret != 0) {
 | 
			
		||||
				_alpm_log(handle, ALPM_LOG_ERROR, _("switching to sandbox user '%s' failed!\n"), handle->sandboxuser);
 | 
			
		||||
				_Exit(2);
 | 
			
		||||
@@ -1105,29 +1104,34 @@ static int finalize_download_locations(alpm_list_t *payloads, const char *localp
 | 
			
		||||
	int returnvalue = 0;
 | 
			
		||||
	for(p = payloads; p; p = p->next) {
 | 
			
		||||
		struct dload_payload *payload = p->data;
 | 
			
		||||
		if(payload->tempfile_name) {
 | 
			
		||||
			move_file(payload->tempfile_name, localpath);
 | 
			
		||||
		}
 | 
			
		||||
		const char *filename;
 | 
			
		||||
 | 
			
		||||
		if(payload->destfile_name) {
 | 
			
		||||
			int ret = move_file(payload->destfile_name, localpath);
 | 
			
		||||
			filename = payload->destfile_name;
 | 
			
		||||
		} else {
 | 
			
		||||
			filename = payload->tempfile_name;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
			if(ret == -1) {
 | 
			
		||||
				/* ignore error if the file already existed - only signature file was downloaded */
 | 
			
		||||
				if(payload->mtime_existing_file == 0) {
 | 
			
		||||
					returnvalue = -1;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		int ret = move_file(filename, localpath);
 | 
			
		||||
 | 
			
		||||
			if (payload->download_signature) {
 | 
			
		||||
				const char sig_suffix[] = ".sig";
 | 
			
		||||
				char *sig_filename = NULL;
 | 
			
		||||
				size_t sig_filename_len = strlen(payload->destfile_name) + sizeof(sig_suffix);
 | 
			
		||||
				MALLOC(sig_filename, sig_filename_len, continue);
 | 
			
		||||
				snprintf(sig_filename, sig_filename_len, "%s%s", payload->destfile_name, sig_suffix);
 | 
			
		||||
				move_file(sig_filename, localpath);
 | 
			
		||||
				FREE(sig_filename);
 | 
			
		||||
		if(ret == -1) {
 | 
			
		||||
			/* ignore error if the file already existed - only signature file was downloaded */
 | 
			
		||||
			if(payload->mtime_existing_file == 0) {
 | 
			
		||||
				_alpm_log(payload->handle, ALPM_LOG_ERROR, _("could not move %s into %s (%s)\n"),
 | 
			
		||||
						filename, localpath, strerror(errno));
 | 
			
		||||
				returnvalue = -1;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (payload->download_signature) {
 | 
			
		||||
			const char sig_suffix[] = ".sig";
 | 
			
		||||
			char *sig_filename = NULL;
 | 
			
		||||
			size_t sig_filename_len = strlen(filename) + sizeof(sig_suffix);
 | 
			
		||||
			MALLOC(sig_filename, sig_filename_len, continue);
 | 
			
		||||
			snprintf(sig_filename, sig_filename_len, "%s%s", filename, sig_suffix);
 | 
			
		||||
			move_file(sig_filename, localpath);
 | 
			
		||||
			FREE(sig_filename);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return returnvalue;
 | 
			
		||||
}
 | 
			
		||||
@@ -1265,7 +1269,7 @@ download_signature:
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (finalize_download_locations(payloads, localpath) != 0 && ret == 0) {
 | 
			
		||||
		return -1;
 | 
			
		||||
		RET_ERR(handle, ALPM_ERR_RETRIEVE, -1);
 | 
			
		||||
	}
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
@@ -1300,7 +1304,7 @@ int SYMEXPORT alpm_fetch_pkgurl(alpm_handle_t *handle, const alpm_list_t *urls,
 | 
			
		||||
 | 
			
		||||
	/* find a valid cache dir to download to */
 | 
			
		||||
	cachedir = _alpm_filecache_setup(handle);
 | 
			
		||||
	temporary_cachedir = _alpm_temporary_download_dir_setup(cachedir, handle->sandboxuser);
 | 
			
		||||
	temporary_cachedir = _alpm_temporary_download_dir_setup(handle, cachedir);
 | 
			
		||||
	ASSERT(temporary_cachedir != NULL, return -1);
 | 
			
		||||
 | 
			
		||||
	for(i = urls; i; i = i->next) {
 | 
			
		||||
@@ -1356,12 +1360,12 @@ int SYMEXPORT alpm_fetch_pkgurl(alpm_handle_t *handle, const alpm_list_t *urls,
 | 
			
		||||
	if(payloads) {
 | 
			
		||||
		event.type = ALPM_EVENT_PKG_RETRIEVE_START;
 | 
			
		||||
		event.pkg_retrieve.num = alpm_list_count(payloads);
 | 
			
		||||
		event.pkg_retrieve.total_size = 0;
 | 
			
		||||
		EVENT(handle, &event);
 | 
			
		||||
		if(_alpm_download(handle, payloads, cachedir, temporary_cachedir) == -1) {
 | 
			
		||||
			_alpm_log(handle, ALPM_LOG_WARNING, _("failed to retrieve some files\n"));
 | 
			
		||||
			event.type = ALPM_EVENT_PKG_RETRIEVE_FAILED;
 | 
			
		||||
			EVENT(handle, &event);
 | 
			
		||||
 | 
			
		||||
			GOTO_ERR(handle, ALPM_ERR_RETRIEVE, err);
 | 
			
		||||
		} else {
 | 
			
		||||
			event.type = ALPM_EVENT_PKG_RETRIEVE_DONE;
 | 
			
		||||
@@ -1376,7 +1380,8 @@ int SYMEXPORT alpm_fetch_pkgurl(alpm_handle_t *handle, const alpm_list_t *urls,
 | 
			
		||||
				const char *filename = mbasename(payload->destfile_name);
 | 
			
		||||
				filepath = _alpm_filecache_find(handle, filename);
 | 
			
		||||
			} else {
 | 
			
		||||
				STRDUP(filepath, payload->tempfile_name, GOTO_ERR(handle, ALPM_ERR_MEMORY, err));
 | 
			
		||||
				const char *filename = mbasename(payload->tempfile_name);
 | 
			
		||||
				filepath = _alpm_filecache_find(handle, filename);
 | 
			
		||||
			}
 | 
			
		||||
			if(filepath) {
 | 
			
		||||
				alpm_list_append(fetched, filepath);
 | 
			
		||||
@@ -1408,6 +1413,11 @@ void _alpm_dload_payload_reset(struct dload_payload *payload)
 | 
			
		||||
{
 | 
			
		||||
	ASSERT(payload, return);
 | 
			
		||||
 | 
			
		||||
	if(payload->localf != NULL) {
 | 
			
		||||
		fclose(payload->localf);
 | 
			
		||||
		payload->localf = NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	FREE(payload->remote_name);
 | 
			
		||||
	FREE(payload->tempfile_name);
 | 
			
		||||
	FREE(payload->destfile_name);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  dload.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  error.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
@@ -137,7 +137,9 @@ const char SYMEXPORT *alpm_strerror(alpm_errno_t err)
 | 
			
		||||
			return _("conflicting dependencies");
 | 
			
		||||
		case ALPM_ERR_FILE_CONFLICTS:
 | 
			
		||||
			return _("conflicting files");
 | 
			
		||||
		/* Miscellaenous */
 | 
			
		||||
		/* Miscellaneous */
 | 
			
		||||
		case ALPM_ERR_RETRIEVE_PREPARE:
 | 
			
		||||
			return _("failed to initialize download");
 | 
			
		||||
		case ALPM_ERR_RETRIEVE:
 | 
			
		||||
			return _("failed to retrieve some files");
 | 
			
		||||
		case ALPM_ERR_INVALID_REGEX:
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  filelist.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2012-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2012-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  filelist.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2012-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2012-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  graph.c - helpful graph structure and setup/teardown methods
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2007-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2007-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  graph.h - helpful graph structure and setup/teardown methods
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2007-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2007-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  group.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  group.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  handle.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
 | 
			
		||||
@@ -935,6 +935,12 @@ int SYMEXPORT alpm_option_get_remote_file_siglevel(alpm_handle_t *handle)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int SYMEXPORT alpm_option_get_disable_dl_timeout(alpm_handle_t *handle)
 | 
			
		||||
{
 | 
			
		||||
	CHECK_HANDLE(handle, return -1);
 | 
			
		||||
	return handle->disable_dl_timeout;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int SYMEXPORT alpm_option_set_disable_dl_timeout(alpm_handle_t *handle,
 | 
			
		||||
		unsigned short disable_dl_timeout)
 | 
			
		||||
{
 | 
			
		||||
@@ -952,6 +958,12 @@ int SYMEXPORT alpm_option_set_parallel_downloads(alpm_handle_t *handle,
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int SYMEXPORT alpm_option_get_disable_sandbox(alpm_handle_t *handle)
 | 
			
		||||
{
 | 
			
		||||
	CHECK_HANDLE(handle, return -1);
 | 
			
		||||
	return handle->disable_sandbox;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int SYMEXPORT alpm_option_set_disable_sandbox(alpm_handle_t *handle,
 | 
			
		||||
		unsigned short disable_sandbox)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  handle.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  hook.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2015-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2015-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  hook.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2015-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2015-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * libarchive-compat.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2013-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2013-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  log.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  log.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -26,6 +26,7 @@ libalpm_sources = files('''
 | 
			
		||||
  remove.h remove.c
 | 
			
		||||
  sandbox.h sandbox.c
 | 
			
		||||
  sandbox_fs.h sandbox_fs.c
 | 
			
		||||
  sandbox_syscalls.h sandbox_syscalls.c
 | 
			
		||||
  signing.c signing.h
 | 
			
		||||
  sync.h sync.c
 | 
			
		||||
  trans.h trans.c
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  package.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005, 2006 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  package.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  pkghash.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  pkghash.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  remove.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  remove.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  sandbox.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2021-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2021-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -17,9 +17,14 @@
 | 
			
		||||
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "config.h"
 | 
			
		||||
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <grp.h>
 | 
			
		||||
#include <pwd.h>
 | 
			
		||||
#ifdef HAVE_SYS_PRCTL_H
 | 
			
		||||
#include <sys/prctl.h>
 | 
			
		||||
#endif /* HAVE_SYS_PRCTL_H */
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
@@ -27,9 +32,10 @@
 | 
			
		||||
#include "log.h"
 | 
			
		||||
#include "sandbox.h"
 | 
			
		||||
#include "sandbox_fs.h"
 | 
			
		||||
#include "sandbox_syscalls.h"
 | 
			
		||||
#include "util.h"
 | 
			
		||||
 | 
			
		||||
int SYMEXPORT alpm_sandbox_setup_child(alpm_handle_t *handle, const char* sandboxuser, const char* sandbox_path)
 | 
			
		||||
int SYMEXPORT alpm_sandbox_setup_child(alpm_handle_t *handle, const char* sandboxuser, const char* sandbox_path, bool restrict_syscalls)
 | 
			
		||||
{
 | 
			
		||||
	struct passwd const *pw = NULL;
 | 
			
		||||
 | 
			
		||||
@@ -39,6 +45,13 @@ int SYMEXPORT alpm_sandbox_setup_child(alpm_handle_t *handle, const char* sandbo
 | 
			
		||||
	if(sandbox_path != NULL && !handle->disable_sandbox) {
 | 
			
		||||
		_alpm_sandbox_fs_restrict_writes_to(handle, sandbox_path);
 | 
			
		||||
	}
 | 
			
		||||
#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_NO_NEW_PRIVS)
 | 
			
		||||
	/* make sure that we cannot gain more privileges later, failure is fine */
 | 
			
		||||
	prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
 | 
			
		||||
#endif /* HAVE_SYS_PRCTL && PR_SET_NO_NEW_PRIVS */
 | 
			
		||||
	if(restrict_syscalls && !handle->disable_sandbox) {
 | 
			
		||||
		_alpm_sandbox_syscalls_filter(handle);
 | 
			
		||||
	}
 | 
			
		||||
	ASSERT(setgid(pw->pw_gid) == 0, return -1);
 | 
			
		||||
	ASSERT(setgroups(0, NULL) == 0, return -1);
 | 
			
		||||
	ASSERT(setuid(pw->pw_uid) == 0, return -1);
 | 
			
		||||
@@ -222,7 +235,9 @@ bool _alpm_sandbox_process_cb_download(alpm_handle_t *handle, int callback_pipe)
 | 
			
		||||
	ASSERT(read_from_pipe(callback_pipe, filename, filename_size) != -1, FREE(filename); return false);
 | 
			
		||||
	filename[filename_size] = '\0';
 | 
			
		||||
 | 
			
		||||
	handle->dlcb(handle->dlcb_ctx, filename, type, &cb_data);
 | 
			
		||||
	if(handle->dlcb) {
 | 
			
		||||
		handle->dlcb(handle->dlcb_ctx, filename, type, &cb_data);
 | 
			
		||||
	}
 | 
			
		||||
	FREE(filename);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  sandbox_fs.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2021-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2021-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -150,6 +150,9 @@ bool _alpm_sandbox_fs_restrict_writes_to(alpm_handle_t *handle, const char *path
 | 
			
		||||
	path_beneath.parent_fd = open(path, O_PATH | O_CLOEXEC | O_DIRECTORY);
 | 
			
		||||
	path_beneath.allowed_access = _LANDLOCK_ACCESS_FS_READ | _LANDLOCK_ACCESS_FS_WRITE | _LANDLOCK_ACCESS_FS_TRUNCATE;
 | 
			
		||||
 | 
			
		||||
	/* make sure allowed_access is a subset of handled_access_fs, which may change for older landlock ABI */
 | 
			
		||||
	path_beneath.allowed_access &= ruleset_attr.handled_access_fs;
 | 
			
		||||
 | 
			
		||||
	if(landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, &path_beneath, 0) == 0) {
 | 
			
		||||
		if(landlock_restrict_self(ruleset_fd, 0)) {
 | 
			
		||||
			_alpm_log(handle, ALPM_LOG_ERROR, _("restricting filesystem access failed because the landlock ruleset could not be applied!\n"));
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  sandbox_fs.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2021-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2021-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										165
									
								
								lib/libalpm/sandbox_syscalls.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										165
									
								
								lib/libalpm/sandbox_syscalls.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,165 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  sandbox_syscalls.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2021-2022 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 *  the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
 *  (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is distributed in the hope that it will be useful,
 | 
			
		||||
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 *  GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 *  You should have received a copy of the GNU General Public License
 | 
			
		||||
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
 | 
			
		||||
#include "config.h"
 | 
			
		||||
#include "log.h"
 | 
			
		||||
#include "sandbox_syscalls.h"
 | 
			
		||||
#include "util.h"
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_LIBSECCOMP
 | 
			
		||||
# include <seccomp.h>
 | 
			
		||||
#endif /* HAVE_LIBSECCOMP */
 | 
			
		||||
 | 
			
		||||
bool _alpm_sandbox_syscalls_filter(alpm_handle_t *handle)
 | 
			
		||||
{
 | 
			
		||||
	int ret = 0;
 | 
			
		||||
#ifdef HAVE_LIBSECCOMP
 | 
			
		||||
	/* see https://docs.docker.com/engine/security/seccomp/ for inspiration,
 | 
			
		||||
	   as well as systemd's src/shared/seccomp-util.c */
 | 
			
		||||
	const char *denied_syscalls[] = {
 | 
			
		||||
		/* kernel modules */
 | 
			
		||||
		"delete_module",
 | 
			
		||||
		"finit_module",
 | 
			
		||||
		"init_module",
 | 
			
		||||
		/* mount */
 | 
			
		||||
		"chroot",
 | 
			
		||||
		"fsconfig",
 | 
			
		||||
		"fsmount",
 | 
			
		||||
		"fsopen",
 | 
			
		||||
		"fspick",
 | 
			
		||||
		"mount",
 | 
			
		||||
		"mount_setattr",
 | 
			
		||||
		"move_mount",
 | 
			
		||||
		"open_tree",
 | 
			
		||||
		"pivot_root",
 | 
			
		||||
		"umount",
 | 
			
		||||
		"umount2",
 | 
			
		||||
		/* keyring */
 | 
			
		||||
		"add_key",
 | 
			
		||||
		"keyctl",
 | 
			
		||||
		"request_key",
 | 
			
		||||
		/* CPU emulation */
 | 
			
		||||
		"modify_ldt",
 | 
			
		||||
		"subpage_prot",
 | 
			
		||||
		"switch_endian",
 | 
			
		||||
		"vm86",
 | 
			
		||||
		"vm86old",
 | 
			
		||||
		/* debug */
 | 
			
		||||
		"kcmp",
 | 
			
		||||
		"lookup_dcookie",
 | 
			
		||||
		"perf_event_open",
 | 
			
		||||
		"pidfd_getfd",
 | 
			
		||||
		"ptrace",
 | 
			
		||||
		"rtas",
 | 
			
		||||
		"sys_debug_setcontext",
 | 
			
		||||
		/* set clock */
 | 
			
		||||
		"adjtimex",
 | 
			
		||||
		"clock_adjtime",
 | 
			
		||||
		"clock_adjtime64",
 | 
			
		||||
		"clock_settime",
 | 
			
		||||
		"clock_settime64",
 | 
			
		||||
		"settimeofday",
 | 
			
		||||
		/* raw IO */
 | 
			
		||||
		"ioperm",
 | 
			
		||||
		"iopl",
 | 
			
		||||
		"pciconfig_iobase",
 | 
			
		||||
		"pciconfig_read",
 | 
			
		||||
		"pciconfig_write",
 | 
			
		||||
		/* kexec */
 | 
			
		||||
		"kexec_file_load",
 | 
			
		||||
		"kexec_load",
 | 
			
		||||
		/* reboot */
 | 
			
		||||
		"reboot",
 | 
			
		||||
		/* privileged */
 | 
			
		||||
		"acct",
 | 
			
		||||
		"bpf",
 | 
			
		||||
		"capset",
 | 
			
		||||
		"chroot",
 | 
			
		||||
		"fanotify_init",
 | 
			
		||||
		"fanotify_mark",
 | 
			
		||||
		"nfsservctl",
 | 
			
		||||
		"open_by_handle_at",
 | 
			
		||||
		"pivot_root",
 | 
			
		||||
		"personality",
 | 
			
		||||
		/* obsolete */
 | 
			
		||||
		"_sysctl",
 | 
			
		||||
		"afs_syscall",
 | 
			
		||||
		"bdflush",
 | 
			
		||||
		"break",
 | 
			
		||||
		"create_module",
 | 
			
		||||
		"ftime",
 | 
			
		||||
		"get_kernel_syms",
 | 
			
		||||
		"getpmsg",
 | 
			
		||||
		"gtty",
 | 
			
		||||
		"idle",
 | 
			
		||||
		"lock",
 | 
			
		||||
		"mpx",
 | 
			
		||||
		"prof",
 | 
			
		||||
		"profil",
 | 
			
		||||
		"putpmsg",
 | 
			
		||||
		"query_module",
 | 
			
		||||
		"security",
 | 
			
		||||
		"sgetmask",
 | 
			
		||||
		"ssetmask",
 | 
			
		||||
		"stime",
 | 
			
		||||
		"stty",
 | 
			
		||||
		"sysfs",
 | 
			
		||||
		"tuxcall",
 | 
			
		||||
		"ulimit",
 | 
			
		||||
		"uselib",
 | 
			
		||||
		"ustat",
 | 
			
		||||
		"vserver",
 | 
			
		||||
		/* swap */
 | 
			
		||||
		"swapon",
 | 
			
		||||
		"swapoff",
 | 
			
		||||
	};
 | 
			
		||||
	/* allow all syscalls that are not listed */
 | 
			
		||||
	size_t idx;
 | 
			
		||||
	scmp_filter_ctx ctx = seccomp_init(SCMP_ACT_ALLOW);
 | 
			
		||||
	int restrictedSyscallsCount = 0;
 | 
			
		||||
	if(ctx == NULL) {
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for(idx = 0; idx < sizeof(denied_syscalls) / sizeof(*denied_syscalls); idx++) {
 | 
			
		||||
		int syscall = seccomp_syscall_resolve_name(denied_syscalls[idx]);
 | 
			
		||||
		if(syscall != __NR_SCMP_ERROR) {
 | 
			
		||||
			if(seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), syscall, 0) != 0) {
 | 
			
		||||
				_alpm_log(handle, ALPM_LOG_ERROR, _("error restricting syscall %s via seccomp!\n"), denied_syscalls[idx]);
 | 
			
		||||
			}
 | 
			
		||||
			else {
 | 
			
		||||
				restrictedSyscallsCount++;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if(seccomp_load(ctx) != 0) {
 | 
			
		||||
		ret = errno;
 | 
			
		||||
		_alpm_log(handle, ALPM_LOG_ERROR, _("error restricting syscalls via seccomp: %d!\n"), ret);
 | 
			
		||||
	}
 | 
			
		||||
	else {
 | 
			
		||||
		_alpm_log(handle, ALPM_LOG_DEBUG, _("successfully restricted %d syscalls via seccomp\n"), restrictedSyscallsCount);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	seccomp_release(ctx);
 | 
			
		||||
#endif /* HAVE_LIBSECCOMP */
 | 
			
		||||
	return ret == 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										26
									
								
								lib/libalpm/sandbox_syscalls.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								lib/libalpm/sandbox_syscalls.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  sandbox_syscalls.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2021-2022 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 *  the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
 *  (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is distributed in the hope that it will be useful,
 | 
			
		||||
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 *  GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 *  You should have received a copy of the GNU General Public License
 | 
			
		||||
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
#ifndef ALPM_SANDBOX_SYSCALLS_H
 | 
			
		||||
#define ALPM_SANDBOX_SYSCALLS_H
 | 
			
		||||
 | 
			
		||||
#include <stdbool.h>
 | 
			
		||||
 | 
			
		||||
bool _alpm_sandbox_syscalls_filter(alpm_handle_t *handle);
 | 
			
		||||
 | 
			
		||||
#endif /* ALPM_SANDBOX_SYSCALLS_H */
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  signing.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2008-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2008-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -371,46 +371,6 @@ static int key_search_keyserver(alpm_handle_t *handle, const char *fpr,
 | 
			
		||||
	pgpkey->expires = key->subkeys->expires;
 | 
			
		||||
	pgpkey->length = key->subkeys->length;
 | 
			
		||||
	pgpkey->revoked = key->subkeys->revoked;
 | 
			
		||||
	/* Initialize with '?', this is overwritten unless public key
 | 
			
		||||
	 * algorithm is unknown. */
 | 
			
		||||
	pgpkey->pubkey_algo = '?';
 | 
			
		||||
 | 
			
		||||
	switch(key->subkeys->pubkey_algo) {
 | 
			
		||||
		case GPGME_PK_RSA:
 | 
			
		||||
		case GPGME_PK_RSA_E:
 | 
			
		||||
		case GPGME_PK_RSA_S:
 | 
			
		||||
			pgpkey->pubkey_algo = 'R';
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
		case GPGME_PK_DSA:
 | 
			
		||||
			pgpkey->pubkey_algo = 'D';
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
		case GPGME_PK_ELG_E:
 | 
			
		||||
		case GPGME_PK_ELG:
 | 
			
		||||
		case GPGME_PK_ECDSA:
 | 
			
		||||
		case GPGME_PK_ECDH:
 | 
			
		||||
/* value added in gpgme 1.5.0 */
 | 
			
		||||
#if GPGME_VERSION_NUMBER >= 0x010500
 | 
			
		||||
		case GPGME_PK_ECC:
 | 
			
		||||
#endif
 | 
			
		||||
/* value added in gpgme 1.7.0 */
 | 
			
		||||
#if GPGME_VERSION_NUMBER >= 0x010700
 | 
			
		||||
		case GPGME_PK_EDDSA:
 | 
			
		||||
#endif
 | 
			
		||||
			pgpkey->pubkey_algo = 'E';
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ret = 1;
 | 
			
		||||
 | 
			
		||||
	/* We do not want to add a default switch case above to receive
 | 
			
		||||
	 * compiler error on new public key algorithm in gpgme. So check
 | 
			
		||||
	 * here if we have a valid pubkey_algo. */
 | 
			
		||||
	if (pgpkey->pubkey_algo == '?') {
 | 
			
		||||
		_alpm_log(handle, ALPM_LOG_DEBUG,
 | 
			
		||||
			"unknown public key algorithm: %d\n", key->subkeys->pubkey_algo);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
gpg_error:
 | 
			
		||||
	if(ret != 1) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  signing.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2008-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2008-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  sync.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
@@ -780,7 +780,7 @@ static int download_files(alpm_handle_t *handle)
 | 
			
		||||
	alpm_list_t *payloads = NULL;
 | 
			
		||||
 | 
			
		||||
	cachedir = _alpm_filecache_setup(handle);
 | 
			
		||||
	temporary_cachedir = _alpm_temporary_download_dir_setup(cachedir, handle->sandboxuser);
 | 
			
		||||
	temporary_cachedir = _alpm_temporary_download_dir_setup(handle, cachedir);
 | 
			
		||||
	if(temporary_cachedir == NULL) {
 | 
			
		||||
		ret = -1;
 | 
			
		||||
		goto finish;
 | 
			
		||||
@@ -817,6 +817,8 @@ static int download_files(alpm_handle_t *handle)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		event.type = ALPM_EVENT_PKG_RETRIEVE_START;
 | 
			
		||||
		event.pkg_retrieve.total_size = 0;
 | 
			
		||||
		event.pkg_retrieve.num = 0;
 | 
			
		||||
 | 
			
		||||
		/* sum up the number of packages to download and its total size */
 | 
			
		||||
		for(i = files; i; i = i->next) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  sync.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  trans.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
@@ -203,7 +203,7 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
 | 
			
		||||
		RET_ERR(handle, ALPM_ERR_TRANS_HOOK_FAILED, -1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	trans->state = STATE_COMMITING;
 | 
			
		||||
	trans->state = STATE_COMMITTING;
 | 
			
		||||
 | 
			
		||||
	alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction started\n");
 | 
			
		||||
	event.type = ALPM_EVENT_TRANSACTION_START;
 | 
			
		||||
@@ -239,7 +239,7 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	trans->state = STATE_COMMITED;
 | 
			
		||||
	trans->state = STATE_COMMITTED;
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -253,7 +253,7 @@ int SYMEXPORT alpm_trans_interrupt(alpm_handle_t *handle)
 | 
			
		||||
 | 
			
		||||
	trans = handle->trans;
 | 
			
		||||
	ASSERT(trans != NULL, RET_ERR_ASYNC_SAFE(handle, ALPM_ERR_TRANS_NULL, -1));
 | 
			
		||||
	ASSERT(trans->state == STATE_COMMITING || trans->state == STATE_INTERRUPTED,
 | 
			
		||||
	ASSERT(trans->state == STATE_COMMITTING || trans->state == STATE_INTERRUPTED,
 | 
			
		||||
			RET_ERR_ASYNC_SAFE(handle, ALPM_ERR_TRANS_TYPE, -1));
 | 
			
		||||
 | 
			
		||||
	trans->state = STATE_INTERRUPTED;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  trans.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
@@ -30,8 +30,8 @@ typedef enum _alpm_transstate_t {
 | 
			
		||||
	STATE_INITIALIZED,
 | 
			
		||||
	STATE_PREPARED,
 | 
			
		||||
	STATE_DOWNLOADING,
 | 
			
		||||
	STATE_COMMITING,
 | 
			
		||||
	STATE_COMMITED,
 | 
			
		||||
	STATE_COMMITTING,
 | 
			
		||||
	STATE_COMMITTED,
 | 
			
		||||
	STATE_INTERRUPTED
 | 
			
		||||
} alpm_transstate_t;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  util.c
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
@@ -23,6 +23,7 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <ctype.h>
 | 
			
		||||
#include <dirent.h>
 | 
			
		||||
@@ -590,9 +591,7 @@ void _alpm_reset_signals(void)
 | 
			
		||||
#endif
 | 
			
		||||
		0
 | 
			
		||||
	};
 | 
			
		||||
	struct sigaction def;
 | 
			
		||||
	def.sa_flags = 0;
 | 
			
		||||
	def.sa_handler = SIG_DFL;
 | 
			
		||||
	struct sigaction def = { .sa_handler = SIG_DFL };
 | 
			
		||||
	sigemptyset(&def.sa_mask);
 | 
			
		||||
	for(i = signals; *i; i++) {
 | 
			
		||||
		sigaction(*i, &def, NULL);
 | 
			
		||||
@@ -951,33 +950,53 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle)
 | 
			
		||||
/** Create a temporary directory under the supplied directory.
 | 
			
		||||
 * The new directory is writable by the download user, and will be
 | 
			
		||||
 * removed after the download operation has completed.
 | 
			
		||||
 * @param handle an alpm handle
 | 
			
		||||
 * @param dir existing sync or cache directory
 | 
			
		||||
 * @param user download user name
 | 
			
		||||
 * @return pointer to a sub-directory writable by the download user inside the existing directory.
 | 
			
		||||
 */
 | 
			
		||||
char *_alpm_temporary_download_dir_setup(const char *dir, const char *user)
 | 
			
		||||
char *_alpm_temporary_download_dir_setup(alpm_handle_t *handle, const char *dir)
 | 
			
		||||
{
 | 
			
		||||
	const char *user = handle->sandboxuser;
 | 
			
		||||
	uid_t myuid = getuid();
 | 
			
		||||
	struct passwd const *pw = NULL;
 | 
			
		||||
 | 
			
		||||
	ASSERT(dir != NULL, return NULL);
 | 
			
		||||
	if(user != NULL) {
 | 
			
		||||
		ASSERT((pw = getpwnam(user)) != NULL, return NULL);
 | 
			
		||||
	ASSERT(dir != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, NULL));
 | 
			
		||||
	if(myuid == 0 && user != NULL) {
 | 
			
		||||
		errno = 0;
 | 
			
		||||
		pw = getpwnam(user);
 | 
			
		||||
 | 
			
		||||
		if(pw == NULL) {
 | 
			
		||||
			if(errno == 0) {
 | 
			
		||||
				_alpm_log(handle, ALPM_LOG_ERROR,
 | 
			
		||||
						_("download user '%s' does not exist\n"), user);
 | 
			
		||||
			} else {
 | 
			
		||||
				_alpm_log(handle, ALPM_LOG_ERROR,
 | 
			
		||||
						_("failed to get download user '%s': %s\n"),
 | 
			
		||||
						user, strerror(errno));
 | 
			
		||||
			}
 | 
			
		||||
			RET_ERR(handle, ALPM_ERR_RETRIEVE_PREPARE, NULL);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	const char template[] = "download-XXXXXX";
 | 
			
		||||
	size_t newdirlen = strlen(dir) + sizeof(template) + 1;
 | 
			
		||||
	char *newdir = NULL;
 | 
			
		||||
	MALLOC(newdir, newdirlen, return NULL);
 | 
			
		||||
	MALLOC(newdir, newdirlen, RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
 | 
			
		||||
	snprintf(newdir, newdirlen - 1, "%s%s", dir, template);
 | 
			
		||||
	newdir = mkdtemp(newdir);
 | 
			
		||||
	if(newdir == NULL) {
 | 
			
		||||
	if(mkdtemp(newdir) == NULL) {
 | 
			
		||||
		_alpm_log(handle, ALPM_LOG_ERROR,
 | 
			
		||||
				_("failed to create temporary download directory %s: %s\n"),
 | 
			
		||||
				newdir, strerror(errno));
 | 
			
		||||
		free(newdir);
 | 
			
		||||
		return NULL;
 | 
			
		||||
		RET_ERR(handle, ALPM_ERR_RETRIEVE_PREPARE, NULL);
 | 
			
		||||
	}
 | 
			
		||||
	if(pw != NULL) {
 | 
			
		||||
		if(chown(newdir, pw->pw_uid, pw->pw_gid) == -1) {
 | 
			
		||||
			_alpm_log(handle, ALPM_LOG_ERROR,
 | 
			
		||||
					_("failed to chown temporary download directory %s: %s\n"),
 | 
			
		||||
					newdir, strerror(errno));
 | 
			
		||||
			free(newdir);
 | 
			
		||||
			return NULL;
 | 
			
		||||
			RET_ERR(handle, ALPM_ERR_RETRIEVE_PREPARE, NULL);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	newdir[newdirlen-2] = '/';
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  util.h
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
 | 
			
		||||
 *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
 | 
			
		||||
 *  Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
 | 
			
		||||
@@ -139,7 +139,7 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename);
 | 
			
		||||
/* Checks whether a file exists in cache */
 | 
			
		||||
int _alpm_filecache_exists(alpm_handle_t *handle, const char *filename);
 | 
			
		||||
const char *_alpm_filecache_setup(alpm_handle_t *handle);
 | 
			
		||||
char *_alpm_temporary_download_dir_setup(const char *dir, const char *user);
 | 
			
		||||
char *_alpm_temporary_download_dir_setup(alpm_handle_t *handle, const char *dir);
 | 
			
		||||
void _alpm_remove_temporary_download_dir(const char *dir);
 | 
			
		||||
 | 
			
		||||
/* Unlike many uses of alpm_pkgvalidation_t, _alpm_test_checksum expects
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *  Copyright (c) 2006-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
 *
 | 
			
		||||
 *  This program is free software; you can redistribute it and/or modify
 | 
			
		||||
 *  it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -122,12 +122,17 @@ else
 | 
			
		||||
  error('unhandled crypto value @0@'.format(want_crypto))
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
libseccomp = dependency('libseccomp',
 | 
			
		||||
                        static : get_option('buildstatic'),
 | 
			
		||||
                        required : false)
 | 
			
		||||
conf.set('HAVE_LIBSECCOMP', libseccomp.found())
 | 
			
		||||
foreach header : [
 | 
			
		||||
    'linux/landlock.h',
 | 
			
		||||
    'mntent.h',
 | 
			
		||||
    'sys/mnttab.h',
 | 
			
		||||
    'sys/mount.h',
 | 
			
		||||
    'sys/param.h',
 | 
			
		||||
    'sys/prctl.h',
 | 
			
		||||
    'sys/statvfs.h',
 | 
			
		||||
    'sys/types.h',
 | 
			
		||||
    'sys/ucred.h',
 | 
			
		||||
@@ -327,7 +332,7 @@ libcommon = static_library(
 | 
			
		||||
  gnu_symbol_visibility : 'hidden',
 | 
			
		||||
  install : false)
 | 
			
		||||
 | 
			
		||||
alpm_deps = [crypto_provider, libarchive, libcurl, libintl, gpgme]
 | 
			
		||||
alpm_deps = [crypto_provider, libarchive, libcurl, libintl, libseccomp, gpgme]
 | 
			
		||||
 | 
			
		||||
libalpm_a = static_library(
 | 
			
		||||
  'alpm_objlib',
 | 
			
		||||
@@ -428,6 +433,8 @@ configure_file(
 | 
			
		||||
  configuration : substs,
 | 
			
		||||
  install_dir : join_paths(SYSCONFDIR, 'makepkg.conf.d/'))
 | 
			
		||||
 | 
			
		||||
install_emptydir(join_paths(SYSCONFDIR, 'makepkg.d/'))
 | 
			
		||||
 | 
			
		||||
configure_file(
 | 
			
		||||
  input : 'etc/pacman.conf.in',
 | 
			
		||||
  output : 'pacman.conf',
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
# NOTE: Please fill out the license field for your package! If it is unknown,
 | 
			
		||||
# then please put 'unknown'.
 | 
			
		||||
 | 
			
		||||
# The following guidelines are specific to BZR, GIT, HG and SVN packages.
 | 
			
		||||
# Guidelines specific to Bazaar, Git, Mercurial and Subversion packages.
 | 
			
		||||
# Other VCS sources are not natively supported by makepkg yet.
 | 
			
		||||
 | 
			
		||||
# Maintainer: Your Name <youremail@domain.com>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   autodep.sh - functions for automatically adding depends/provides
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2021-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2021-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   library_depends.sh - Automatically add library requirements to depends
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2021-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2021-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -51,8 +51,8 @@ library_depends() {
 | 
			
		||||
 | 
			
		||||
				unset prefix
 | 
			
		||||
				for libdir in ${LIB_DIRS[@]}; do
 | 
			
		||||
					if [[ ${libdir/*:} == ${libpath} ]]; then
 | 
			
		||||
						prefix=${libdir/:*}
 | 
			
		||||
					if [[ ${libdir#*:} == ${libpath} ]]; then
 | 
			
		||||
						prefix=${libdir%%:*}
 | 
			
		||||
					fi
 | 
			
		||||
				done
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   library_provides.sh - Automatically add a packages libraries to provides
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2021-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2021-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -28,8 +28,8 @@ autodep_functions+=('library_provides')
 | 
			
		||||
library_provides() {
 | 
			
		||||
	if check_option "autodeps" "y"; then
 | 
			
		||||
		for lib in ${LIB_DIRS[@]}; do
 | 
			
		||||
			dir=${lib/*:}
 | 
			
		||||
			prefix=${lib/:*}
 | 
			
		||||
			dir=${lib#*:}
 | 
			
		||||
			prefix=${lib%%:*}
 | 
			
		||||
 | 
			
		||||
			if [[ ! -d "$pkgdir/$dir" ]]; then
 | 
			
		||||
				continue;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
#   buildenv.sh - functions for altering the build environment before
 | 
			
		||||
#   compilation
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2015-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2015-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   buildflags.sh - Clear user-specified buildflags if requested
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
#   ccache - Cache compilations and reuse them to save time on repetitions
 | 
			
		||||
#   distcc - Distribute compilation of C and C++ across machines
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2007-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2007-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -44,8 +44,9 @@ buildenv_ccache() {
 | 
			
		||||
buildenv_distcc() {
 | 
			
		||||
	if check_buildoption "distcc" "y"; then
 | 
			
		||||
		if (( using_ccache )); then
 | 
			
		||||
			if [[ " $CCACHE_PREFIX " != *" distcc "* ]]; then
 | 
			
		||||
				export CCACHE_PREFIX="${CCACHE_PREFIX:+$CCACHE_PREFIX }distcc"
 | 
			
		||||
			local distcc=$(type -p distcc)
 | 
			
		||||
			if [[ " $CCACHE_PREFIX " != *" ${distcc} "* ]]; then
 | 
			
		||||
				export CCACHE_PREFIX="${CCACHE_PREFIX:+$CCACHE_PREFIX }${distcc}"
 | 
			
		||||
			fi
 | 
			
		||||
			export CCACHE_BASEDIR="$srcdir"
 | 
			
		||||
		elif [[ -d /usr/lib/distcc/bin ]]; then
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
#   debugflags.sh - Specify flags for building a package with debugging
 | 
			
		||||
#   symbols
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2012-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2012-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   fortran.sh - Specify flags for building a package with Fortran
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2024-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
#   lto.sh - Specify flags for building a package with link-time
 | 
			
		||||
#            optimisation
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2021-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2021-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   makeflags.sh - Clear user-specified makeflags if requested
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2007-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2007-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   rust.sh - Specify flags for building a package with rust
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2022-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2022-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   executable.sh - confirm presence of dependent executables
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2018-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2018-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   ccache.sh - Confirm presence of ccache binary
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   checksum.sh - Confirm presence of binaries for checksum operations
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2016-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2016-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   debugedit.sh - Confirm presence of debugedit binary
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2022-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2022-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   distcc.sh - Confirm presence of distcc binary
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   fakeroot.sh - Confirm presence of fakeroot binary
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   gpg.sh - Confirm presence of gpg binary
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   gzip.sh - Confirm presence of gzip binary
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   pacman.sh - Confirm presence of pacman binary
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2012-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2012-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   strip.sh - Confirm presence of strip binary
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   sudo.sh - Confirm presence of sudo binary
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   vcs.sh - Confirm presence of binaries for VCS operations
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2014-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2014-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   integrity.sh - functions relating to source integrity checking
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2011-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   generate_checksum.sh - functions for generating source checksums
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2014-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2014-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   generate_signature.sh - functions for generating PGP signatures
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2008-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2008-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#
 | 
			
		||||
#   verify_checksum.sh - functions for checking source checksums
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2014-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#   Copyright (c) 2014-2025 Pacman Development Team <pacman-dev@lists.archlinux.org>
 | 
			
		||||
#
 | 
			
		||||
#   This program is free software; you can redistribute it and/or modify
 | 
			
		||||
#   it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user