summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
AgeCommit message (Collapse)AuthorFilesLines
2015-02-01trans_commit: restore pm_errno after updating logAndrew Gregory1-0/+4
If the call to alpm_logaction failed it would overwrite pm_errno, leading to error messages unrelated to the actual reason the transaction failed. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-21extract_single_file: consolidate extraction logicAndrew Gregory1-79/+61
Also adds checks that the filename does not exceed PATH_MAX. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21extract_single_file: use .pacnew for check filesAndrew Gregory1-27/+13
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-21remove support for .pacorig filesAndrew Gregory2-73/+24
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-21extract_single_file: use full path in messagesAndrew Gregory1-18/+13
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-21extract_single_file: factor out db file extractionAndrew Gregory1-28/+32
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-21extract_single_file: reduce indentationAndrew Gregory1-55/+51
Puts all of the conflict cases at the same level. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21extract_single_file: consolidate needbackup checksAndrew Gregory1-39/+15
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-21conf.c: use masks for siglevel inheritanceAndrew Gregory2-4/+1
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-21Merge branch 'maint'Allan McRae2-2/+2
2015-01-21fix geometric growth in _alpm_greedy_growDaniel Micay1-1/+1
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-21be_local: fix _alpm_greedy_grow usageDaniel Micay1-1/+1
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-02initialize pointers passed to _alpm_pkg_dupAndrew Gregory2-2/+2
_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-02be_package.c: fix style violationAndrew Gregory1-1/+2
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27Remove logically dead code in _alpm_local_db_writeAllan McRae1-5/+0
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_alpm_run_chroot: only close working directory if it was openedAllan McRae1-1/+3
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27_alpm_db_add_pkgincache: free potential memory leakAllan McRae1-0/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27Initialize memory to prevent issues when freeing on errorAllan McRae2-4/+4
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27_alpm_recursedeps: free memory on errorAllan McRae1-0/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27apply_deltas: fix memory leak on errorAllan McRae1-2/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27Merge branch 'maint'Allan McRae1-1/+1
2014-12-27fix duplication of package sha256sumAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24libalpm: Add accessors for the base fieldJohannes Löthberg4-0/+23
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-24libalpm: Parse and write PKGBASEsJohannes Löthberg5-1/+12
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-24mount_point_list: free memory on errorAllan McRae1-3/+3
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24conflict_new: free memory on errorAllan McRae1-2/+6
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24_alpm_runscriptlet: free memory on errorAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24add_fileconflict: free memory on errorAllan McRae1-0/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24create_tempfile: fix memory leak on errorAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24_alpm_split_backup: free memory on errorAllan McRae1-4/+3
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24alpm_dep_from_string: free memory on errorAllan McRae1-3/+7
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24_alpm_conflict_dup: fix memory leak on errorAllan McRae1-2/+6
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24local_db_read: fix memory leak on errorAllan McRae1-0/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24_alpm_db_new: free memory on errorAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24_alpm_db_get_pkgcache_hash: check for error when loading pkgcacheAllan McRae1-1/+4
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24_alpm_delta_parse: free memory on errorAllan McRae1-4/+8
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24_alpm_dep_dup: free memory on errorAllan McRae1-3/+7
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24build_payload: free memory on errorAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24depmiss_new: free memory on errorAllan McRae1-2/+6
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24_alpm_delta_dup: free memory on errorAllan McRae1-4/+8
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24Use correct mode bits for the log file (0000 -> 0644)Evangelos Foutras1-1/+1
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-19Update translations from transifexAllan McRae43-1495/+3156
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-18remove.c: honor inverted patterns in noupgradeAndrew Gregory1-2/+2
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-18add alpm_option_match_noupgradeAndrew Gregory2-0/+6
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-11-19version: fix memory leak in early returnDave Reisner1-1/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-19Fix translation error and remove empty po filesAllan McRae4-1619/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18Update po files to send to TransifexAllan McRae38-1238/+9332
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18Pull translation updates from TransifexAllan McRae43-1039/+4446
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18Add alpm_option_match_noextractAllan McRae2-0/+6
This is useful for frontends testing whether a file is in NoExtract Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18extract_single_file: fix memory leak in error conditionAllan McRae1-1/+1
The memory assigned to checkfile was leaked in the error condition. Signed-off-by: Allan McRae <allan@archlinux.org>