59 Commits
Author SHA1 Message Date
David Kalnischkies d1d093713a Drop SHA2 define from config as the code is gone
We don't ship the code this define was effecting since 2020,
so defining this constant is pointless.

References: e8016805b8
Gbp-Dch: Ignore
2022-04-01 11:44:26 +02:00
David Kalnischkies c8d65a59a3 Remove unused config check for pre-XXH3 cache hashing
References: 1460eebf2a
Gbp-Dch: Ignore
2021-02-03 17:36:45 +01:00
Julian Andres Klode 1460eebf2a Use XXH3 for cache, hash table hashing
XXH3 is faster than both our CRC32c implementation as well
as DJB hash for hash table hashing, so meh, let's switch to
it.
2020-12-15 13:47:22 +01:00
David Kalnischkies 287912d6fc Rename CMake find_package helpers to avoid developer warnings
| CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
|   The package name passed to `find_package_handle_standard_args` (Berkeley)
|   does not match the name of the calling package (BerkeleyDB).  This can lead
|   to problems in calling code that expects `find_package` result variables
|   (e.g., `_FOUND`) to follow a certain pattern.
| Call Stack (most recent call first):
|   CMake/FindBerkeleyDB.cmake:57 (find_package_handle_standard_args)
|   CMakeLists.txt:83 (find_package)
| This warning is for project developers.  Use -Wno-dev to suppress it.

And indeed, we checked for BERKLEY_DB_FOUND which was not defined so our
HAVE_BDB was not set – just that it is never used, so it wasn't noticed.
2020-11-05 09:40:50 +01:00
Julian Andres Klode b2fcaa39ca CMake/Translations: Replace master with primary 2020-08-04 12:12:10 +02:00
Julian Andres Klode 9f78677281 CMake: Rename add_slaves() to add_links()
Sorry!
2020-07-14 16:04:56 +02:00
David Kalnischkies c378f9ee57 Stub out i18n methods for -DUSE_NLS=OFF
Replacing the macros with stub inline functions allows for more
versatile usage, e.g. fixing this compile error:

In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/c++locale.h:41,
                 from /usr/include/c++/9/bits/localefwd.h:40,
                 from /usr/include/c++/9/ios:41,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from include/apt-pkg/configuration.h:30,
                 from ../apt-pkg/contrib/netrc.cc:16:
/usr/include/c++/9/clocale:54:11: error: ‘::setlocale’ has not been declared
   54 |   using ::setlocale;

Gbp-Dch: Ignore
2020-05-25 12:05:00 +02:00
David Kalnischkies 574249cd72 Allow FMV SSE4.2 detection to succeed on clang
As the builtins were used in the feature test also in the default branch
clang fails to compile the test helpfully complaining that you need to
compile with sse4.2 to use that while on gcc it is optimized out as
unused code and produces only a warning for that… removing the code from
the default branch fixes this problem, but we adapt the code some more to
avoid compilers optimizing it out in the future just in case.
2020-05-25 12:05:00 +02:00
David Kalnischkies fd47da4e86 Use "po4a --porefs file" instead of undocumented compat noline
References: https://github.com/mquinson/po4a/commit/329f472a378d42c7a33e8110e5091be61480a0fc
2020-05-08 16:38:20 +02:00
David Kalnischkies 94ea8e66ca Drop nowrap from po4a --porefs as it is no longer supported
Upstream says it had no effect before, so it seems safe to adapt.

References: https://github.com/mquinson/po4a/commit/ac1e97305b6073ed87fa8cf0a2e32f9b1255d0f1
2020-05-08 16:34:36 +02:00
Julian Andres Klode 814ffcfaf3 hashes: Use Libgcrypt for hashing purposes
Switch the code of the Hashes class to use libgcrypt, which allows
us to use hardware-accelerated implementations of SHA1 and friends.
2020-01-14 13:10:36 +01:00
Julian Andres Klode b911b2f6ed Only define likely/unlikely if APT_COMPILING_APT set
This ensures that we do not leak simple words like that.
2020-01-07 22:51:41 +01:00
Julian Andres Klode daa1352ed3 Run unifdef -DAPT_{8,9,10,15}_CLEANER_HEADERS 2019-06-12 15:02:55 +02:00
Julian Andres Klode 60cc44d160 Prevent shutdown while running dpkg
As long as we are running dpkg, keep an inhibitor that
blocks us from shutting down.

