1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00
Commit Graph

2497 Commits

Author SHA1 Message Date
Andrew Gregory
ba0d225d93 extract_single_file: use .pacnew for check files
Prevents the need to rename the file if we end up keeping it and ensures
that pacnew files always reflect the most recent version by overwriting
stale copies.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:47 +10:00
Andrew Gregory
926280cfc7 remove support for .pacorig files
Leave user files in place and save new config files with a .pacnew
extension.  This reduces the complexity of file extraction and respects
the principle that pacman shouldn't modify files it didn't create.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:47 +10:00
Andrew Gregory
a82a5cf3f7 extract_single_file: use full path in messages
If an error occurs the actual path being extracted is more useful than
the original path from the package file list.  The original path is
still used for checks that use it directly.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:47 +10:00
Andrew Gregory
4ba0561fe7 extract_single_file: factor out db file extraction
alpm's database files (.INSTALL, .MTREE, etc.) should be extracted no
matter what; skip mtree/needbackup/noextract/noupgrade checks for them.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:47 +10:00
Andrew Gregory
f917a4a55a extract_single_file: reduce indentation
Puts all of the conflict cases at the same level.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:47 +10:00
Andrew Gregory
63660afbc7 extract_single_file: consolidate needbackup checks
We need to know if a file needs to be backed up for all extracted files.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:47 +10:00
Andrew Gregory
95121cc4f1 conf.c: use masks for siglevel inheritance
This will allow pacman to parse its config file in a single pass and
removes the need for the *_SET siglevels in alpm that were only required
for pacman's siglevel inheritance.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:46 +10:00
Allan McRae
92febc847c Merge branch 'maint' 2015-01-21 14:27:25 +10:00
Daniel Micay
c6263da168 fix geometric growth in _alpm_greedy_grow
It was allocating the required size rather than the calculated new size,
resulting in pathological incremental reallocations.

Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-21 14:27:04 +10:00
Daniel Micay
21281e9b69 be_local: fix _alpm_greedy_grow usage
The files_size variable contains the current capacity (in bytes) and
should not be used to calculate the next length increment. It only works
because _alpm_greedy_grow currently results in incremental growth.

Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-21 14:26:54 +10:00
Andrew Gregory
8da9be0955 initialize pointers passed to _alpm_pkg_dup
_alpm_pkg_dup leaves the destination pointer unaltered in case of fatal
errors, so when commits 2f0ca00e and be4198b3 freed the pointer, they
fixed a memory leak on non-fatal errors by replacing it with
a segmentation fault on fatal errors.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-02 21:48:59 +10:00
Andrew Gregory
4060c5c77f be_package.c: fix style violation
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-02 21:48:59 +10:00
Allan McRae
763fb3d9e7 Remove logically dead code in _alpm_local_db_write
We can only get to cleanup: through fp being NULL due to fopen failing or
normal execution when fclose is called.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:08:32 +10:00
Allan McRae
804688ab6a _alpm_run_chroot: only close working directory if it was opened
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:08:32 +10:00
Allan McRae
2f0ca00e55 _alpm_db_add_pkgincache: free potential memory leak
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:08:32 +10:00
Allan McRae
60d958c78b Initialize memory to prevent issues when freeing on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:08:32 +10:00
Allan McRae
be4198b34e _alpm_recursedeps: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:08:32 +10:00
Allan McRae
32413213cb apply_deltas: fix memory leak on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:08:32 +10:00
Allan McRae
25b492aab6 Merge branch 'maint' 2014-12-27 17:07:04 +10:00
Allan McRae
5221440b6b fix duplication of package sha256sum
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:04:53 +10:00
Johannes Löthberg
1f1e53c208 libalpm: Add accessors for the base field
This commit adds the necessary accessor functions to get the PKGBASE of
a package, forcing the desc file to be parsed.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:30 +10:00
Johannes Löthberg
9f527d2de4 libalpm: Parse and write PKGBASEs
This commit adds support to libalpm to parse the pkgbase present in
packages .PKGINFO files, writing the PKGBASE to the %BASE% section of
the local DBs desc files and for parsing it again when loading the local
DB

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:30 +10:00
Allan McRae
21faf1682e mount_point_list: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:30 +10:00
Allan McRae
2114ef1874 conflict_new: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:30 +10:00
Allan McRae
9cf1b2c004 _alpm_runscriptlet: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:30 +10:00
Allan McRae
88eedef6c6 add_fileconflict: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:30 +10:00
Allan McRae
52d2ff648d create_tempfile: fix memory leak on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:30 +10:00
Allan McRae
123ecb8e07 _alpm_split_backup: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
c6dd581ec5 alpm_dep_from_string: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
27506aba8f _alpm_conflict_dup: fix memory leak on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
46459da39b local_db_read: fix memory leak on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
895780bd9a _alpm_db_new: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
87e55a4ee7 _alpm_db_get_pkgcache_hash: check for error when loading pkgcache
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
cd5e4b89f4 _alpm_delta_parse: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
e892234207 _alpm_dep_dup: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
c0d9d26070 build_payload: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
32ebd7ad5d depmiss_new: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:29 +10:00
Allan McRae
bf06efaa78 _alpm_delta_dup: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:19:28 +10:00
Evangelos Foutras
c07593c64c Use correct mode bits for the log file (0000 -> 0644)
Following commit 086bbc5 (Use O_CLOEXEC as much as possible when opening
files), the log file would be created by pacman with blank permissions.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:15:25 +10:00
Allan McRae
54db3745d6 Update translations from transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-19 13:53:35 +10:00
Andrew Gregory
3af0268fdb remove.c: honor inverted patterns in noupgrade
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-18 22:22:35 +10:00
Andrew Gregory
df36fe2e79 add alpm_option_match_noupgrade
For parity with alpm_option_match_noextract.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-18 22:22:35 +10:00
Dave Reisner
ef0577e3d5 version: fix memory leak in early return
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-19 14:14:04 +10:00
Allan McRae
3446453c72 Fix translation error and remove empty po files
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-19 14:13:15 +10:00
Allan McRae
193b2b33f8 Update po files to send to Transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 15:14:51 +10:00
Allan McRae
db402d6029 Pull translation updates from Transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 15:12:40 +10:00
Allan McRae
96e9cf35f1 Add alpm_option_match_noextract
This is useful for frontends testing whether a file is in NoExtract

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 12:31:30 +10:00
Allan McRae
5d11605958 extract_single_file: fix memory leak in error condition
The memory assigned to checkfile was leaked in the error condition.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 11:58:26 +10:00
Allan McRae
5d618438c4 _alpm_backup_dup: fix memory leak in error case
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 11:58:26 +10:00
Allan McRae
d9aa7025ea Remove logging of NoExtract events
With globbing in NoExtract, these log events can quickly pile up hiding
important information from the log.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 11:58:25 +10:00