1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-11 11:55:12 -05:00
Commit Graph

6152 Commits

Author SHA1 Message Date
Andrew Gregory
a5759cb0d7 add hook tests
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:24 +10:00
Andrew Gregory
b76409609c pactest: add hook/script support
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:24 +10:00
Andrew Gregory
4ceb1c5bf9 util.py: return the created path
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:23 +10:00
Andrew Gregory
60ebee7a6e pactest: use pacman --hookdir option
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:23 +10:00
Andrew Gregory
7000bf9198 pacman: add user hook directories
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:23 +10:00
Andrew Gregory
e8e872c8f9 validate hooks after parsing
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:23 +10:00
Andrew Gregory
16718a216e run hooks during trans_commit
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:23 +10:00
Andrew Gregory
568a89d580 add hook data types and parser
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:23 +10:00
Andrew Gregory
c261210ccf handle: add hookdirs option
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:23 +10:00
Pierre Neidhardt
46a1ac6429 PKGBUILD.5: post_*() are functions, not scripts
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:23 +10:00
Allan McRae
e8deba3b87 makepkg: remove ability to build individual packages
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-23 01:02:23 +10:00
Allan McRae
0adb74b293 libmakepkg: remove declaration of unused local variables
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-22 16:11:32 +10:00
Allan McRae
dd3fe853b3 libmakepkg: return 1 on error in arch array
The return value was being assigned when an error was found in a PKGBUILD's
arch array but it never was returned.

Also remove error message explaining about adding the arch array to a PKGBUILD.
That was added a long time ago when the arch array first became compulsory.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-22 16:06:29 +10:00
Allan McRae
19e61a9e07 libmakepkg: update .gitignore
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-22 15:11:52 +10:00
Allan McRae
be503c6eac makepkg: remove FORCE_VER variable
This variable is no longer in VCS building.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-22 14:54:03 +10:00
Andrew Gregory
6946d7d1b7 check fileconflicts and diskspace outside commit
This is necessary in order to be able to run PreTransaction hooks as
close to the actual commit as possible so that we don't prematurely run
hooks for a transaction that ultimately never happens.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-20 17:36:53 +10:00
Andrew Gregory
af747ef34a move ini parser into common
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-20 17:36:53 +10:00
Andrew Gregory
edbe6c2bdc move strtrim to util-common
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-20 17:36:27 +10:00
Andrew Gregory
75fe6ef104 sortbydeps: skip local packages being updated
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-19 15:12:35 +10:00
Allan McRae
486643083c libmakepkg: check if PKGBUILD variables are arrays or not as appropriate
When extracting variables from PKGBUILD (e.g. for .SRCINFO creation) we make
assumptions about whether variables are arrays or not.  This adds a check to
the PKGBUILD linter to ensure variables are arrays or not as appropriate.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-07 11:22:00 +10:00
Allan McRae
1586b23080 libmakepkg: util/pkgbuild.sh needs processing on build
pkgbuild.sh contained @DEBUGSUFFIX@ and so needs to be run through the sed
command on build.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-07 11:21:59 +10:00
Allan McRae
ec50ec8a15 pacman.8: Consistently refer to the package database
We use "package database" everywhere apart from in the description of "-y".

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-07 11:21:58 +10:00
Sebastian Lackner
5780350751 libalpm: Force update when database is marked as corrupted.
When a database and its signature is updated non-atomically on a server,
there is a window where a user may update the database but grab the old
signature.  The database is marked as invalid by libalpm, which can be
fixed by forcing a refresh (assuming the server has caught up and the
user realizes what has happened) or with a future update of the repo.
Work around this by forcing a repository refresh whenever a database is
invalid.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:45:09 +10:00
Andrew Gregory
ae97082e98 fill in name_hash for assumeinstalled options
alpm_depend_t is an exposed data type.  Front-ends may opt for alloc'ing
one and filling the fields manually, but alpm's _alpm_hash_sdbm is not
exposed, making it impossible for them to fill in the name_hash field.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:42:26 +10:00
Andrew Gregory
48f4efd9a1 copy assumeinstalled options
All other option setters copy their input.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:41:14 +10:00
Andrew Gregory
ccd3a3eb9f check assumeinstalled for meaningful mod
assumeinstalled options are used as provisions for which MOD_EQ and
MOD_ANY are the only meaningful settings.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:40:00 +10:00
Andrew Gregory
1ee2032b7f check dep versions before calling strcmp
Fixes a segfault when trying to remove an assumeinstalled
option without a version.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:39:15 +10:00
Rikard Falkeborn
2d0e2bf255 pacman/util.c: Fix memory leak if realloc fails
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:36:21 +10:00
Allan McRae
b8c9385b8b Remove ko_KR translation
The "ko_KR" locale is the same as the "ko" locale.  Remove the "ko_KR" variant
as it is incomplete and has been superseded by "ko" on transifex.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:36:03 +10:00
Allan McRae
877578762c libmakepkg: move color settings to function
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-20 14:56:12 +10:00
Allan McRae
8566034866 pacman/files.c: fix memory leak on regex error
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-20 13:41:36 +10:00
Levente Polyak
deac973188 ensure matching database and package version
While loading each package ensure that the internal version matches the
expected database version to avoid the possibility to circumvent the
version check.
This issue can be used by an attacker to trick the software into
installing an older version. The behavior can be  exploited by a
man-in-the-middle attack through specially crafted  database tarball
containing a higher version, yet actually delivering an  older and
vulnerable version, which was previously shipped.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Signed-off-by: Remi Gacogne <rgacogne@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-20 12:50:39 +10:00
Dave Reisner
445aa3b52c dont remove x bit when marking pkgdir RO
f170a94c13 potentially causes $pkgdirbase/$pkg to be undeleteable
with -R or -C if a previous build was interrupted. We simply can't
traverse to this directory, and rm blows up.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-20 12:50:25 +10:00
Allan McRae
bbab90836b libmakepkg: lint_package requires cd_safe
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-20 11:43:27 +10:00
Allan McRae
3c41030964 Handle repo/pkg style arguments to sync repo file listing
Passing "-Fl pkg" will print the filelist for the first occurance of "pkg"
in the sync repos. Other version of the package can be printed using
"-Fl repo/pkg".

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:31 +10:00
Allan McRae
fd9ff672b0 Add regex search option to sync database file searching
e.g. pacman -Fsx kcm.*print.*\.so

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:31 +10:00
Allan McRae
acf95f6b3b Implement searching for a file in the sync databases
Locates all packages that contain the listed file
e.g. pacman -Fs libpng.so

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:31 +10:00
Allan McRae
137a4086de Implement listing files from sync packages
Does the equivalent of the -Ql option for local packages

