Commit Graph

3536 Commits

Author SHA1 Message Date
Juan RP
b12b72e151
xbps-install/state_cb.c: minor tweaks. 2019-06-18 21:17:44 +02:00
Juan RP
6627ffb84f
xbps_package_remove: use xbps_set_pkg_state_dictionary().
fixes a use-after-free found by @duncaen via gcc -fsanitize=address.
2019-06-18 20:55:47 +02:00
Juan RP
829c5835f1
alternatives: respect (and love) current provider.
Added a new test case to verify.

Close #126
2019-06-18 20:47:55 +02:00
Duncaen
27b9da6c9a tests: don't rely one files mtime 2019-06-18 19:54:22 +02:00
Duncaen
f4bf826c7f tests: add two more test cases for obsolete files 2019-06-18 19:54:22 +02:00
Duncaen
8837e8c607 lib/transaction_files.c: better handle preserve files 2019-06-18 19:54:22 +02:00
Duncaen
f2b119ef31 lib/transaction_files.c: better error and debug messages and minor cleanup 2019-06-18 19:54:22 +02:00
Duncaen
f6bf9b44ce tests: add tests for package preserve keyword 2019-06-18 19:54:22 +02:00
Duncaen
3915d523d0 tests: add test for conflicting files in transaction 2019-06-18 19:54:22 +02:00
Duncaen
247463e359 tests: add two new tests for transaction_files 2019-06-18 19:54:22 +02:00
Duncaen
6877d28139 lib/package_find_obsoletes.c: remove in favor of transaction file checks 2019-06-18 19:54:22 +02:00
Duncaen
888289786b tests: move file type change tests to obsolete files 2019-06-18 19:54:22 +02:00
Duncaen
bf4740040f tests: Update package to meta moving files to dependency and replaces
https://github.com/void-linux/xbps/issues/12
2019-06-18 19:54:22 +02:00
Duncaen
c8ef119f4b tests: enable debug flag in directory to symlink test 2019-06-18 19:54:22 +02:00
Duncaen
0efb59a979 lib/transaction_files.c: fix undefined behaviour 2019-06-18 19:54:22 +02:00
Duncaen
f45c6798c9 lib/transaction_files.c: update package archive compressions 2019-06-18 19:54:22 +02:00
Duncaen
f5e6d33c6e tests: update test issue31 2019-06-18 19:54:22 +02:00
Duncaen
69e64e6c21 tests: enable test 'replace directory with symlink' 2019-06-18 19:54:22 +02:00
Johannes Brechtmann
514dca27ef tests: update replaces file with directory 2019-06-18 19:54:22 +02:00
Duncaen
8a81f6ce86 lib/package_unpack.c: use transaction obsolete detection 2019-06-18 19:54:22 +02:00
Duncaen
658f87b9c5 lib/transaction_files.c: rework to remove obsoletes before unpacking 2019-06-18 19:54:22 +02:00
Duncaen
66e5b721ae tests: obsoletefiles_test:reinstall_obsoletes add debug flag and different rv 2019-06-18 19:54:22 +02:00
Duncaen
2a9029b736 tests: fix tests; transaction detect if multiple packages install the same file 2019-06-18 19:54:22 +02:00
Duncaen
a19c659616 bin/xbps-install: add the transaction_file states 2019-06-18 19:54:22 +02:00
Duncaen
29f1433afd lib/transaction_files.c: collect file installs/removals to correctly find obsoletes 2019-06-18 19:54:22 +02:00
Duncaen
91e428d54d bin/xbps-create: record file size in files.plist 2019-06-18 19:54:22 +02:00
Duncaen
c533f1bd52 tests: change the obsoletefiles tests to have the same mtime
This is required because the of reproducibility changes.
2019-06-18 19:54:22 +02:00
Juan RP
00d552424d lib/repo.c: fix dead assignment.
Found by clang-analyzer.

Bug Summary
File: lib/repo.c
Warning: line 162, column 3
Value stored to 'rv' is never read
2019-06-18 18:49:29 +02:00
Juan RP
eddd2cd602 xbps-checkvers: stop abusing assert().
assert() must not change program behaviour.

It's unlikely that xbps_dictionary_set_cstring() fails, but even
so proplib will report it, so no need to run it via assert().
2019-06-18 18:49:29 +02:00
Juan RP
286193515c xbps-rindex/repoflush.c: pass correct filename to unlink(). 2019-06-18 18:49:29 +02:00
Juan RP
8018f53e0a xbps-rindex/repoflush.c: stop abusing assert().
assert() must not change the program behaviour.

