Compare commits

...
Sign in to create a new pull request.

31 commits

Author SHA1 Message Date
morganamilo
219941734a
Merge branch 'morganamilo/get_handle' into morganamilo/master 2021-12-14 18:56:31 +00:00
morganamilo
fe055bec1f
libalpm: add getter for handle on db and pkg
db and pkg store a pointer to the handle for internal use but don't
actually provide a way for a user to get it.

Making this accessible is more convenient for front ends and FFI
wrappers.

For example, in other languages it's common to return the error value
directly. To achieve this the python and rust wrappers also store their
own pointer to the handle inside their own pkg/db wrappers.

Exposing this would allow the wrappers to forgo the extra pointer and
just return `pkg.get_handle().last_error()`.
2021-12-06 19:55:29 +00:00
morganamilo
ee31b4c12e
alpm: fix wrong access() being used
When removing files we check _alpm_access() to see if we can write
(delete) the file. If not, we check if the file exists because if the
file does not exist then we don't actually need to remove it so there's
no issue.

However the second call uses acess() instead of _alpm_access() which
does not the rootdir into account.
2021-11-07 00:25:01 +00:00
morganamilo
cde562bb4d
Merge branch 'morganamilo/pactrans' into morganamilo/tip 2021-11-07 00:19:35 +00:00
morganamilo
15eb65c839
Merge branch 'morganamilo/backup' into morganamilo/tip 2021-11-06 23:46:38 +00:00
morganamilo
40f59fd6ac
Merge branch 'morganamilo/email' into morganamilo/tip 2021-11-06 23:41:36 +00:00
morganamilo
3c68d11f3c
Merge branch 'morganamilo/qbackup' into morganamilo/tip 2021-11-06 23:41:29 +00:00
morganamilo
2200dd8797
Merge branch 'morganamilo/notes' into morganamilo/tip 2021-11-06 23:41:15 +00:00
morganamilo
c7c280115f
Merge branch 'morganamilo/noserver' into morganamilo/tip 2021-11-06 23:41:05 +00:00
morganamilo
564fd18c9a
Merge branch 'morganamilo/nolockdownload' into morganamilo/tip 2021-11-06 23:40:57 +00:00
morganamilo
5c55ef2db5
Merge branch 'morganamilo/nokeep' into morganamilo/tip 2021-11-06 23:40:45 +00:00
morganamilo
de5fb9ae2f
Merge branch 'morganamilo/nodownload' into morganamilo/tip 2021-11-06 23:40:34 +00:00
morganamilo
d4b4d315aa
Merge branch 'morganamilo/lint' into morganamilo/tip 2021-11-06 23:39:30 +00:00
morganamilo
97d127588e
Merge branch 'morganamilo/file_error' into morganamilo/tip 2021-11-06 23:39:17 +00:00
morganamilo
c301327ad5
pacman: implement universal transactions
This allows using -S, -U and -R in one command:

    pacman -S foo -R bar

To make this work some breaking changes have made.

Targets have to come after the operation:

    pacman -S foo  //works
    pacman -Syu    //works
    pacman -yuS    //works
    pacman foo -S  //doesn't work

This could be supported with some code to copy all targets before the
first operation into the first operation's target list.

And -u as a short for --unneeded has been removed as it conflicts with
--sysupgrade. However has -u/--sysupgrade is bound to -S, accidently
doing `pacman -Ru` will not accidently cause a system upgrade.

Another quirk with the ui is that -S has many non transaction related
flags, -Sc -Sg -Sl -Si. These have been split off as "sync only" flags.
Meaning they show up with `pacman -Si foo` but will be invalid on
`pacman -R bar -Si foo`.

Also when -R'ing and -S'ing the same package in come command it's
treated as a full uninstall then reinstall. The backup files are
.pacsave'd and the install reason is set to explicit. I feel like this
behavious is good. This also allows you to wipe config files which what
--nokeep was intending to solve.

Other flags just have to have the op they belong to to be used for them
to be valid.

For example:

    pacman -Rn foo //works
    pacman -S -Rn //works
    pacman -Sn    //doesn't work
    pacman -Sn -R //works

We could posibly drop these flags belonging to each operation and just
make them generic transaction flags.

Implements FS#9694
2021-11-06 23:29:07 +00:00
morganamilo
841236a1c9
pacman: improve backup printing
The current backup printing does not fit in with the rest of the info at
all. Change to be more consistant.

Old:

Backup Files    :
MODIFIED	/etc/pacman.conf
UNMODIFIED	/etc/makepkg.conf

New:

Backup Files    : /etc/pacman.conf [modified]
                  /etc/makepkg.conf [unmodified]

Signed-off-by: morganamilo <morganamilo@archlinux.org>
2021-10-23 22:50:39 +01:00
morganamilo
6ce85053c5
libalpm: allow nolock transactions when downloadonly 2021-10-23 22:19:46 +01:00
morganamilo
e877472509
makepkg: lint empty arrays
While depend arrays are already linted, many array kinds are
still not. An empty string is never a valid array value so check
all arrays for it.
2021-10-07 22:26:50 +01:00
morganamilo
2b4c022925
libalpm: add iterator interface for syncdb files
This commit adds an iterator interface for reading files from the
syncdbs. Instead of using alpm_pkg_get_files(), you now get the files
from the database using alpm_db_files_open(), you then use
alpm_db_files_next() to iterate through the files for each package. If
you want to actually load the files from that package you then use
alpm_db_files_load().

This means alpm_pkg_get_files() will always return empty for syncdbs,
even on .files databases, however these functions still work on the
localdb and loaded packages.

This aproach is faster when dumping the entire file list but slower when
searching for a specific package.

The memory usage of pacman is drastically less. See below.