e.g. pacman -Fl glibc

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae
488ca24265 Implement locating file owner in sync files database
Equivalent to -Qo but for packages in the sync database
e.g.  pacman -Fo /usr/bin/pacman

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae
5782b8356c Prototype pacman files database operations
Add the -F/--files operations, -s/--sync support and nd provide dummy
functions for -s/--search, -l/-list and -o/--owns.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae
e49abc9860 pacman: move database syncing to util.c
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae
b0dac754d2 Add pacman support for .files databases
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae
289fdf0d1d Read file lists from databases
If a sync database contains a "files" file, the file list will be read.

Currently, there is no known demand for the file list to be lazy loaded by
any libalpm frontend, so these files are read whenever present. Lazy loading
can be implemented when a demand exists.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae
f6c55b3c3f Allow frontends to specify the sync database extension
This allows frontends to select between the .db and .files databases
currently supplied by repo-add or any other compatible database.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:29 +10:00
Allan McRae
1ada16f017 Fix formatting in parsearg_upgrade
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-14 20:46:03 +10:00
Allan McRae
2d7a41539b Simplify sync_cleandb
1) Remove checks for removing pre-tardb files
2) Remove the long redundant keep_used parameter
3) Fix pacman error due to removing .sig file along with database

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-14 20:45:55 +10:00
Allan McRae
94204d1089 Do not warn about packages that optionally require a removal when ignoring deps
If a transaction is removing a package while ignoring all dependencies, there
should not be any warning about other packages optionally requiring it.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-14 17:15:33 +10:00
Allan McRae
ff487212a2 Do not warn about downgrades when only downloading package
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-12 16:23:25 +10:00
Andrew Gregory
2e5e496eb0 Fix overflow warnings
Fix new warnings generated by gcc-5 about potential overflows.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-12 16:23:18 +10:00
Lukas Fleischer
a187fa4562 Match providers when showing optdep install status
Use alpm_find_satisfier() instead of alpm_db_get_pkg() when retrieving
the install status of a package to make sure we spot providers as well.

Fixes FS#36412

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-06-20 17:32:57 +10:00