Make sure fchmod() and rename() succeed properly and
fail gracefully otherwise.
2019-06-18 18:49:29 +02:00
Juan RP
ab44f4ef80 lib/portableproplib/rb.c: fix dead initialization.
Found by clang analyzer.

Bug Summary
File: lib/portableproplib/rb.c
Warning: line 363, column 19
Value stored to 'grandpa' during its initialization is never read
2019-06-18 18:49:29 +02:00
Juan RP
6b84d75dc1 lib/transaction_dictionary.c: fix dead assignment.
Found by clang-analyzer.

Bug Summary
File: lib/transaction_dictionary.c
Warning: line 68, column 2
Value stored to 'rootdir_free_size' is never read
2019-06-18 18:49:29 +02:00
Juan RP
6fe5bbc596 lib/transaction_ops.c: fix a dead assignment.
Found by clang-analyzer.

Bug Summary
File: lib/transaction_ops.c
Warning: line 274, column 4
Value stored to 'rv' is never read
2019-06-18 18:49:29 +02:00
Juan RP
363f5a93de lib/Makefile: disable pkgdb_conversion.c.
It was made many years ago to update the pkgdb format, but
it's innecessary to build it by default because is dead code.

Anyway keep it just in case pkgdb format changes.
2019-06-18 18:49:29 +02:00
Juan RP
fd88298755 lib/fetch/common.c: fix memleak in happy_eyeballs_connect.
Found by clang-analyzer.

Bug Summary

File: lib/fetch/common.c
Warning: line 587, column 4
Potential leak of memory pointed to by 'pfd'
2019-06-18 18:49:29 +02:00
Juan RP
d16a2fc987 xbps_init: fix a logic error.
Initialize rv to avoid a logic error.

Found by clang-analyzer.

Bug Summary
File: lib/initend.c
Warning: line 101, column 10
The left operand of '<' is a garbage value
2019-06-18 18:49:29 +02:00
Juan RP
87f7766c5f xbps_symlink_target: fix two memleaks found by clang-analyzer. 2019-06-18 18:49:29 +02:00
Juan RP
042ab422b2 xbps-dgraph/main.c: simplify logic.
Thanks to clang-analyzer for reporting a dead assignment
that lead me to rework the logic.
2019-06-18 18:49:29 +02:00
Juan RP
5f68687cbb bin/xbps-install/main.c: fix dead assignment.
Found by clang-analyzer.

Bug Summary

File: bin/xbps-install/main.c
Warning: line 246, column 5
Value stored to 'rv' is never read
2019-06-18 18:49:29 +02:00
Juan RP
daf65b0767 bin/xbps-install/main.c: fix dead assignment.
Found by clang-analyzer.

Bug Summary

File: bin/xbps-install/main.c
Warning: line 259, column 5
Value stored to 'rv' is never read
2019-06-18 18:49:29 +02:00
Juan RP
d36d37fc6a lib/external/fexec.c: fix potential insecure usage in vfork().
Reported by clang-analyzer.

After reading the linux man-pages vfork(2) manpage I came to the
conclusion that it's better to change the behaviour of the
original source (NetBSD) and change this to use fork(2).
2019-06-18 18:49:29 +02:00
Juan RP
0ee0aaa395 xbps-pkgdb/check_pkg_alternatives.c: dead store.
Reported by clang-analyzer.
2019-06-18 18:49:29 +02:00
Juan RP
b6a13945e0 xbps: restore default repodata compression format (gzip/zlib).
Any compression format from that list is supported without
additional changes: gzip, bzip2, lz4, xz, zstd.

This is for repository data and binary packages.

Close #122
2019-06-18 18:37:19 +02:00
Duncaen
3677986c7e bin/xbps-checkvers: store character returned by fgetc in int
The character has to be checked for EOF (-1), otherwise with
architectures that use unsigned char by default this breaks at
compile and runtime.

https://github.com/void-linux/xbps/issues/123
2019-06-18 15:04:47 +02:00
Juan RP
7f141ca5d7
README.md: new section "Building and testing for dummies" 2019-06-17 22:28:01 +02:00
Duncaen
9a2a85d231 NEWS: fixup to add myself where I forgot 2019-06-17 20:34:31 +02:00
Duncaen
b677615565 NEWS: add my merged changes 2019-06-17 20:32:20 +02:00
Juan RP
53a672db54
README.md: proper order for compfmts. 2019-06-17 14:03:59 +02:00
Juan RP
1237e6eef7
README.md: mention test suite, proper credit, etc. 2019-06-17 13:58:49 +02:00