build/pacman -Fl        0.55s user 0.01s system 99% cpu 0.556 total
build/pacman -Fl pacman 0.46s user 0.01s system 99% cpu 0.472 total
build/pacman -Fx pacman 2.88s user 0.09s system 99% cpu 2.965 total

pacman -Fl              1.60s user 0.13s system 99% cpu 1.731 total
pacman -Fl pacman       0.24s user 0.04s system 99% cpu 0.283 total
pacman -Fx pacman       2.45s user 0.14s system 99% cpu 2.593 total

                         Peak Memory
build/pacman -Fl         43.52MB
build/pacman -Fl pacmam  11.292MB

pacman -Fl               677.048MB
pacman -Fl pacman        163.288MB
2021-10-06 08:18:55 +01:00
morganamilo
689223f40d
alpm: don't download files from local servers
This causes file:// servers to be treated as if they were cache dirs
when checking if a package needs to be downloaded/read.
2021-10-04 20:11:24 +01:00
morganamilo
8d48332069
alpm: return -1 for error in find_dl_candidates
This is the error value generally used and the calling function
explicitly checks for -1, later causing the error to be missed
and the transaction to continue.

> pacman -S xterm
warning: xterm-369-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Package (1)  Old Version  New Version  Net Change  Download Size

extra/xterm  369-1        369-1          0.00 MiB       0.42 MiB

Total Download Size:   0.42 MiB
Total Installed Size:  1.05 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n]
error: no servers configured for repository: extra
(1/1) checking keys in keyring                                                                 [--------------------------------------------------------] 100%
(1/1) checking package integrity                                                               [--------------------------------------------------------] 100%
error: failed to commit transaction (wrong or NULL argument passed)
Errors occurred, no packages were upgraded.
2021-10-04 20:07:06 +01:00
morganamilo
a61c500557
pacman: add -Q --backup
pacman -Q -w/--backup will print the modified backup files of a system
(passing twice will print all backup files). This could be useful for
backup/moving system config files.
2021-10-02 00:12:52 +01:00
morganamilo
8fa9a69683
pactest: fix test errors being treated as success
Rules return -1 if there was an error with the rule itself. Later this
return value is passed to tap as a bool. Because -1 is a truthy value it
gets treated as success.
2021-09-27 21:46:13 +01:00
morganamilo
1340b5336e
pactest: add note tests 2021-09-27 21:46:10 +01:00
morganamilo
2b1ca6c298
pacman: add --note --rmnote
This adds --note for -S -U -D and --rmnote for -D
2021-09-27 21:46:07 +01:00
morganamilo
ef05b4e31e
alpm: add note support
Add support for adding a note to packages. This is intended to be set to
the user to document the reason or motive a package was installed.

Notes can be set for a transaction and only the targets of that
transaction gain the note.

Notes can also be edited for installed packages similarly to how install
reason can be set.
2021-09-27 21:46:04 +01:00
morganamilo
c7c88f880a
libalpm: check filecache_find return and log errors
Some user had erros while updating their system.

:: Proceed with installation? [Y/n]
:: Retrieving packages...
checking keyring...
checking package integrity...
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

The issue was filecache_find returning null and alpm passing that null
path to check validity. How this happened I have no idea. It may be
something to do with the user's cachedir being a network drive.

Also warn when the file exists but it is not a regular file or can not
be opened.
2021-09-27 18:30:17 +01:00
morganamilo
753083d241
Update mailing list url
change pacman-dev@archlinux.org to pacmandev@lists.archlinux.org

Most of this is copyright notices but this also fixes FS#72129 by
updating the address in docs/index.asciidoc.

---

I could also update the email in the .po files as it's a simple find and
replace but I'm not sure if that's strictly done via transifex.
2021-09-22 14:51:11 +01:00
morganamilo
36d3d8401c
pacman: move --nosave to transaction flags
--nosave is now useful when installing packages as it can be combined
with --nokeep to reinstall the packages backup files without generating
a pacsave.
2021-09-20 20:34:43 +01:00
morganamilo
ddcceb9314
pacman: add --nokeep 2021-09-20 20:34:40 +01:00
morganamilo
0c701af590
alpm: add ALPM_TRANS_FLAG_NOKEEP
this flag prevents backup files from being kept on package installation.
This is useful for resetting a package's config files back to their
original state.

Implements FS#59908 although with it's own flag name instead of reusing
nosave. This allows nokeep to optionally create a pacnew that you can
then choose to disable by also setting nosave.

---

I actually very dislike NOKEEP but it was the best I could come up with

I would have prefered overwrite or nosave but they are taken. Better
names are welcome.
2021-09-20 20:31:33 +01:00
197 changed files with 1884 additions and 1120 deletions

View file

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

View file