LP: #1820886
2019-05-03 16:37:50 +02:00
Julian Andres Klode 2fa5e51a52 Correctly handle feature detection for sse4.2 and crc32
Mistakingly used #define instead of #cmakedefine
2019-02-04 18:15:24 +01:00
Julian Andres Klode 2cc1b3a3ee Detect function multiversioning and sse4.2/crc32, enables i386
This fixes the build on kfreebsd-amd64, and due to the detection
of sse4.2, should also enable the sse4.2 on i386.
2019-02-04 15:21:32 +01:00
Guillem Jover 164f1b78d1 Remove obsolete RCS keywords
Prompted-by: Jakub Wilk <jwilk@debian.org>
2018-05-07 13:41:31 +02:00
Julian Andres Klode 4de4200ec2 apt-pkg: Add support for zstd
zstd is a compression algorithm developed by facebook. At level 19,
it is about 6% worse in size than xz -6, but decompression is multiple
times faster, saving about 40% install time, especially with eatmydata
on cloud instances.
2018-03-12 08:56:59 +01:00
Julian Andres Klode dfb4c178b4 Translate shared documentation parts again
We accidentally did not translate the entity file, but should
have. This makes apt.ent translatable again. This generates the
target multiple times, but surprisingly, that works just fine, so
let's just keep it that way, as it's clean code otherwise.
2017-11-20 21:48:30 +01:00
Julian Andres Klode 924eaf3c1a CMake: Get rid of some debugging messages
This fixes a regression introduced in

commit 43b9eb5bac

  CMake: methods: Cleanup link libraries, use OBJECT libraries

Gbp-Dch: ignore
2017-10-26 00:30:48 +02:00
Julian Andres Klode 43b9eb5bac CMake: methods: Cleanup link libraries, use OBJECT libraries
Use OBJECT libraries for http and connect stuff, and move the
seccomp link expression into a global link_libraries() call.

This also fixes a bug where only the http target pulled in
the gnutls header arguments despite gnutls being used in
connect.cc, and thus by mirror and ftp as well.

Adjust translation support to ignore TARGET_OBJECTS sources
and add the OBJECT libraries to the translated files.
2017-10-23 04:19:19 +02:00
Julian Andres Klode 32bcbd73e0 Sandbox methods with seccomp-BPF; except cdrom, gpgv, rsh
This reduces the number of syscalls to about 140 from about
350 or so, significantly reducing security risks.

Also change prepare-release to ignore the architecture lists
in the build dependencies when generating the build-depends
package for travis.

We might want to clean up things a bit more and/or move it
somewhere else.
2017-10-22 23:38:31 +02:00
Julian Andres Klode 96b4580561 Directly link against libudev on Linux systems
We previously dlopen()ed it, but it seems painful to do that
without any real gain, except for possibly not having libudev
in the address space and not having code #ifdefed for Linux.

The latter means that we are a bit more likely to break stuff
for non-Linux systems now if we play with udev, but at least
we don't end up with it silently breaking because of a libudev
ABI break.

The existing function pointers in the struct were renamed and
kept for compat purposes.

Fixes Debian/apt#48

Also adjust prepare-release to strip [linux-any] from build-depends
for travis.
2017-09-09 21:07:31 +02:00
David Kalnischkies ea408c560e reimplement and document auth.conf
We have support for an netrc-like auth.conf file since 0.7.25 (closing
518473), but it was never documented in apt that it even exists and
netrc seems to have fallen out of usage as a manpage for it no longer
exists making the feature even more arcane.

On top of that the code was a bit of a mess (as it is written in c-style)
and as a result the matching of machine tokens to URIs also a bit
strange by checking for less specific matches (= without path) first.
We now do a single pass over the stanzas.

In practice early adopters of the undocumented implementation will not
really notice the differences and the 'new' behaviour is simpler to
document and more usual for an apt user.

Closes: #811181
2017-07-26 19:09:04 +02:00
Julian Andres Klode b28636e54f Use C++11 threading support instead of pthread
This makes the code easier to read.
2017-07-20 20:50:05 +02:00