@ -210,6 +210,11 @@ Transaction Options (apply to '-S', '-R' and '-U')
dependencies are installed and there are no package conflicts in the
system. Specify this option twice to skip all dependency checks.
*-n, \--nosave*::
Instructs pacman to ignore file backup designations. Normally, when a
file is removed from the system, the database is checked to see if the
file should be renamed with a '.pacsave' extension.
*\--assume-installed* <package=version>::
Add a virtual package "package" with version "version" to the transaction
to satisfy dependencies. This allows to disable specific dependency checks
@ -256,6 +261,12 @@ Upgrade Options (apply to '-S' and '-U')[[UO]]
as explicitly installed so it will not be removed by the '\--recursive'
remove operation.
*\--note*::
Add an install note to packages. This will only apply to targets explicitly
listed and not their dependencies. The note can be used to keep track of why
a package was installed or any other info of note. The note can later be
edited or removed with '\--D \--note' or '\--D \--rmnote' respectively.
*\--ignore* <package>::
Directs pacman to ignore upgrades of package even if there is one
available. Multiple packages can be specified by separating them
@ -269,6 +280,9 @@ Upgrade Options (apply to '-S' and '-U')[[UO]]
*\--needed*::
Do not reinstall the targets that are already up-to-date.
*\--nokeep*::
Overwrite backup files when installing packages.
*\--overwrite* <glob>::
Bypass file conflict checks and overwrite conflicting files. If the
package that is about to be installed contains files that are already
@ -364,6 +378,9 @@ Query Options (apply to '-Q')[[QO]]
replacements are not checked here. This option works best if the sync
database is refreshed using '-Sy'.
*-w, \--backup*::
List all modified backup files owened by a given package. Multiple packages can
be specified on the command line. Pass twice to print all backup files.
Remove Options (apply to '-R')[[RO]]
------------------------------------
@ -372,11 +389,6 @@ Remove Options (apply to '-R')[[RO]]
or more target packages. This operation is recursive and must be used
with care, since it can remove many potentially needed packages.
*-n, \--nosave*::
Instructs pacman to ignore file backup designations. Normally, when a
file is removed from the system, the database is checked to see if the
file should be renamed with a '.pacsave' extension.
*-s, \--recursive*::
Remove each target specified including all of their dependencies, provided
that (A) they are not required by other packages; and (B) they were not
@ -468,6 +480,13 @@ Database Options (apply to '-D')[[QO]]
package installed even when it was initially installed as a dependency
of another package.
*\--note*::
Add or edit a package's install note. The note can be used to keep track of why
a package was installed or any other info of note.
*\--rmnote*::
Remove a package's install note.
*-k, \--check*::
Check the local package database is internally consistent. This will
check all required files are present and that installed packages have

View file

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

View file

@ -1,7 +1,7 @@
/*
* add.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
@ -431,8 +431,22 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
ASSERT(trans != NULL, return -1);
if(_alpm_db_get_pkgfromcache(db, newpkg->name)) {
oldpkg = newpkg->oldpkg;
}
/* set note on package only if it was explicitly added to transaction */
if(trans->note && newpkg->reason == ALPM_PKG_REASON_EXPLICIT) {
STRDUP(newpkg->note, trans->note,
RET_ERR(handle, ALPM_ERR_MEMORY, -1));
} else if(oldpkg && oldpkg->note) {
STRDUP(newpkg->note,oldpkg->note,
RET_ERR(handle, ALPM_ERR_MEMORY, -1));
}
if(oldpkg) {
/* see if this is an upgrade. if so, remove the old package first */
if(_alpm_db_get_pkgfromcache(db, newpkg->name) && (oldpkg = newpkg->oldpkg)) {
int cmp = _alpm_pkg_compare_versions(newpkg, oldpkg);
if(cmp < 0) {
log_msg = "downgrading";

View file

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

View file

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

View file

@ -1,7 +1,7 @@
/*
* alpm.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@ -101,6 +101,11 @@ typedef struct _alpm_handle_t alpm_handle_t;
typedef struct _alpm_db_t alpm_db_t;
/** A Database file iterator
* @ingroup libalpm_databases
*/
typedef struct __alpm_db_files_t alpm_db_files_t;
/** A package.
*
* A package can be loaded from disk via \link alpm_pkg_load \endlink or retrieved from a database.
@ -158,6 +163,9 @@ typedef struct _alpm_backup_t {
*/
alpm_file_t *alpm_filelist_contains(alpm_filelist_t *filelist, const char *path);
/** Frees a file list */
void alpm_filelist_free(alpm_filelist_t *files);
/* End of libalpm_files */
/** @} */
@ -1281,6 +1289,12 @@ int alpm_unregister_all_syncdbs(alpm_handle_t *handle);
*/
int alpm_db_unregister(alpm_db_t *db);
/** Get the handle of a package database.
* @param db pointer to the package database
* @return the alpm handle that the package database belongs to
*/
alpm_handle_t *alpm_db_get_handle(alpm_db_t *db);
/** Get the name of a package database.
* @param db pointer to the package database
* @return the name of the package database, NULL on error
@ -1444,6 +1458,42 @@ int alpm_db_get_usage(alpm_db_t *db, int *usage);
/* End of usage accessors */
/** @} */
/** @name File iterators
* @{
*/
/** Opens a handle to the db files iterator.
* @param db the db files to iterate over
* @return handle to the iterator
*/
alpm_db_files_t *alpm_db_files_open(alpm_db_t *db);
/** Goes to the next package.
* @param files handle to the file iterator
* @param pkgname stores the pkgname of the current package
* @return 0 on success, 1 if end of iterator, -1 on error
*/
int alpm_db_files_next(alpm_db_files_t *files, char** pkgname);
/** Loads the files for a package into a file list.
*
* This extends the file list as needed, reusing the memory alloced.
* You can reuse the same file list for calls to this function but
* the list should be freed with \link alpm_filelist_free alpm_filelist_free \endlink
* after use.
* @param files handle to the file iterator
* @param filelist the filelist to load files into
* @return 0 on success, -1 on error
*/
int alpm_db_files_load(alpm_db_files_t *files, alpm_filelist_t *filelist);
/** Close the db file iterator
* @param files handle to the file iterator
*/
void alpm_db_files_close(alpm_db_files_t *files);
/* End of file iterators */
/** @} */
/* End of libalpm_databases */
/** @} */
@ -2386,6 +2436,12 @@ int alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg);
* @{
*/
/** Gets the handle of a package
* @param pkg a pointer to package
* @return the alpm handle that the package belongs to
*/
alpm_handle_t *alpm_pkg_get_handle(alpm_pkg_t *pkg);
/** Gets the name of the file from which the package was loaded.
* @param pkg a pointer to package
* @return a reference to an internal string
@ -2429,6 +2485,12 @@ const char *alpm_pkg_get_desc(alpm_pkg_t *pkg);
*/
const char *alpm_pkg_get_url(alpm_pkg_t *pkg);
/** Returns the package note.
* @param pkg a pointer to package
* @return a reference to an internal string
*/
char *alpm_pkg_get_note(alpm_pkg_t *pkg);
/** Returns the build timestamp of the package.
* @param pkg a pointer to package
* @return the timestamp of the build time
@ -2607,6 +2669,15 @@ off_t alpm_pkg_download_size(alpm_pkg_t *newpkg);
*/
int alpm_pkg_set_reason(alpm_pkg_t *pkg, alpm_pkgreason_t reason);
/** Set install note for a package in the local database.
* The provided package object must be from the local database or this method
* will fail. The write to the local database is performed immediately.
* @param pkg the package to edit
* @param note the new install note, null to remove a note
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int alpm_pkg_set_note(alpm_pkg_t *pkg, char *note);
/* End of libalpm_pkg_t accessors */
/** @} */
@ -2678,7 +2749,6 @@ int alpm_pkg_mtree_close(const alpm_pkg_t *pkg, struct archive *archive);
/* End of mtree accessors */
/** @} */
/* End of libalpm_packages */
/** @} */
@ -2704,7 +2774,8 @@ int alpm_pkg_mtree_close(const alpm_pkg_t *pkg, struct archive *archive);
typedef enum _alpm_transflag_t {
/** Ignore dependency checks. */
ALPM_TRANS_FLAG_NODEPS = 1,
/* (1 << 1) flag can go here */
/** Don't keep backup files when installing packages. */
ALPM_TRANS_FLAG_NOKEEP = (1 << 1),
/** Delete files even if they are tagged as backup. */
ALPM_TRANS_FLAG_NOSAVE = (1 << 2),
/** Ignore version numbers when checking dependencies. */
@ -2756,6 +2827,16 @@ alpm_list_t *alpm_trans_get_add(alpm_handle_t *handle);
*/
alpm_list_t *alpm_trans_get_remove(alpm_handle_t *handle);
/** Sets the install note for a transaction
*
* All target packages will gain the note, dependencies will not.
*
* @param handle the context handle
* @note the the note, may not contain new lines
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int alpm_trans_set_note(alpm_handle_t *handle, char *note);
/** Initialize the transaction.
* @param handle the context handle
* @param flags flags of the transaction (like nodeps, etc; see alpm_transflag_t)

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
/*
* be_local.c : backend for the local database
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
@ -81,6 +81,12 @@ static const char *_cache_get_url(alpm_pkg_t *pkg)
return pkg->url;
}
static char *_cache_get_note(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_DESC);
return pkg->note;
}
static alpm_time_t _cache_get_builddate(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_DESC);
@ -330,6 +336,7 @@ static const struct pkg_operations local_pkg_ops = {
.get_base = _cache_get_base,
.get_desc = _cache_get_desc,
.get_url = _cache_get_url,
.get_note = _cache_get_note,
.get_builddate = _cache_get_builddate,
.get_installdate = _cache_get_installdate,
.get_packager = _cache_get_packager,
@ -752,6 +759,8 @@ static int local_db_read(alpm_pkg_t *info, int inforeq)
READ_AND_STORE_ALL(info->groups);
} else if(strcmp(line, "%URL%") == 0) {
READ_AND_STORE(info->url);
} else if(strcmp(line, "%NOTE%") == 0) {
READ_AND_STORE(info->note);
} else if(strcmp(line, "%LICENSE%") == 0) {
READ_AND_STORE_ALL(info->licenses);
} else if(strcmp(line, "%ARCH%") == 0) {
@ -1040,6 +1049,11 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, int inforeq)
write_deps(fp, "%CONFLICTS%", info->conflicts);
write_deps(fp, "%PROVIDES%", info->provides);
if(info->note) {
fprintf(fp, "%%NOTE%%\n"
"%s\n\n", info->note);
}
fclose(fp);
fp = NULL;
}
@ -1158,6 +1172,31 @@ int SYMEXPORT alpm_pkg_set_reason(alpm_pkg_t *pkg, alpm_pkgreason_t reason)
return 0;
}
int SYMEXPORT alpm_pkg_set_note(alpm_pkg_t *pkg, char *note)
{
ASSERT(pkg != NULL, return -1);
ASSERT(pkg->origin == ALPM_PKG_FROM_LOCALDB,
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
ASSERT(pkg->origin_data.db == pkg->handle->db_local,
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
_alpm_log(pkg->handle, ALPM_LOG_DEBUG,
"setting note for %s: %s\n", pkg->name, note);
LAZY_LOAD(INFRQ_DESC);
FREE(pkg->note);
if(note) {
ASSERT(!strchr(note, '\n'), RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
STRDUP(pkg->note, note,
RET_ERR(pkg->handle, ALPM_ERR_MEMORY, -1));
}
/* write DESC */
if(_alpm_local_db_write(pkg->handle->db_local, pkg, INFRQ_DESC)) {
RET_ERR(pkg->handle, ALPM_ERR_DB_WRITE, -1);
}
return 0;
}
static const struct db_operations local_db_ops = {
.validate = local_db_validate,
.populate = local_db_populate,

View file

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

View file

@ -1,7 +1,7 @@
/*
* be_sync.c : backend for sync databases
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
@ -566,8 +566,7 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
return 0;
}
if(strcmp(filename, "desc") == 0 || strcmp(filename, "depends") == 0
|| strcmp(filename, "files") == 0) {
if(strcmp(filename, "desc") == 0 || strcmp(filename, "depends") == 0) {
int ret;
while((ret = _alpm_archive_fgets(archive, &buf)) == ARCHIVE_OK) {
char *line = buf.line;
@ -636,36 +635,6 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
READ_AND_SPLITDEP(pkg->conflicts);
} else if(strcmp(line, "%PROVIDES%") == 0) {
READ_AND_SPLITDEP(pkg->provides);
} else if(strcmp(line, "%FILES%") == 0) {
/* TODO: this could lazy load if there is future demand */
size_t files_count = 0, files_size = 0;
alpm_file_t *files = NULL;
while(1) {
if(_alpm_archive_fgets(archive, &buf) != ARCHIVE_OK) {
goto error;
}
line = buf.line;
if(_alpm_strip_newline(line, buf.real_line_size) == 0) {
break;
}
if(!_alpm_greedy_grow((void **)&files, &files_size,
(files_count ? (files_count + 1) * sizeof(alpm_file_t) : 8 * sizeof(alpm_file_t)))) {
goto error;
}
STRDUP(files[files_count].name, line, goto error);
files_count++;
}
/* attempt to hand back any memory we don't need */
if(files_count > 0) {
REALLOC(files, sizeof(alpm_file_t) * files_count, (void)0);
} else {
FREE(files);
}
pkg->files.count = files_count;
pkg->files.files = files;
_alpm_filelist_sort(&pkg->files);
}
}
if(ret != ARCHIVE_EOF) {
@ -716,3 +685,152 @@ alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
handle->dbs_sync = alpm_list_add(handle->dbs_sync, db);
return db;
}
static int load_files(struct archive *archive, alpm_filelist_t *filelist)
{
struct archive_read_buffer buf = {0};
/* 512K for a line length seems reasonable */
buf.max_line_size = 512 * 1024;
_alpm_filelist_truncate(filelist);
int ret;
while((ret = _alpm_archive_fgets(archive, &buf)) == ARCHIVE_OK) {
char *line = buf.line;
if(_alpm_strip_newline(line, buf.real_line_size) == 0) {
/* length of stripped line was zero */
continue;
}
if(strcmp(line, "%FILES%") == 0) {
size_t files_size = 0;
while(1) {
if(_alpm_archive_fgets(archive, &buf) != ARCHIVE_OK) {
goto error;
}
line = buf.line;
if(_alpm_strip_newline(line, buf.real_line_size) == 0) {
break;
}
if(!_alpm_greedy_grow((void **)&filelist->files, &files_size,
(filelist->count ? (filelist->count + 1) * sizeof(alpm_file_t) : 8 * sizeof(alpm_file_t)))) {
goto error;
}
STRDUP(filelist->files[filelist->count].name, line, goto error);
filelist->count++;
}
_alpm_filelist_sort(filelist);
}
}
if(ret != ARCHIVE_EOF) {
goto error;
}
return 0;
error:
return -1;
}
alpm_db_files_t SYMEXPORT *alpm_db_files_open(alpm_db_t *db)
{
const char *dbpath;
int fd;
struct stat buf;
struct archive *archive;
alpm_db_files_t *files = NULL;
ASSERT(db != NULL, return NULL);
dbpath = _alpm_db_path(db);
if(!dbpath) {
/* pm_errno set in _alpm_db_path() */
return NULL;
}
if(db->status & DB_STATUS_INVALID || db->status & DB_STATUS_MISSING) {
return NULL;
}
fd = _alpm_open_archive(db->handle, dbpath, &buf,
&archive, ALPM_ERR_DB_OPEN);
if(fd < 0) {
db->status &= ~DB_STATUS_VALID;
db->status |= DB_STATUS_INVALID;
_alpm_archive_read_free(archive);
return NULL;
}
MALLOC(files, sizeof(alpm_db_files_t), RET_ERR(db->handle, ALPM_ERR_MEMORY, NULL));
files->archive = archive;
files->fd = fd;
files->db = db;
return files;
}
int SYMEXPORT alpm_db_files_next(alpm_db_files_t *files, char** pkgname)
{
struct archive_entry *entry;
const char *entryname;
int archive_ret;
char *filename;
ASSERT(files != NULL, return -1);
ASSERT(pkgname != NULL, return -1);
while((archive_ret = archive_read_next_header(files->archive, &entry)) == ARCHIVE_OK) {
mode_t mode = archive_entry_mode(entry);
if(!S_ISDIR(mode)) {
entryname = archive_entry_pathname(entry);
if(entryname == NULL) {
_alpm_log(files->db->handle, ALPM_LOG_DEBUG,
"invalid archive entry provided to alpm_db_files_next, skipping\n");
return -1;
}
if(_alpm_splitname(entryname, pkgname, NULL, NULL) != 0) {
_alpm_log(files->db->handle, ALPM_LOG_ERROR,
_("invalid name for database entry '%s'\n"), entryname);
return -1;
}
filename = strrchr(entryname, '/');
filename++;
/* we only want to read the file list */
if(filename && strcmp(filename, "files") == 0) {
return 0;
}
}
}
if(archive_ret != ARCHIVE_EOF) {
return -1;
}
return 1;
}
int SYMEXPORT alpm_db_files_load(alpm_db_files_t *files, alpm_filelist_t *filelist)
{
ASSERT(files != NULL, return -1);
ASSERT(filelist != NULL, return -1);
_alpm_filelist_truncate(filelist);
if(load_files(files->archive, filelist) != 0) {
_alpm_log(files->db->handle, ALPM_LOG_ERROR,
_("could not parse package description file '%s' from db '%s'\n"),
"files", files->db->treename);
return -1;
}
return 0;
}
void SYMEXPORT alpm_db_files_close(alpm_db_files_t *files)
{
ASSERT(files != NULL, return);
_alpm_archive_read_free(files->archive);
close(files->fd);
free(files);
}

View file

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

View file

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

View file

@ -1,7 +1,7 @@
/*
* db.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@ -212,6 +212,12 @@ int SYMEXPORT alpm_db_remove_server(alpm_db_t *db, const char *url)
return ret;
}
alpm_handle_t SYMEXPORT *alpm_db_get_handle(alpm_db_t *db)
{
ASSERT(db != NULL, return NULL);
return db->handle;
}
const char SYMEXPORT *alpm_db_get_name(const alpm_db_t *db)
{
ASSERT(db != NULL, return NULL);
@ -405,6 +411,7 @@ int _alpm_db_search(alpm_db_t *db, const alpm_list_t *needles,
const char *matched = NULL;
const char *name = pkg->name;
const char *desc = alpm_pkg_get_desc(pkg);
const char *note = alpm_pkg_get_note(pkg);
/* check name as regex AND as plain text */
if(name && (regexec(&reg, name, 0, 0, 0) == 0 || strstr(name, targ))) {
@ -414,6 +421,11 @@ int _alpm_db_search(alpm_db_t *db, const alpm_list_t *needles,
else if(desc && regexec(&reg, desc, 0, 0, 0) == 0) {
matched = desc;
}
/* check note */
else if(note && regexec(&reg, note, 0, 0, 0) == 0) {
matched = note;
}
/* TODO: should we be doing this, and should we print something
* differently when we do match it since it isn't currently printed? */
if(!matched) {

View file

@ -1,7 +1,7 @@
/*
* db.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
@ -61,6 +61,13 @@ struct db_operations {
void (*unregister) (alpm_db_t *);
};
/* Database files iterator */
struct __alpm_db_files_t {
struct archive *archive;
int fd;
alpm_db_t *db;
};
/* Database */
struct _alpm_db_t {
alpm_handle_t *handle;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
/*
* filelist.c
*
* Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -145,3 +145,17 @@ void _alpm_filelist_sort(alpm_filelist_t *filelist)
}
}
}
void _alpm_filelist_truncate(alpm_filelist_t *files)
{
for(size_t i = 0; i < files->count; i++) {
FREE(files->files[i].name);
}
files->count = 0;
}
void SYMEXPORT alpm_filelist_free(alpm_filelist_t *files)
{
_alpm_filelist_truncate(files);
free(files->files);
}

View file

@ -1,7 +1,7 @@
/*
* filelist.h
*
* Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -28,5 +28,6 @@ alpm_list_t *_alpm_filelist_intersection(alpm_filelist_t *filesA,
alpm_filelist_t *filesB);
void _alpm_filelist_sort(alpm_filelist_t *filelist);
void _alpm_filelist_truncate(alpm_filelist_t *filelist);
#endif /* ALPM_FILELIST_H */

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
/*
* package.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005, 2006 by Christian Hamar <krics@linuxforum.hu>
@ -57,7 +57,7 @@ int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg)
ASSERT(pkg->origin == ALPM_PKG_FROM_SYNCDB,
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
fpath = _alpm_filecache_find(pkg->handle, pkg->filename);
fpath = _alpm_cache_find_pkg(pkg, 0);
retval = _alpm_test_checksum(fpath, pkg->md5sum, ALPM_PKG_VALIDATION_MD5SUM);
@ -78,6 +78,7 @@ int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg)
static const char *_pkg_get_base(alpm_pkg_t *pkg) { return pkg->base; }
static const char *_pkg_get_desc(alpm_pkg_t *pkg) { return pkg->desc; }
static const char *_pkg_get_url(alpm_pkg_t *pkg) { return pkg->url; }
static char *_pkg_get_note(alpm_pkg_t *pkg) { return pkg->note; }
static alpm_time_t _pkg_get_builddate(alpm_pkg_t *pkg) { return pkg->builddate; }
static alpm_time_t _pkg_get_installdate(alpm_pkg_t *pkg) { return pkg->installdate; }
static const char *_pkg_get_packager(alpm_pkg_t *pkg) { return pkg->packager; }
@ -99,6 +100,7 @@ static alpm_list_t *_pkg_get_replaces(alpm_pkg_t *pkg) { return pkg->replaces;
static alpm_filelist_t *_pkg_get_files(alpm_pkg_t *pkg) { return &(pkg->files); }
static alpm_list_t *_pkg_get_backup(alpm_pkg_t *pkg) { return pkg->backup; }
static void *_pkg_changelog_open(alpm_pkg_t UNUSED *pkg)
{
return NULL;
@ -142,6 +144,7 @@ const struct pkg_operations default_pkg_ops = {
.get_base = _pkg_get_base,
.get_desc = _pkg_get_desc,
.get_url = _pkg_get_url,
.get_note = _pkg_get_note,
.get_builddate = _pkg_get_builddate,
.get_installdate = _pkg_get_installdate,
.get_packager = _pkg_get_packager,
@ -191,6 +194,13 @@ const char SYMEXPORT *alpm_pkg_get_base(alpm_pkg_t *pkg)
return pkg->ops->get_base(pkg);
}
alpm_handle_t SYMEXPORT *alpm_pkg_get_handle(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = ALPM_ERR_OK;
return pkg->handle;
}
const char SYMEXPORT *alpm_pkg_get_name(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
@ -226,6 +236,13 @@ const char SYMEXPORT *alpm_pkg_get_url(alpm_pkg_t *pkg)
return pkg->ops->get_url(pkg);
}
char SYMEXPORT *alpm_pkg_get_note(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = ALPM_ERR_OK;
return pkg->ops->get_note(pkg);
}
alpm_time_t SYMEXPORT alpm_pkg_get_builddate(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return -1);
@ -283,7 +300,7 @@ int SYMEXPORT alpm_pkg_get_sig(alpm_pkg_t *pkg, unsigned char **sig, size_t *sig
alpm_errno_t err;
int ret = -1;
pkgpath = _alpm_filecache_find(pkg->handle, pkg->filename);
pkgpath = _alpm_cache_find_pkg(pkg, 0);
if(!pkgpath) {
GOTO_ERR(pkg->handle, ALPM_ERR_PKG_NOT_FOUND, cleanup);
}
@ -610,6 +627,7 @@ int _alpm_pkg_dup(alpm_pkg_t *pkg, alpm_pkg_t **new_ptr)
STRDUP(newpkg->version, pkg->version, goto cleanup);
STRDUP(newpkg->desc, pkg->desc, goto cleanup);
STRDUP(newpkg->url, pkg->url, goto cleanup);
STRDUP(newpkg->note, pkg->note, goto cleanup);
newpkg->builddate = pkg->builddate;
newpkg->installdate = pkg->installdate;
STRDUP(newpkg->packager, pkg->packager, goto cleanup);
@ -683,6 +701,7 @@ void _alpm_pkg_free(alpm_pkg_t *pkg)
FREE(pkg->version);
FREE(pkg->desc);
FREE(pkg->url);
FREE(pkg->note);
FREE(pkg->packager);
FREE(pkg->md5sum);
FREE(pkg->sha256sum);

View file

@ -1,7 +1,7 @@
/*
* package.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
@ -46,6 +46,7 @@ struct pkg_operations {
const char *(*get_base) (alpm_pkg_t *);
const char *(*get_desc) (alpm_pkg_t *);
const char *(*get_url) (alpm_pkg_t *);
char *(*get_note) (alpm_pkg_t *);
alpm_time_t (*get_builddate) (alpm_pkg_t *);
alpm_time_t (*get_installdate) (alpm_pkg_t *);
const char *(*get_packager) (alpm_pkg_t *);
@ -93,6 +94,7 @@ struct _alpm_pkg_t {
char *version;
char *desc;
char *url;
char *note;
char *packager;
char *md5sum;
char *sha256sum;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
/*
* sync.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@ -323,7 +323,7 @@ static int compute_download_size(alpm_pkg_t *newpkg)
ASSERT(newpkg->filename != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1));
fname = newpkg->filename;
fpath = _alpm_filecache_find(handle, fname);
fpath = _alpm_cache_find_pkg(newpkg, 0);
/* downloaded file exists, so there's nothing to grab */
if(fpath) {
@ -333,7 +333,7 @@ static int compute_download_size(alpm_pkg_t *newpkg)
CALLOC(fnamepart, strlen(fname) + 6, sizeof(char), return -1);
sprintf(fnamepart, "%s.part", fname);
fpath = _alpm_filecache_find(handle, fnamepart);
fpath = _alpm_cache_find_pkg(newpkg, 1);
if(fpath) {
struct stat st;
if(stat(fpath, &st) == 0) {
@ -732,26 +732,18 @@ static int find_dl_candidates(alpm_handle_t *handle, alpm_list_t **files)
handle->pm_errno = ALPM_ERR_SERVER_NONE;
_alpm_log(handle, ALPM_LOG_ERROR, "%s: %s\n",
alpm_strerror(handle->pm_errno), repo->treename);
return 1;
return -1;
}
ASSERT(spkg->filename != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1));
need_download = spkg->download_size != 0 || !_alpm_filecache_exists(handle, spkg->filename);
need_download = spkg->download_size != 0 || !_alpm_cache_pkg_exists(spkg, 0);
/* even if the package file in the cache we need to check for
* accompanion *.sig file as well.
* If *.sig is not cached then force download the package + its signature file.
*/
if(!need_download && (siglevel & ALPM_SIG_PACKAGE)) {
char *sig_filename = NULL;
int len = strlen(spkg->filename) + 5;
MALLOC(sig_filename, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(sig_filename, len, "%s.sig", spkg->filename);
need_download = !_alpm_filecache_exists(handle, sig_filename);
FREE(sig_filename);
need_download = !_alpm_cache_pkg_exists(spkg, 1);
}
if(need_download) {
@ -990,7 +982,14 @@ static int check_validity(alpm_handle_t *handle,
}
current_bytes += v.pkg->size;
v.path = _alpm_filecache_find(handle, v.pkg->filename);
v.path = _alpm_cache_find_pkg(v.pkg, 0);
if(!v.path) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: could not find package in cache\n"), v.pkg->name);
RET_ERR(handle, ALPM_ERR_PKG_NOT_FOUND, -1);
}
v.siglevel = alpm_db_get_siglevel(alpm_pkg_get_db(v.pkg));
if(_alpm_pkg_validate_internal(handle, v.path, v.pkg,
@ -1080,7 +1079,14 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data,
}
current_bytes += spkg->size;
filepath = _alpm_filecache_find(handle, spkg->filename);
filepath = _alpm_cache_find_pkg(spkg, 0);
if(!filepath) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: could not find package in cache\n"), spkg->name);
RET_ERR(handle, ALPM_ERR_PKG_NOT_FOUND, -1);
}
/* load the package file and replace pkgcache entry with it in the target list */
/* TODO: alpm_pkg_get_db() will not work on this target anymore */

View file

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

View file

@ -1,7 +1,7 @@
/*
* trans.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@ -177,7 +177,8 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
ASSERT(trans != NULL, RET_ERR(handle, ALPM_ERR_TRANS_NULL, -1));
ASSERT(trans->state == STATE_PREPARED, RET_ERR(handle, ALPM_ERR_TRANS_NOT_PREPARED, -1));
ASSERT(!(trans->flags & ALPM_TRANS_FLAG_NOLOCK), RET_ERR(handle, ALPM_ERR_TRANS_NOT_LOCKED, -1));
ASSERT(!(trans->flags & ALPM_TRANS_FLAG_NOLOCK && !(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY)),
RET_ERR(handle, ALPM_ERR_TRANS_NOT_LOCKED, -1));
/* If there's nothing to do, return without complaining */
if(trans->add == NULL && trans->remove == NULL) {
@ -298,6 +299,7 @@ void _alpm_trans_free(alpm_trans_t *trans)
alpm_list_free(trans->add);
alpm_list_free_inner(trans->remove, (alpm_list_fn_free)_alpm_pkg_free);
alpm_list_free(trans->remove);
FREE(trans->note);
FREELIST(trans->skip_remove);
@ -450,3 +452,19 @@ alpm_list_t SYMEXPORT *alpm_trans_get_remove(alpm_handle_t *handle)
return handle->trans->remove;
}
int SYMEXPORT alpm_trans_set_note(alpm_handle_t *handle, char *note) {
CHECK_HANDLE(handle, return -1);
ASSERT(handle->trans != NULL, RET_ERR(handle, ALPM_ERR_TRANS_NULL, -1));
ASSERT(handle->trans->state == STATE_INITIALIZED, RET_ERR(handle, ALPM_ERR_TRANS_NOT_INITIALIZED, -1));
if(handle->trans->note) {
ASSERT(!strchr(handle->trans->note, '\n'), RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1));
free(handle->trans->note);
handle->trans->note = NULL;
}
STRDUP(handle->trans->note, note, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* trans.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@ -39,6 +39,7 @@ typedef enum _alpm_transstate_t {
typedef struct _alpm_trans_t {
/* bitfield of alpm_transflag_t flags */
int flags;
char *note;
alpm_transstate_t state;
alpm_list_t *unresolvable; /* list of (alpm_pkg_t *) */
alpm_list_t *add; /* list of (alpm_pkg_t *) */

View file

@ -1,7 +1,7 @@
/*
* util.c
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@ -815,6 +815,37 @@ int _alpm_str_cmp(const void *s1, const void *s2)
return strcmp(s1, s2);
}
char *_alpm_cache_find_pkg(alpm_pkg_t *pkg, int sig) {
alpm_handle_t *handle = pkg->handle;
struct stat buf;
alpm_list_t *servers = pkg->origin_data.db->servers;
char *retpath;
char filepath[PATH_MAX];
for(alpm_list_t *j = servers; j; j = j->next) {
char *server = j->data;
if(strncmp("file://", server, strlen("file://")) == 0) {
int len = strlen(server) - strlen("file://") + 1 + strlen(pkg->filename) + 1;
if(sig) {
len += strlen(".sig");
snprintf(filepath, len, "%s/%s", server + strlen("file://"), pkg->filename);
} else {
snprintf(filepath, len, "%s/%s.sig", server + strlen("file://"), pkg->filename);
}
if(stat(filepath, &buf) == 0 && S_ISREG(buf.st_mode)) {
STRDUP(retpath, filepath, RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
_alpm_log(handle, ALPM_LOG_DEBUG, "found pkg in repo cache: %s\n", retpath);
return retpath;
}
}
}
return _alpm_filecache_find(handle, pkg->filename);
}
/** Find a filename in a registered alpm cachedir.
* @param handle the context handle
* @param filename name of file to find
@ -831,10 +862,17 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename)
for(i = handle->cachedirs; i; i = i->next) {
snprintf(path, PATH_MAX, "%s%s", (char *)i->data,
filename);
if(stat(path, &buf) == 0 && S_ISREG(buf.st_mode)) {
if(stat(path, &buf) == 0) {
if(S_ISREG(buf.st_mode)) {
retpath = strdup(path);
_alpm_log(handle, ALPM_LOG_DEBUG, "found cached pkg: %s\n", retpath);
return retpath;
} else {
_alpm_log(handle, ALPM_LOG_WARNING,
"cached pkg '%s' is not a regular file: mode=%i\n", path, buf.st_mode);
}
} else if(errno != ENOENT) {
_alpm_log(handle, ALPM_LOG_WARNING, "could not open '%s'\n: %s", path, strerror(errno));
}
}
/* package wasn't found in any cachedir */
@ -846,10 +884,10 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename)
* @param filename name of file to find
* @return 0 if the filename was not found, 1 otherwise
*/
int _alpm_filecache_exists(alpm_handle_t *handle, const char *filename)
int _alpm_cache_pkg_exists(alpm_pkg_t *pkg, int sig)
{
int res;
char *fpath = _alpm_filecache_find(handle, filename);
char *fpath = _alpm_cache_find_pkg(pkg, sig);
res = (fpath != NULL);
FREE(fpath);
return res;

View file

@ -1,7 +1,7 @@
/*
* util.h
*
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2006-2021 Pacman Development Team <pacman-dev@lists.archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@ -133,9 +133,10 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
_alpm_cb_io in_cb, void *in_ctx);
int _alpm_ldconfig(alpm_handle_t *handle);
int _alpm_str_cmp(const void *s1, const void *s2);
char *_alpm_cache_find_pkg(alpm_pkg_t *pkg, int sig);
char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename);
/* Checks whether a file exists in cache */
int _alpm_filecache_exists(alpm_handle_t *handle, const char *filename);
int _alpm_cache_pkg_exists(alpm_pkg_t *pkg, int sig);
const char *_alpm_filecache_setup(alpm_handle_t *handle);
/* Unlike many uses of alpm_pkgvalidation_t, _alpm_test_checksum expects
* an enum value rather than a bitfield. */

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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